datawire_mdk 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/quark/spi.rb ADDED
@@ -0,0 +1,130 @@
1
+ # Quark 1.0.406 run at 2016-08-31 13:21:53.028839
2
+ module Quark
3
+ def self.quark; Quark; end
4
+ module Quark
5
+ def self.spi; Spi; end
6
+ module Spi
7
+ require "datawire-quark-core"
8
+ require_relative 'reflect' # 1 () ()
9
+ require_relative '../quark' # 0 () ('quark',)
10
+ require_relative '../datawire_mdk_md' # 0 () ('quark',)
11
+ require_relative 'logging' # 1 () ()
12
+ require_relative 'spi_api_tracing' # 1 () ()
13
+ require_relative 'spi_api' # 1 () ()
14
+
15
+
16
+ def self.RuntimeSpi; RuntimeSpi; end
17
+ class RuntimeSpi < ::DatawireQuarkCore::QuarkObject
18
+ extend ::DatawireQuarkCore::Static
19
+
20
+ static quark_spi_RuntimeSpi_ref: -> { nil }
21
+
22
+
23
+
24
+ def initialize()
25
+ self.__init_fields__
26
+
27
+ nil
28
+ end
29
+
30
+
31
+
32
+
33
+ def __init_fields__()
34
+
35
+
36
+ nil
37
+ end
38
+
39
+
40
+ end
41
+ RuntimeSpi.unlazy_statics
42
+
43
+ def self.RuntimeFactory; RuntimeFactory; end
44
+ class RuntimeFactory < ::DatawireQuarkCore::QuarkObject
45
+ extend ::DatawireQuarkCore::Static
46
+
47
+ static factory: -> { ::Quark.quark.spi.RuntimeFactory.new() }
48
+ static enable_tracing: -> { true }
49
+ static env_checked: -> { false }
50
+ static quark_spi_RuntimeFactory_ref: -> { nil }
51
+
52
+
53
+
54
+ def initialize()
55
+ self.__init_fields__
56
+
57
+ nil
58
+ end
59
+
60
+
61
+
62
+
63
+ def makeRuntime()
64
+
65
+ spi = ::DatawireQuarkCore::Runtime.new
66
+ api = nil
67
+ if (!(::Quark.quark.spi.RuntimeFactory.env_checked))
68
+ ::Quark.quark.spi.RuntimeFactory.enable_tracing = (::Quark.quark.logging.Config._getOverrideIfExists()) != (nil)
69
+ ::Quark.quark.spi.RuntimeFactory.env_checked = true
70
+ end
71
+ if (::Quark.quark.spi.RuntimeFactory.enable_tracing)
72
+ api = ::Quark.quark.spi_api_tracing.RuntimeProxy.new(spi)
73
+ else
74
+ api = ::Quark.quark.spi_api.RuntimeProxy.new(spi)
75
+ end
76
+ return api
77
+
78
+ nil
79
+ end
80
+
81
+ def _getClass()
82
+
83
+ return "quark.spi.RuntimeFactory"
84
+
85
+ nil
86
+ end
87
+
88
+ def _getField(name)
89
+
90
+ if ((name) == ("factory"))
91
+ return ::Quark.quark.spi.RuntimeFactory.factory
92
+ end
93
+ if ((name) == ("enable_tracing"))
94
+ return ::Quark.quark.spi.RuntimeFactory.enable_tracing
95
+ end
96
+ if ((name) == ("env_checked"))
97
+ return ::Quark.quark.spi.RuntimeFactory.env_checked
98
+ end
99
+ return nil
100
+
101
+ nil
102
+ end
103
+
104
+ def _setField(name, value)
105
+
106
+ if ((name) == ("factory"))
107
+ ::Quark.quark.spi.RuntimeFactory.factory = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi.RuntimeFactory }
108
+ end
109
+ if ((name) == ("enable_tracing"))
110
+ ::Quark.quark.spi.RuntimeFactory.enable_tracing = ::DatawireQuarkCore.cast(value) { ::Object }
111
+ end
112
+ if ((name) == ("env_checked"))
113
+ ::Quark.quark.spi.RuntimeFactory.env_checked = ::DatawireQuarkCore.cast(value) { ::Object }
114
+ end
115
+
116
+ nil
117
+ end
118
+
119
+ def __init_fields__()
120
+
121
+
122
+ nil
123
+ end
124
+
125
+
126
+ end
127
+ RuntimeFactory.unlazy_statics
128
+ end # module Spi
129
+ end # module Quark
130
+ end # module Quark
@@ -0,0 +1,489 @@
1
+ # Quark 1.0.406 run at 2016-08-31 13:21:53.028839
2
+ module Quark
3
+ def self.quark; Quark; end
4
+ module Quark
5
+ def self.spi_api; SpiApi; end
6
+ module SpiApi
7
+ require "datawire-quark-core"
8
+ require_relative 'reflect' # 1 () ()
9
+ require_relative '../quark' # 0 () ('quark',)
10
+ require_relative '../datawire_mdk_md' # 0 () ('quark',)
11
+ require_relative 'concurrent' # 1 () ()
12
+
13
+
14
+ def self.ServletProxy; ServletProxy; end
15
+ class ServletProxy < ::DatawireQuarkCore::QuarkObject
16
+ attr_accessor :servlet_impl, :real_runtime
17
+ extend ::DatawireQuarkCore::Static
18
+
19
+ static quark_spi_api_ServletProxy_ref: -> { nil }
20
+
21
+
22
+
23
+ def initialize(real_runtime, servlet_impl)
24
+
25
+ self.__init_fields__
26
+ (self).real_runtime = real_runtime
27
+ (self).servlet_impl = servlet_impl
28
+
29
+ nil
30
+ end
31
+
32
+
33
+
34
+
35
+ def onServletInit(url, runtime)
36
+
37
+ @servlet_impl.onServletInit(url, @real_runtime)
38
+
39
+ nil
40
+ end
41
+
42
+ def onServletError(url, error)
43
+
44
+ @servlet_impl.onServletError(url, error)
45
+
46
+ nil
47
+ end
48
+
49
+ def onServletEnd(url)
50
+
51
+ @servlet_impl.onServletEnd(url)
52
+
53
+ nil
54
+ end
55
+
56
+ def _getClass()
57
+
58
+ return "quark.spi_api.ServletProxy"
59
+
60
+ nil
61
+ end
62
+
63
+ def _getField(name)
64
+
65
+ if ((name) == ("servlet_impl"))
66
+ return (self).servlet_impl
67
+ end
68
+ if ((name) == ("real_runtime"))
69
+ return (self).real_runtime
70
+ end
71
+ return nil
72
+
73
+ nil
74
+ end
75
+
76
+ def _setField(name, value)
77
+
78
+ if ((name) == ("servlet_impl"))
79
+ (self).servlet_impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.Servlet }
80
+ end
81
+ if ((name) == ("real_runtime"))
82
+ (self).real_runtime = ::DatawireQuarkCore.cast(value) { ::Quark.quark.Runtime }
83
+ end
84
+
85
+ nil
86
+ end
87
+
88
+ def __init_fields__()
89
+
90
+ self.servlet_impl = nil
91
+ self.real_runtime = nil
92
+
93
+ nil
94
+ end
95
+
96
+
97
+ end
98
+ ServletProxy.unlazy_statics
99
+
100
+ def self.HTTPServletProxy; HTTPServletProxy; end
101
+ class HTTPServletProxy < ::Quark.quark.spi_api.ServletProxy
102
+ attr_accessor :http_servlet_impl
103
+ extend ::DatawireQuarkCore::Static
104
+
105
+ static quark_spi_api_HTTPServletProxy_ref: -> { nil }
106
+
107
+
108
+
109
+ def initialize(real_runtime, http_servlet_impl)
110
+
111
+ super(real_runtime, http_servlet_impl)
112
+ (self).http_servlet_impl = http_servlet_impl
113
+
114
+ nil
115
+ end
116
+
117
+
118
+
119
+
120
+ def onHTTPRequest(request, response)
121
+
122
+ @http_servlet_impl.onHTTPRequest(request, response)
123
+
124
+ nil
125
+ end
126
+
127
+ def _getClass()
128
+
129
+ return "quark.spi_api.HTTPServletProxy"
130
+
131
+ nil
132
+ end
133
+
134
+ def _getField(name)
135
+
136
+ if ((name) == ("servlet_impl"))
137
+ return (self).servlet_impl
138
+ end
139
+ if ((name) == ("real_runtime"))
140
+ return (self).real_runtime
141
+ end
142
+ if ((name) == ("http_servlet_impl"))
143
+ return (self).http_servlet_impl
144
+ end
145
+ return nil
146
+
147
+ nil
148
+ end
149
+
150
+ def _setField(name, value)
151
+
152
+ if ((name) == ("servlet_impl"))
153
+ (self).servlet_impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.Servlet }
154
+ end
155
+ if ((name) == ("real_runtime"))
156
+ (self).real_runtime = ::DatawireQuarkCore.cast(value) { ::Quark.quark.Runtime }
157
+ end
158
+ if ((name) == ("http_servlet_impl"))
159
+ (self).http_servlet_impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.HTTPServlet }
160
+ end
161
+
162
+ nil
163
+ end
164
+
165
+ def serveHTTP(url)
166
+
167
+ ::Quark.quark.concurrent.Context.runtime().serveHTTP(url, self)
168
+
169
+ nil
170
+ end
171
+
172
+ def __init_fields__()
173
+
174
+ super
175
+ self.http_servlet_impl = nil
176
+
177
+ nil
178
+ end
179
+
180
+
181
+ end
182
+ HTTPServletProxy.unlazy_statics
183
+
184
+ def self.WSServletProxy; WSServletProxy; end
185
+ class WSServletProxy < ::Quark.quark.spi_api.ServletProxy
186
+ attr_accessor :ws_servlet_impl
187
+ extend ::DatawireQuarkCore::Static
188
+
189
+ static quark_spi_api_WSServletProxy_ref: -> { nil }
190
+
191
+
192
+
193
+ def initialize(real_runtime, ws_servlet_impl)
194
+
195
+ super(real_runtime, ws_servlet_impl)
196
+ (self).ws_servlet_impl = ws_servlet_impl
197
+
198
+ nil
199
+ end
200
+
201
+
202
+
203
+
204
+ def onWSConnect(upgradeRequest)
205
+
206
+ return @ws_servlet_impl.onWSConnect(upgradeRequest)
207
+
208
+ nil
209
+ end
210
+
211
+ def _getClass()
212
+
213
+ return "quark.spi_api.WSServletProxy"
214
+
215
+ nil
216
+ end
217
+
218
+ def _getField(name)
219
+
220
+ if ((name) == ("servlet_impl"))
221
+ return (self).servlet_impl
222
+ end
223
+ if ((name) == ("real_runtime"))
224
+ return (self).real_runtime
225
+ end
226
+ if ((name) == ("ws_servlet_impl"))
227
+ return (self).ws_servlet_impl
228
+ end
229
+ return nil
230
+
231
+ nil
232
+ end
233
+
234
+ def _setField(name, value)
235
+
236
+ if ((name) == ("servlet_impl"))
237
+ (self).servlet_impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.Servlet }
238
+ end
239
+ if ((name) == ("real_runtime"))
240
+ (self).real_runtime = ::DatawireQuarkCore.cast(value) { ::Quark.quark.Runtime }
241
+ end
242
+ if ((name) == ("ws_servlet_impl"))
243
+ (self).ws_servlet_impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.WSServlet }
244
+ end
245
+
246
+ nil
247
+ end
248
+
249
+ def serveWS(url)
250
+
251
+ ::Quark.quark.concurrent.Context.runtime().serveWS(url, self)
252
+
253
+ nil
254
+ end
255
+
256
+ def __init_fields__()
257
+
258
+ super
259
+ self.ws_servlet_impl = nil
260
+
261
+ nil
262
+ end
263
+
264
+
265
+ end
266
+ WSServletProxy.unlazy_statics
267
+
268
+ def self.TaskProxy; TaskProxy; end
269
+ class TaskProxy < ::DatawireQuarkCore::QuarkObject
270
+ attr_accessor :task_impl, :real_runtime
271
+ extend ::DatawireQuarkCore::Static
272
+
273
+ static quark_spi_api_TaskProxy_ref: -> { nil }
274
+
275
+
276
+
277
+ def initialize(real_runtime, task_impl)
278
+
279
+ self.__init_fields__
280
+ (self).task_impl = task_impl
281
+ (self).real_runtime = real_runtime
282
+
283
+ nil
284
+ end
285
+
286
+
287
+
288
+
289
+ def onExecute(runtime)
290
+
291
+ @task_impl.onExecute(@real_runtime)
292
+
293
+ nil
294
+ end
295
+
296
+ def _getClass()
297
+
298
+ return "quark.spi_api.TaskProxy"
299
+
300
+ nil
301
+ end
302
+
303
+ def _getField(name)
304
+
305
+ if ((name) == ("task_impl"))
306
+ return (self).task_impl
307
+ end
308
+ if ((name) == ("real_runtime"))
309
+ return (self).real_runtime
310
+ end
311
+ return nil
312
+
313
+ nil
314
+ end
315
+
316
+ def _setField(name, value)
317
+
318
+ if ((name) == ("task_impl"))
319
+ (self).task_impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.Task }
320
+ end
321
+ if ((name) == ("real_runtime"))
322
+ (self).real_runtime = ::DatawireQuarkCore.cast(value) { ::Quark.quark.Runtime }
323
+ end
324
+
325
+ nil
326
+ end
327
+
328
+ def __init_fields__()
329
+
330
+ self.task_impl = nil
331
+ self.real_runtime = nil
332
+
333
+ nil
334
+ end
335
+
336
+
337
+ end
338
+ TaskProxy.unlazy_statics
339
+
340
+ def self.RuntimeProxy; RuntimeProxy; end
341
+ class RuntimeProxy < ::DatawireQuarkCore::QuarkObject
342
+ attr_accessor :impl
343
+ extend ::DatawireQuarkCore::Static
344
+
345
+ static quark_spi_api_RuntimeProxy_ref: -> { nil }
346
+
347
+
348
+
349
+ def initialize(impl)
350
+
351
+ self.__init_fields__
352
+ (self).impl = impl
353
+
354
+ nil
355
+ end
356
+
357
+
358
+
359
+
360
+ def open(url, handler)
361
+
362
+ @impl.open(url, handler)
363
+
364
+ nil
365
+ end
366
+
367
+ def request(request, handler)
368
+
369
+ @impl.request(request, handler)
370
+
371
+ nil
372
+ end
373
+
374
+ def schedule(handler, delayInSeconds)
375
+
376
+ @impl.schedule(::Quark.quark.spi_api.TaskProxy.new(self, handler), delayInSeconds)
377
+
378
+ nil
379
+ end
380
+
381
+ def codec()
382
+
383
+ return @impl.codec()
384
+
385
+ nil
386
+ end
387
+
388
+ def now()
389
+
390
+ return @impl.now()
391
+
392
+ nil
393
+ end
394
+
395
+ def sleep(seconds)
396
+
397
+ @impl.sleep(seconds)
398
+
399
+ nil
400
+ end
401
+
402
+ def uuid()
403
+
404
+ return @impl.uuid()
405
+
406
+ nil
407
+ end
408
+
409
+ def serveHTTP(url, servlet)
410
+
411
+ @impl.serveHTTP(url, ::Quark.quark.spi_api.HTTPServletProxy.new(self, servlet))
412
+
413
+ nil
414
+ end
415
+
416
+ def serveWS(url, servlet)
417
+
418
+ @impl.serveWS(url, ::Quark.quark.spi_api.WSServletProxy.new(self, servlet))
419
+
420
+ nil
421
+ end
422
+
423
+ def respond(request, response)
424
+
425
+ @impl.respond(request, response)
426
+
427
+ nil
428
+ end
429
+
430
+ def fail(message)
431
+
432
+ @impl.fail(message)
433
+
434
+ nil
435
+ end
436
+
437
+ def logger(topic)
438
+
439
+ return @impl.logger(topic)
440
+
441
+ nil
442
+ end
443
+
444
+ def callSafely(callee, defaultResult)
445
+
446
+ return @impl.callSafely(callee, defaultResult)
447
+
448
+ nil
449
+ end
450
+
451
+ def _getClass()
452
+
453
+ return "quark.spi_api.RuntimeProxy"
454
+
455
+ nil
456
+ end
457
+
458
+ def _getField(name)
459
+
460
+ if ((name) == ("impl"))
461
+ return (self).impl
462
+ end
463
+ return nil
464
+
465
+ nil
466
+ end
467
+
468
+ def _setField(name, value)
469
+
470
+ if ((name) == ("impl"))
471
+ (self).impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.Runtime }
472
+ end
473
+
474
+ nil
475
+ end
476
+
477
+ def __init_fields__()
478
+
479
+ self.impl = nil
480
+
481
+ nil
482
+ end
483
+
484
+
485
+ end
486
+ RuntimeProxy.unlazy_statics
487
+ end # module SpiApi
488
+ end # module Quark
489
+ end # module Quark