datawire_mdk 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1426 @@
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_tracing; SpiApiTracing; end
6
+ module SpiApiTracing
7
+ require "datawire-quark-core"
8
+ require_relative 'reflect' # 1 () ()
9
+ require_relative 'error' # 1 () ()
10
+ require_relative '../datawire_mdk_md' # 0 () ('quark',)
11
+ require_relative '../quark' # 0 () ('quark',)
12
+ require_relative 'concurrent' # 1 () ()
13
+
14
+
15
+ def self.quote(str)
16
+
17
+ if ((((str).index("\\") or -1)) >= (0))
18
+ str = (::DatawireQuarkCore.split(str, "\\")).join("\\\\")
19
+ end
20
+ if ((((str).index("\n") or -1)) >= (0))
21
+ str = (::DatawireQuarkCore.split(str, "\n")).join("\\n")
22
+ end
23
+ if ((((str).index("\"") or -1)) >= (0))
24
+ str = (::DatawireQuarkCore.split(str, "\"")).join("\\\"")
25
+ end
26
+ return (("\"") + (str)) + ("\"")
27
+
28
+
29
+ nil
30
+ end
31
+
32
+ def self.quote_error(error)
33
+
34
+ return (((::Quark.quark.reflect.QuarkClass.get(::DatawireQuarkCore._getClass(error)).getName()) + ("(")) + (::Quark.quark.spi_api_tracing.quote(error.getMessage()))) + (")")
35
+
36
+
37
+ nil
38
+ end
39
+
40
+ def self.Identificator; Identificator; end
41
+ class Identificator < ::DatawireQuarkCore::QuarkObject
42
+ attr_accessor :lock, :seq
43
+ extend ::DatawireQuarkCore::Static
44
+
45
+ static quark_spi_api_tracing_Identificator_ref: -> { nil }
46
+
47
+
48
+
49
+ def initialize()
50
+ self.__init_fields__
51
+
52
+ nil
53
+ end
54
+
55
+
56
+
57
+
58
+ def next_(basename)
59
+
60
+ @lock.acquire()
61
+ n = @seq
62
+ @seq = (@seq) + (1)
63
+ @lock.release()
64
+ return ((basename) + ("$")) + ((n).to_s)
65
+
66
+ nil
67
+ end
68
+
69
+ def _getClass()
70
+
71
+ return "quark.spi_api_tracing.Identificator"
72
+
73
+ nil
74
+ end
75
+
76
+ def _getField(name)
77
+
78
+ if ((name) == ("lock"))
79
+ return (self).lock
80
+ end
81
+ if ((name) == ("seq"))
82
+ return (self).seq
83
+ end
84
+ return nil
85
+
86
+ nil
87
+ end
88
+
89
+ def _setField(name, value)
90
+
91
+ if ((name) == ("lock"))
92
+ (self).lock = ::DatawireQuarkCore.cast(value) { ::DatawireQuarkCore::Lock }
93
+ end
94
+ if ((name) == ("seq"))
95
+ (self).seq = ::DatawireQuarkCore.cast(value) { ::Integer }
96
+ end
97
+
98
+ nil
99
+ end
100
+
101
+ def __init_fields__()
102
+
103
+ self.lock = ::DatawireQuarkCore::Lock.new()
104
+ self.seq = 0
105
+
106
+ nil
107
+ end
108
+
109
+
110
+ end
111
+ Identificator.unlazy_statics
112
+
113
+ def self.Identifiable; Identifiable; end
114
+ class Identifiable < ::DatawireQuarkCore::QuarkObject
115
+ attr_accessor :id, :log
116
+ extend ::DatawireQuarkCore::Static
117
+
118
+ static namer: -> { ::Quark.quark.spi_api_tracing.Identificator.new() }
119
+ static quark_spi_api_tracing_Identifiable_ref: -> { nil }
120
+
121
+
122
+
123
+ def initialize(log, basename)
124
+
125
+ self.__init_fields__
126
+ (self).id = ::Quark.quark.spi_api_tracing.Identifiable.namer.next_(basename)
127
+ (self).log = log
128
+
129
+ nil
130
+ end
131
+
132
+
133
+
134
+
135
+ def _getClass()
136
+
137
+ return "quark.spi_api_tracing.Identifiable"
138
+
139
+ nil
140
+ end
141
+
142
+ def _getField(name)
143
+
144
+ if ((name) == ("namer"))
145
+ return ::Quark.quark.spi_api_tracing.Identifiable.namer
146
+ end
147
+ if ((name) == ("id"))
148
+ return (self).id
149
+ end
150
+ if ((name) == ("log"))
151
+ return (self).log
152
+ end
153
+ return nil
154
+
155
+ nil
156
+ end
157
+
158
+ def _setField(name, value)
159
+
160
+ if ((name) == ("namer"))
161
+ ::Quark.quark.spi_api_tracing.Identifiable.namer = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi_api_tracing.Identificator }
162
+ end
163
+ if ((name) == ("id"))
164
+ (self).id = ::DatawireQuarkCore.cast(value) { ::String }
165
+ end
166
+ if ((name) == ("log"))
167
+ (self).log = value
168
+ end
169
+
170
+ nil
171
+ end
172
+
173
+ def __init_fields__()
174
+
175
+ self.id = nil
176
+ self.log = nil
177
+
178
+ nil
179
+ end
180
+
181
+
182
+ end
183
+ Identifiable.unlazy_statics
184
+
185
+ def self.ServletProxy; ServletProxy; end
186
+ class ServletProxy < ::Quark.quark.spi_api_tracing.Identifiable
187
+ attr_accessor :servlet_impl, :real_runtime
188
+ extend ::DatawireQuarkCore::Static
189
+
190
+ static quark_spi_api_tracing_ServletProxy_ref: -> { nil }
191
+
192
+
193
+
194
+ def initialize(log, basename, real_runtime, servlet_impl)
195
+
196
+ super(log, basename)
197
+ (self).real_runtime = real_runtime
198
+ (self).servlet_impl = servlet_impl
199
+
200
+ nil
201
+ end
202
+
203
+
204
+
205
+
206
+ def onServletInit(url, runtime)
207
+
208
+ (self).log.debug(((((((self).id) + (".onServletInit(")) + (::Quark.quark.spi_api_tracing.quote(url))) + (", ")) + ((@real_runtime).id)) + (")"))
209
+ @servlet_impl.onServletInit(url, @real_runtime)
210
+
211
+ nil
212
+ end
213
+
214
+ def onServletError(url, error)
215
+
216
+ (self).log.debug(((((((self).id) + (".onServletError(")) + (::Quark.quark.spi_api_tracing.quote(url))) + (", ")) + (::Quark.quark.spi_api_tracing.quote_error(error))) + (")"))
217
+ @servlet_impl.onServletError(url, error)
218
+
219
+ nil
220
+ end
221
+
222
+ def onServletEnd(url)
223
+
224
+ (self).log.debug(((((self).id) + (".onServletEnd(")) + (::Quark.quark.spi_api_tracing.quote(url))) + (")"))
225
+ @servlet_impl.onServletEnd(url)
226
+
227
+ nil
228
+ end
229
+
230
+ def _getClass()
231
+
232
+ return "quark.spi_api_tracing.ServletProxy"
233
+
234
+ nil
235
+ end
236
+
237
+ def _getField(name)
238
+
239
+ if ((name) == ("namer"))
240
+ return ::Quark.quark.spi_api_tracing.Identifiable.namer
241
+ end
242
+ if ((name) == ("id"))
243
+ return (self).id
244
+ end
245
+ if ((name) == ("log"))
246
+ return (self).log
247
+ end
248
+ if ((name) == ("servlet_impl"))
249
+ return (self).servlet_impl
250
+ end
251
+ if ((name) == ("real_runtime"))
252
+ return (self).real_runtime
253
+ end
254
+ return nil
255
+
256
+ nil
257
+ end
258
+
259
+ def _setField(name, value)
260
+
261
+ if ((name) == ("namer"))
262
+ ::Quark.quark.spi_api_tracing.Identifiable.namer = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi_api_tracing.Identificator }
263
+ end
264
+ if ((name) == ("id"))
265
+ (self).id = ::DatawireQuarkCore.cast(value) { ::String }
266
+ end
267
+ if ((name) == ("log"))
268
+ (self).log = value
269
+ end
270
+ if ((name) == ("servlet_impl"))
271
+ (self).servlet_impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.Servlet }
272
+ end
273
+ if ((name) == ("real_runtime"))
274
+ (self).real_runtime = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi_api_tracing.RuntimeProxy }
275
+ end
276
+
277
+ nil
278
+ end
279
+
280
+ def __init_fields__()
281
+
282
+ super
283
+ self.servlet_impl = nil
284
+ self.real_runtime = nil
285
+
286
+ nil
287
+ end
288
+
289
+
290
+ end
291
+ ServletProxy.unlazy_statics
292
+
293
+ def self.HTTPRequestProxy; HTTPRequestProxy; end
294
+ class HTTPRequestProxy < ::Quark.quark.spi_api_tracing.Identifiable
295
+ attr_accessor :request_impl
296
+ extend ::DatawireQuarkCore::Static
297
+
298
+ static quark_spi_api_tracing_HTTPRequestProxy_ref: -> { nil }
299
+
300
+
301
+
302
+ def initialize(log, request_impl)
303
+
304
+ super(log, "HTTPRequest")
305
+ (self).request_impl = request_impl
306
+
307
+ nil
308
+ end
309
+
310
+
311
+
312
+
313
+ def getUrl()
314
+
315
+ return @request_impl.getUrl()
316
+
317
+ nil
318
+ end
319
+
320
+ def setMethod(method)
321
+
322
+ @request_impl.setMethod(method)
323
+
324
+ nil
325
+ end
326
+
327
+ def getMethod()
328
+
329
+ return @request_impl.getMethod()
330
+
331
+ nil
332
+ end
333
+
334
+ def setBody(data)
335
+
336
+ @request_impl.setBody(data)
337
+
338
+ nil
339
+ end
340
+
341
+ def getBody()
342
+
343
+ return @request_impl.getBody()
344
+
345
+ nil
346
+ end
347
+
348
+ def setHeader(key, value)
349
+
350
+ @request_impl.setHeader(key, value)
351
+
352
+ nil
353
+ end
354
+
355
+ def getHeader(key)
356
+
357
+ return @request_impl.getHeader(key)
358
+
359
+ nil
360
+ end
361
+
362
+ def getHeaders()
363
+
364
+ return @request_impl.getHeaders()
365
+
366
+ nil
367
+ end
368
+
369
+ def _getClass()
370
+
371
+ return "quark.spi_api_tracing.HTTPRequestProxy"
372
+
373
+ nil
374
+ end
375
+
376
+ def _getField(name)
377
+
378
+ if ((name) == ("namer"))
379
+ return ::Quark.quark.spi_api_tracing.Identifiable.namer
380
+ end
381
+ if ((name) == ("id"))
382
+ return (self).id
383
+ end
384
+ if ((name) == ("log"))
385
+ return (self).log
386
+ end
387
+ if ((name) == ("request_impl"))
388
+ return (self).request_impl
389
+ end
390
+ return nil
391
+
392
+ nil
393
+ end
394
+
395
+ def _setField(name, value)
396
+
397
+ if ((name) == ("namer"))
398
+ ::Quark.quark.spi_api_tracing.Identifiable.namer = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi_api_tracing.Identificator }
399
+ end
400
+ if ((name) == ("id"))
401
+ (self).id = ::DatawireQuarkCore.cast(value) { ::String }
402
+ end
403
+ if ((name) == ("log"))
404
+ (self).log = value
405
+ end
406
+ if ((name) == ("request_impl"))
407
+ (self).request_impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.HTTPRequest }
408
+ end
409
+
410
+ nil
411
+ end
412
+
413
+ def __init_fields__()
414
+
415
+ super
416
+ self.request_impl = nil
417
+
418
+ nil
419
+ end
420
+
421
+
422
+ end
423
+ HTTPRequestProxy.unlazy_statics
424
+
425
+ def self.HTTPResponseProxy; HTTPResponseProxy; end
426
+ class HTTPResponseProxy < ::Quark.quark.spi_api_tracing.Identifiable
427
+ attr_accessor :response_impl
428
+ extend ::DatawireQuarkCore::Static
429
+
430
+ static quark_spi_api_tracing_HTTPResponseProxy_ref: -> { nil }
431
+
432
+
433
+
434
+ def initialize(log, response_impl)
435
+
436
+ super(log, "HTTPResponse")
437
+ (self).response_impl = response_impl
438
+
439
+ nil
440
+ end
441
+
442
+
443
+
444
+
445
+ def getCode()
446
+
447
+ return @response_impl.getCode()
448
+
449
+ nil
450
+ end
451
+
452
+ def setCode(code)
453
+
454
+ @response_impl.setCode(code)
455
+
456
+ nil
457
+ end
458
+
459
+ def setBody(data)
460
+
461
+ @response_impl.setBody(data)
462
+
463
+ nil
464
+ end
465
+
466
+ def getBody()
467
+
468
+ return @response_impl.getBody()
469
+
470
+ nil
471
+ end
472
+
473
+ def setHeader(key, value)
474
+
475
+ @response_impl.setHeader(key, value)
476
+
477
+ nil
478
+ end
479
+
480
+ def getHeader(key)
481
+
482
+ return @response_impl.getHeader(key)
483
+
484
+ nil
485
+ end
486
+
487
+ def getHeaders()
488
+
489
+ return @response_impl.getHeaders()
490
+
491
+ nil
492
+ end
493
+
494
+ def _getClass()
495
+
496
+ return "quark.spi_api_tracing.HTTPResponseProxy"
497
+
498
+ nil
499
+ end
500
+
501
+ def _getField(name)
502
+
503
+ if ((name) == ("namer"))
504
+ return ::Quark.quark.spi_api_tracing.Identifiable.namer
505
+ end
506
+ if ((name) == ("id"))
507
+ return (self).id
508
+ end
509
+ if ((name) == ("log"))
510
+ return (self).log
511
+ end
512
+ if ((name) == ("response_impl"))
513
+ return (self).response_impl
514
+ end
515
+ return nil
516
+
517
+ nil
518
+ end
519
+
520
+ def _setField(name, value)
521
+
522
+ if ((name) == ("namer"))
523
+ ::Quark.quark.spi_api_tracing.Identifiable.namer = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi_api_tracing.Identificator }
524
+ end
525
+ if ((name) == ("id"))
526
+ (self).id = ::DatawireQuarkCore.cast(value) { ::String }
527
+ end
528
+ if ((name) == ("log"))
529
+ (self).log = value
530
+ end
531
+ if ((name) == ("response_impl"))
532
+ (self).response_impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.HTTPResponse }
533
+ end
534
+
535
+ nil
536
+ end
537
+
538
+ def __init_fields__()
539
+
540
+ super
541
+ self.response_impl = nil
542
+
543
+ nil
544
+ end
545
+
546
+
547
+ end
548
+ HTTPResponseProxy.unlazy_statics
549
+
550
+ def self.HTTPServletProxy; HTTPServletProxy; end
551
+ class HTTPServletProxy < ::Quark.quark.spi_api_tracing.ServletProxy
552
+ attr_accessor :http_servlet_impl
553
+ extend ::DatawireQuarkCore::Static
554
+
555
+ static quark_spi_api_tracing_HTTPServletProxy_ref: -> { nil }
556
+
557
+
558
+
559
+ def initialize(log, real_runtime, http_servlet_impl)
560
+
561
+ super(log, "HTTPServlet", real_runtime, http_servlet_impl)
562
+ (self).http_servlet_impl = http_servlet_impl
563
+
564
+ nil
565
+ end
566
+
567
+
568
+
569
+
570
+ def onHTTPRequest(request, response)
571
+
572
+ wrapped_request = ::Quark.quark.spi_api_tracing.HTTPRequestProxy.new((self).log, request)
573
+ wrapped_response = ::Quark.quark.spi_api_tracing.HTTPResponseProxy.new((self).log, response)
574
+ (self).log.debug(((((((((((self).id) + (".onHTTPRequest(")) + ((wrapped_request).id)) + (" ")) + (request.getMethod())) + (" ")) + (::Quark.quark.spi_api_tracing.quote(request.getUrl()))) + (", ")) + ((wrapped_response).id)) + (")"))
575
+ @http_servlet_impl.onHTTPRequest(wrapped_request, wrapped_response)
576
+
577
+ nil
578
+ end
579
+
580
+ def _getClass()
581
+
582
+ return "quark.spi_api_tracing.HTTPServletProxy"
583
+
584
+ nil
585
+ end
586
+
587
+ def _getField(name)
588
+
589
+ if ((name) == ("namer"))
590
+ return ::Quark.quark.spi_api_tracing.Identifiable.namer
591
+ end
592
+ if ((name) == ("id"))
593
+ return (self).id
594
+ end
595
+ if ((name) == ("log"))
596
+ return (self).log
597
+ end
598
+ if ((name) == ("servlet_impl"))
599
+ return (self).servlet_impl
600
+ end
601
+ if ((name) == ("real_runtime"))
602
+ return (self).real_runtime
603
+ end
604
+ if ((name) == ("http_servlet_impl"))
605
+ return (self).http_servlet_impl
606
+ end
607
+ return nil
608
+
609
+ nil
610
+ end
611
+
612
+ def _setField(name, value)
613
+
614
+ if ((name) == ("namer"))
615
+ ::Quark.quark.spi_api_tracing.Identifiable.namer = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi_api_tracing.Identificator }
616
+ end
617
+ if ((name) == ("id"))
618
+ (self).id = ::DatawireQuarkCore.cast(value) { ::String }
619
+ end
620
+ if ((name) == ("log"))
621
+ (self).log = value
622
+ end
623
+ if ((name) == ("servlet_impl"))
624
+ (self).servlet_impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.Servlet }
625
+ end
626
+ if ((name) == ("real_runtime"))
627
+ (self).real_runtime = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi_api_tracing.RuntimeProxy }
628
+ end
629
+ if ((name) == ("http_servlet_impl"))
630
+ (self).http_servlet_impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.HTTPServlet }
631
+ end
632
+
633
+ nil
634
+ end
635
+
636
+ def serveHTTP(url)
637
+
638
+ ::Quark.quark.concurrent.Context.runtime().serveHTTP(url, self)
639
+
640
+ nil
641
+ end
642
+
643
+ def __init_fields__()
644
+
645
+ super
646
+ self.http_servlet_impl = nil
647
+
648
+ nil
649
+ end
650
+
651
+
652
+ end
653
+ HTTPServletProxy.unlazy_statics
654
+
655
+ def self.WSServletProxy; WSServletProxy; end
656
+ class WSServletProxy < ::Quark.quark.spi_api_tracing.ServletProxy
657
+ attr_accessor :ws_servlet_impl
658
+ extend ::DatawireQuarkCore::Static
659
+
660
+ static quark_spi_api_tracing_WSServletProxy_ref: -> { nil }
661
+
662
+
663
+
664
+ def initialize(log, real_runtime, ws_servlet_impl)
665
+
666
+ super(log, "WSServlet", real_runtime, ws_servlet_impl)
667
+ (self).ws_servlet_impl = ws_servlet_impl
668
+
669
+ nil
670
+ end
671
+
672
+
673
+
674
+
675
+ def onWSConnect(request)
676
+
677
+ wrapped_request = ::Quark.quark.spi_api_tracing.HTTPRequestProxy.new((self).log, request)
678
+ (self).log.debug(((((((((self).id) + (".onWSConnect(")) + ((wrapped_request).id)) + (" ")) + (request.getMethod())) + (" ")) + (::Quark.quark.spi_api_tracing.quote(request.getUrl()))) + (")..."))
679
+ handler = @ws_servlet_impl.onWSConnect(wrapped_request)
680
+ if ((handler) == (nil))
681
+ (self).log.debug(((((((self).id) + (".onWSConnect(")) + ((wrapped_request).id)) + (")")) + (" -> ")) + ("null"))
682
+ return handler
683
+ else
684
+ wrapped_handler = ::Quark.quark.spi_api_tracing.WSHandlerProxy.new((self).log, handler)
685
+ (self).log.debug(((((((self).id) + (".onWSConnect(")) + ((wrapped_request).id)) + (")")) + (" -> ")) + ((wrapped_handler).id))
686
+ return wrapped_handler
687
+ end
688
+
689
+ nil
690
+ end
691
+
692
+ def _getClass()
693
+
694
+ return "quark.spi_api_tracing.WSServletProxy"
695
+
696
+ nil
697
+ end
698
+
699
+ def _getField(name)
700
+
701
+ if ((name) == ("namer"))
702
+ return ::Quark.quark.spi_api_tracing.Identifiable.namer
703
+ end
704
+ if ((name) == ("id"))
705
+ return (self).id
706
+ end
707
+ if ((name) == ("log"))
708
+ return (self).log
709
+ end
710
+ if ((name) == ("servlet_impl"))
711
+ return (self).servlet_impl
712
+ end
713
+ if ((name) == ("real_runtime"))
714
+ return (self).real_runtime
715
+ end
716
+ if ((name) == ("ws_servlet_impl"))
717
+ return (self).ws_servlet_impl
718
+ end
719
+ return nil
720
+
721
+ nil
722
+ end
723
+
724
+ def _setField(name, value)
725
+
726
+ if ((name) == ("namer"))
727
+ ::Quark.quark.spi_api_tracing.Identifiable.namer = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi_api_tracing.Identificator }
728
+ end
729
+ if ((name) == ("id"))
730
+ (self).id = ::DatawireQuarkCore.cast(value) { ::String }
731
+ end
732
+ if ((name) == ("log"))
733
+ (self).log = value
734
+ end
735
+ if ((name) == ("servlet_impl"))
736
+ (self).servlet_impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.Servlet }
737
+ end
738
+ if ((name) == ("real_runtime"))
739
+ (self).real_runtime = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi_api_tracing.RuntimeProxy }
740
+ end
741
+ if ((name) == ("ws_servlet_impl"))
742
+ (self).ws_servlet_impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.WSServlet }
743
+ end
744
+
745
+ nil
746
+ end
747
+
748
+ def serveWS(url)
749
+
750
+ ::Quark.quark.concurrent.Context.runtime().serveWS(url, self)
751
+
752
+ nil
753
+ end
754
+
755
+ def __init_fields__()
756
+
757
+ super
758
+ self.ws_servlet_impl = nil
759
+
760
+ nil
761
+ end
762
+
763
+
764
+ end
765
+ WSServletProxy.unlazy_statics
766
+
767
+ def self.TaskProxy; TaskProxy; end
768
+ class TaskProxy < ::Quark.quark.spi_api_tracing.Identifiable
769
+ attr_accessor :task_impl, :real_runtime
770
+ extend ::DatawireQuarkCore::Static
771
+
772
+ static quark_spi_api_tracing_TaskProxy_ref: -> { nil }
773
+
774
+
775
+
776
+ def initialize(log, real_runtime, task_impl)
777
+
778
+ super(log, "Task")
779
+ (self).task_impl = task_impl
780
+ (self).real_runtime = real_runtime
781
+
782
+ nil
783
+ end
784
+
785
+
786
+
787
+
788
+ def onExecute(runtime)
789
+
790
+ (self).log.debug(((((self).id) + (".onExecute(")) + ((@real_runtime).id)) + (")"))
791
+ @task_impl.onExecute(@real_runtime)
792
+
793
+ nil
794
+ end
795
+
796
+ def _getClass()
797
+
798
+ return "quark.spi_api_tracing.TaskProxy"
799
+
800
+ nil
801
+ end
802
+
803
+ def _getField(name)
804
+
805
+ if ((name) == ("namer"))
806
+ return ::Quark.quark.spi_api_tracing.Identifiable.namer
807
+ end
808
+ if ((name) == ("id"))
809
+ return (self).id
810
+ end
811
+ if ((name) == ("log"))
812
+ return (self).log
813
+ end
814
+ if ((name) == ("task_impl"))
815
+ return (self).task_impl
816
+ end
817
+ if ((name) == ("real_runtime"))
818
+ return (self).real_runtime
819
+ end
820
+ return nil
821
+
822
+ nil
823
+ end
824
+
825
+ def _setField(name, value)
826
+
827
+ if ((name) == ("namer"))
828
+ ::Quark.quark.spi_api_tracing.Identifiable.namer = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi_api_tracing.Identificator }
829
+ end
830
+ if ((name) == ("id"))
831
+ (self).id = ::DatawireQuarkCore.cast(value) { ::String }
832
+ end
833
+ if ((name) == ("log"))
834
+ (self).log = value
835
+ end
836
+ if ((name) == ("task_impl"))
837
+ (self).task_impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.Task }
838
+ end
839
+ if ((name) == ("real_runtime"))
840
+ (self).real_runtime = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi_api_tracing.RuntimeProxy }
841
+ end
842
+
843
+ nil
844
+ end
845
+
846
+ def __init_fields__()
847
+
848
+ super
849
+ self.task_impl = nil
850
+ self.real_runtime = nil
851
+
852
+ nil
853
+ end
854
+
855
+
856
+ end
857
+ TaskProxy.unlazy_statics
858
+
859
+ def self.WebSocketProxy; WebSocketProxy; end
860
+ class WebSocketProxy < ::Quark.quark.spi_api_tracing.Identifiable
861
+ attr_accessor :socket_impl
862
+ extend ::DatawireQuarkCore::Static
863
+
864
+ static quark_spi_api_tracing_WebSocketProxy_ref: -> { nil }
865
+
866
+
867
+
868
+ def initialize(log, socket_impl)
869
+
870
+ super(log, "WebSocket")
871
+ (self).socket_impl = socket_impl
872
+
873
+ nil
874
+ end
875
+
876
+
877
+
878
+
879
+ def send(message)
880
+
881
+ (self).log.debug(((((self).id) + (".send(")) + (::Quark.quark.spi_api_tracing.quote(message))) + (")..."))
882
+ ret = @socket_impl.send(message)
883
+ (self).log.debug((((((self).id) + (".send(")) + (")")) + (" -> ")) + ((ret).to_s))
884
+ return ret
885
+
886
+ nil
887
+ end
888
+
889
+ def sendBinary(message)
890
+
891
+ (self).log.debug(((((self).id) + (".sendBinary(")) + (::Quark.quark.concurrent.Context.runtime().codec().toHexdump(message, 0, message.capacity(), 4))) + (")..."))
892
+ ret = @socket_impl.sendBinary(message)
893
+ (self).log.debug((((((self).id) + (".sendBinary(")) + (")")) + (" -> ")) + ((ret).to_s))
894
+ return ret
895
+
896
+ nil
897
+ end
898
+
899
+ def close()
900
+
901
+ (self).log.debug((((self).id) + (".close(")) + (")..."))
902
+ ret = @socket_impl.close()
903
+ (self).log.debug((((((self).id) + (".close(")) + (")")) + (" -> ")) + ((ret).to_s))
904
+ return ret
905
+
906
+ nil
907
+ end
908
+
909
+ def _getClass()
910
+
911
+ return "quark.spi_api_tracing.WebSocketProxy"
912
+
913
+ nil
914
+ end
915
+
916
+ def _getField(name)
917
+
918
+ if ((name) == ("namer"))
919
+ return ::Quark.quark.spi_api_tracing.Identifiable.namer
920
+ end
921
+ if ((name) == ("id"))
922
+ return (self).id
923
+ end
924
+ if ((name) == ("log"))
925
+ return (self).log
926
+ end
927
+ if ((name) == ("socket_impl"))
928
+ return (self).socket_impl
929
+ end
930
+ return nil
931
+
932
+ nil
933
+ end
934
+
935
+ def _setField(name, value)
936
+
937
+ if ((name) == ("namer"))
938
+ ::Quark.quark.spi_api_tracing.Identifiable.namer = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi_api_tracing.Identificator }
939
+ end
940
+ if ((name) == ("id"))
941
+ (self).id = ::DatawireQuarkCore.cast(value) { ::String }
942
+ end
943
+ if ((name) == ("log"))
944
+ (self).log = value
945
+ end
946
+ if ((name) == ("socket_impl"))
947
+ (self).socket_impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.WebSocket }
948
+ end
949
+
950
+ nil
951
+ end
952
+
953
+ def __init_fields__()
954
+
955
+ super
956
+ self.socket_impl = nil
957
+
958
+ nil
959
+ end
960
+
961
+
962
+ end
963
+ WebSocketProxy.unlazy_statics
964
+
965
+ def self.WSHandlerProxy; WSHandlerProxy; end
966
+ class WSHandlerProxy < ::Quark.quark.spi_api_tracing.Identifiable
967
+ attr_accessor :handler_impl, :_wrapped_socket
968
+ extend ::DatawireQuarkCore::Static
969
+
970
+ static quark_spi_api_tracing_WSHandlerProxy_ref: -> { nil }
971
+
972
+
973
+
974
+ def initialize(log, handler_impl)
975
+
976
+ super(log, "WSHandler")
977
+ (self).handler_impl = handler_impl
978
+ (self)._wrapped_socket = ::DatawireQuarkCore.cast(nil) { ::Quark.quark.spi_api_tracing.WebSocketProxy }
979
+
980
+ nil
981
+ end
982
+
983
+
984
+
985
+
986
+ def _wrap_socket(socket)
987
+
988
+ if ((@_wrapped_socket) == (nil))
989
+ @_wrapped_socket = ::Quark.quark.spi_api_tracing.WebSocketProxy.new((self).log, socket)
990
+ end
991
+ return @_wrapped_socket
992
+
993
+ nil
994
+ end
995
+
996
+ def onWSInit(socket)
997
+
998
+ wrapped_socket = self._wrap_socket(socket)
999
+ (self).log.debug(((((self).id) + (".onWSInit(")) + ((wrapped_socket).id)) + (")"))
1000
+ @handler_impl.onWSInit(wrapped_socket)
1001
+
1002
+ nil
1003
+ end
1004
+
1005
+ def onWSConnected(socket)
1006
+
1007
+ wrapped_socket = self._wrap_socket(socket)
1008
+ (self).log.debug(((((self).id) + (".onWSConnected(")) + ((wrapped_socket).id)) + (")"))
1009
+ @handler_impl.onWSConnected(wrapped_socket)
1010
+
1011
+ nil
1012
+ end
1013
+
1014
+ def onWSMessage(socket, message)
1015
+
1016
+ wrapped_socket = self._wrap_socket(socket)
1017
+ (self).log.debug(((((((self).id) + (".onWSMessage(")) + ((wrapped_socket).id)) + (", ")) + (::Quark.quark.spi_api_tracing.quote(message))) + (")"))
1018
+ @handler_impl.onWSMessage(wrapped_socket, message)
1019
+
1020
+ nil
1021
+ end
1022
+
1023
+ def onWSBinary(socket, message)
1024
+
1025
+ wrapped_socket = self._wrap_socket(socket)
1026
+ (self).log.debug(((((((self).id) + (".onWSBinary(")) + ((wrapped_socket).id)) + (", ")) + (::Quark.quark.concurrent.Context.runtime().codec().toHexdump(message, 0, message.capacity(), 4))) + (")"))
1027
+ @handler_impl.onWSBinary(wrapped_socket, message)
1028
+
1029
+ nil
1030
+ end
1031
+
1032
+ def onWSClosed(socket)
1033
+
1034
+ wrapped_socket = self._wrap_socket(socket)
1035
+ (self).log.debug(((((self).id) + (".onWSClosed(")) + ((wrapped_socket).id)) + (")"))
1036
+ @handler_impl.onWSClosed(wrapped_socket)
1037
+
1038
+ nil
1039
+ end
1040
+
1041
+ def onWSError(socket, error)
1042
+
1043
+ wrapped_socket = self._wrap_socket(socket)
1044
+ (self).log.debug(((((((self).id) + (".onWSError(")) + ((wrapped_socket).id)) + (", ")) + (::Quark.quark.spi_api_tracing.quote_error(error))) + (")"))
1045
+ @handler_impl.onWSError(wrapped_socket, error)
1046
+
1047
+ nil
1048
+ end
1049
+
1050
+ def onWSFinal(socket)
1051
+
1052
+ wrapped_socket = self._wrap_socket(socket)
1053
+ (self).log.debug(((((self).id) + (".onWSFinal(")) + ((wrapped_socket).id)) + (")"))
1054
+ @handler_impl.onWSFinal(wrapped_socket)
1055
+
1056
+ nil
1057
+ end
1058
+
1059
+ def _getClass()
1060
+
1061
+ return "quark.spi_api_tracing.WSHandlerProxy"
1062
+
1063
+ nil
1064
+ end
1065
+
1066
+ def _getField(name)
1067
+
1068
+ if ((name) == ("namer"))
1069
+ return ::Quark.quark.spi_api_tracing.Identifiable.namer
1070
+ end
1071
+ if ((name) == ("id"))
1072
+ return (self).id
1073
+ end
1074
+ if ((name) == ("log"))
1075
+ return (self).log
1076
+ end
1077
+ if ((name) == ("handler_impl"))
1078
+ return (self).handler_impl
1079
+ end
1080
+ if ((name) == ("_wrapped_socket"))
1081
+ return (self)._wrapped_socket
1082
+ end
1083
+ return nil
1084
+
1085
+ nil
1086
+ end
1087
+
1088
+ def _setField(name, value)
1089
+
1090
+ if ((name) == ("namer"))
1091
+ ::Quark.quark.spi_api_tracing.Identifiable.namer = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi_api_tracing.Identificator }
1092
+ end
1093
+ if ((name) == ("id"))
1094
+ (self).id = ::DatawireQuarkCore.cast(value) { ::String }
1095
+ end
1096
+ if ((name) == ("log"))
1097
+ (self).log = value
1098
+ end
1099
+ if ((name) == ("handler_impl"))
1100
+ (self).handler_impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.WSHandler }
1101
+ end
1102
+ if ((name) == ("_wrapped_socket"))
1103
+ (self)._wrapped_socket = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi_api_tracing.WebSocketProxy }
1104
+ end
1105
+
1106
+ nil
1107
+ end
1108
+
1109
+ def __init_fields__()
1110
+
1111
+ super
1112
+ self.handler_impl = nil
1113
+ self._wrapped_socket = nil
1114
+
1115
+ nil
1116
+ end
1117
+
1118
+
1119
+ end
1120
+ WSHandlerProxy.unlazy_statics
1121
+
1122
+ def self.HTTPHandlerProxy; HTTPHandlerProxy; end
1123
+ class HTTPHandlerProxy < ::Quark.quark.spi_api_tracing.Identifiable
1124
+ attr_accessor :handler_impl, :wrapped_request
1125
+ extend ::DatawireQuarkCore::Static
1126
+
1127
+ static quark_spi_api_tracing_HTTPHandlerProxy_ref: -> { nil }
1128
+
1129
+
1130
+
1131
+ def initialize(log, wrapped_request, handler_impl)
1132
+
1133
+ super(log, "HTTPHandler")
1134
+ (self).wrapped_request = wrapped_request
1135
+ (self).handler_impl = handler_impl
1136
+
1137
+ nil
1138
+ end
1139
+
1140
+
1141
+
1142
+
1143
+ def onHTTPInit(request)
1144
+
1145
+ (self).log.debug(((((self).id) + (".onHTTPInit(")) + ((@wrapped_request).id)) + (")"))
1146
+ (self).handler_impl.onHTTPInit(request)
1147
+
1148
+ nil
1149
+ end
1150
+
1151
+ def onHTTPResponse(request, response)
1152
+
1153
+ (self).log.debug(((((((((self).id) + (".onHTTPResponse(")) + ((@wrapped_request).id)) + (", ")) + ((response.getCode()).to_s)) + (" ")) + (::Quark.quark.spi_api_tracing.quote(response.getBody()))) + (")"))
1154
+ (self).handler_impl.onHTTPResponse(request, response)
1155
+
1156
+ nil
1157
+ end
1158
+
1159
+ def onHTTPError(request, error)
1160
+
1161
+ (self).log.debug(((((((self).id) + (".onHTTPError(")) + ((@wrapped_request).id)) + (", ")) + (::Quark.quark.spi_api_tracing.quote_error(error))) + (")"))
1162
+ (self).handler_impl.onHTTPError(request, error)
1163
+
1164
+ nil
1165
+ end
1166
+
1167
+ def onHTTPFinal(request)
1168
+
1169
+ (self).log.debug(((((self).id) + (".onHTTPFinal(")) + ((@wrapped_request).id)) + (")"))
1170
+ (self).handler_impl.onHTTPFinal(request)
1171
+
1172
+ nil
1173
+ end
1174
+
1175
+ def _getClass()
1176
+
1177
+ return "quark.spi_api_tracing.HTTPHandlerProxy"
1178
+
1179
+ nil
1180
+ end
1181
+
1182
+ def _getField(name)
1183
+
1184
+ if ((name) == ("namer"))
1185
+ return ::Quark.quark.spi_api_tracing.Identifiable.namer
1186
+ end
1187
+ if ((name) == ("id"))
1188
+ return (self).id
1189
+ end
1190
+ if ((name) == ("log"))
1191
+ return (self).log
1192
+ end
1193
+ if ((name) == ("handler_impl"))
1194
+ return (self).handler_impl
1195
+ end
1196
+ if ((name) == ("wrapped_request"))
1197
+ return (self).wrapped_request
1198
+ end
1199
+ return nil
1200
+
1201
+ nil
1202
+ end
1203
+
1204
+ def _setField(name, value)
1205
+
1206
+ if ((name) == ("namer"))
1207
+ ::Quark.quark.spi_api_tracing.Identifiable.namer = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi_api_tracing.Identificator }
1208
+ end
1209
+ if ((name) == ("id"))
1210
+ (self).id = ::DatawireQuarkCore.cast(value) { ::String }
1211
+ end
1212
+ if ((name) == ("log"))
1213
+ (self).log = value
1214
+ end
1215
+ if ((name) == ("handler_impl"))
1216
+ (self).handler_impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.HTTPHandler }
1217
+ end
1218
+ if ((name) == ("wrapped_request"))
1219
+ (self).wrapped_request = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi_api_tracing.HTTPRequestProxy }
1220
+ end
1221
+
1222
+ nil
1223
+ end
1224
+
1225
+ def __init_fields__()
1226
+
1227
+ super
1228
+ self.handler_impl = nil
1229
+ self.wrapped_request = nil
1230
+
1231
+ nil
1232
+ end
1233
+
1234
+
1235
+ end
1236
+ HTTPHandlerProxy.unlazy_statics
1237
+
1238
+ def self.RuntimeProxy; RuntimeProxy; end
1239
+ class RuntimeProxy < ::Quark.quark.spi_api_tracing.Identifiable
1240
+ attr_accessor :impl
1241
+ extend ::DatawireQuarkCore::Static
1242
+
1243
+ static quark_spi_api_tracing_RuntimeProxy_ref: -> { nil }
1244
+
1245
+
1246
+
1247
+ def initialize(impl)
1248
+
1249
+ super(impl.logger("api"), "Runtime")
1250
+ (self).impl = impl
1251
+
1252
+ nil
1253
+ end
1254
+
1255
+
1256
+
1257
+
1258
+ def open(url, handler)
1259
+
1260
+ wrapped_handler = ::Quark.quark.spi_api_tracing.WSHandlerProxy.new((self).log, handler)
1261
+ (self).log.debug(((((((self).id) + (".open(")) + (::Quark.quark.spi_api_tracing.quote(url))) + (", ")) + ((wrapped_handler).id)) + (")"))
1262
+ @impl.open(url, wrapped_handler)
1263
+
1264
+ nil
1265
+ end
1266
+
1267
+ def request(request, handler)
1268
+
1269
+ wrapped_request = ::Quark.quark.spi_api_tracing.HTTPRequestProxy.new((self).log, request)
1270
+ wrapped_handler = ::Quark.quark.spi_api_tracing.HTTPHandlerProxy.new((self).log, wrapped_request, handler)
1271
+ (self).log.debug(((((((((((self).id) + (".request(")) + ((wrapped_request).id)) + (" ")) + (request.getMethod())) + (" ")) + (::Quark.quark.spi_api_tracing.quote(request.getUrl()))) + (", ")) + ((wrapped_handler).id)) + (")"))
1272
+ @impl.request(request, wrapped_handler)
1273
+
1274
+ nil
1275
+ end
1276
+
1277
+ def schedule(handler, delayInSeconds)
1278
+
1279
+ wrapped_handler = ::Quark.quark.spi_api_tracing.TaskProxy.new((self).log, self, handler)
1280
+ (self).log.debug(((((((self).id) + (".schedule(")) + ((wrapped_handler).id)) + (", ")) + ((delayInSeconds).to_s)) + (")"))
1281
+ @impl.schedule(wrapped_handler, delayInSeconds)
1282
+
1283
+ nil
1284
+ end
1285
+
1286
+ def codec()
1287
+
1288
+ (self).log.debug(((self).id) + (".codec()"))
1289
+ return @impl.codec()
1290
+
1291
+ nil
1292
+ end
1293
+
1294
+ def now()
1295
+
1296
+ (self).log.debug(((self).id) + (".now()"))
1297
+ return @impl.now()
1298
+
1299
+ nil
1300
+ end
1301
+
1302
+ def sleep(seconds)
1303
+
1304
+ (self).log.debug(((((self).id) + (".sleep(")) + ((seconds).to_s)) + (")"))
1305
+ @impl.sleep(seconds)
1306
+
1307
+ nil
1308
+ end
1309
+
1310
+ def uuid()
1311
+
1312
+ (self).log.debug(((self).id) + (".uuid()"))
1313
+ return @impl.uuid()
1314
+
1315
+ nil
1316
+ end
1317
+
1318
+ def callSafely(callee, defaultResult)
1319
+
1320
+ (self).log.debug(((((((self).id) + (".callSafely(")) + ((callee).to_s)) + (", ")) + ((defaultResult).to_s)) + (")"))
1321
+ return @impl.callSafely(callee, defaultResult)
1322
+
1323
+ nil
1324
+ end
1325
+
1326
+ def serveHTTP(url, servlet)
1327
+
1328
+ wrapped_servlet = ::Quark.quark.spi_api_tracing.HTTPServletProxy.new((self).log, self, servlet)
1329
+ (self).log.debug(((((((self).id) + (".serveHTTP(")) + (::Quark.quark.spi_api_tracing.quote(url))) + (", ")) + ((wrapped_servlet).id)) + (")"))
1330
+ @impl.serveHTTP(url, wrapped_servlet)
1331
+
1332
+ nil
1333
+ end
1334
+
1335
+ def serveWS(url, servlet)
1336
+
1337
+ wrapped_servlet = ::Quark.quark.spi_api_tracing.WSServletProxy.new((self).log, self, servlet)
1338
+ (self).log.debug(((((((self).id) + (".serveWS(")) + (::Quark.quark.spi_api_tracing.quote(url))) + (", ")) + ((wrapped_servlet).id)) + (")"))
1339
+ @impl.serveWS(url, wrapped_servlet)
1340
+
1341
+ nil
1342
+ end
1343
+
1344
+ def respond(request, response)
1345
+
1346
+ wrapped_request = ::DatawireQuarkCore.cast(request) { ::Quark.quark.spi_api_tracing.HTTPRequestProxy }
1347
+ wrapped_response = ::DatawireQuarkCore.cast(response) { ::Quark.quark.spi_api_tracing.HTTPResponseProxy }
1348
+ (self).log.debug(((((((((((self).id) + (".respond(")) + ((wrapped_request).id)) + (", ")) + ((wrapped_response).id)) + (" ")) + ((wrapped_response.getCode()).to_s)) + (" ")) + (wrapped_response.getBody())) + (")"))
1349
+ @impl.respond((wrapped_request).request_impl, (wrapped_response).response_impl)
1350
+
1351
+ nil
1352
+ end
1353
+
1354
+ def fail(message)
1355
+
1356
+ (self).log.info(((((self).id) + (".fail(")) + (::Quark.quark.spi_api_tracing.quote(message))) + (")"))
1357
+ @impl.fail(message)
1358
+
1359
+ nil
1360
+ end
1361
+
1362
+ def logger(topic)
1363
+
1364
+ return @impl.logger(topic)
1365
+
1366
+ nil
1367
+ end
1368
+
1369
+ def _getClass()
1370
+
1371
+ return "quark.spi_api_tracing.RuntimeProxy"
1372
+
1373
+ nil
1374
+ end
1375
+
1376
+ def _getField(name)
1377
+
1378
+ if ((name) == ("namer"))
1379
+ return ::Quark.quark.spi_api_tracing.Identifiable.namer
1380
+ end
1381
+ if ((name) == ("id"))
1382
+ return (self).id
1383
+ end
1384
+ if ((name) == ("log"))
1385
+ return (self).log
1386
+ end
1387
+ if ((name) == ("impl"))
1388
+ return (self).impl
1389
+ end
1390
+ return nil
1391
+
1392
+ nil
1393
+ end
1394
+
1395
+ def _setField(name, value)
1396
+
1397
+ if ((name) == ("namer"))
1398
+ ::Quark.quark.spi_api_tracing.Identifiable.namer = ::DatawireQuarkCore.cast(value) { ::Quark.quark.spi_api_tracing.Identificator }
1399
+ end
1400
+ if ((name) == ("id"))
1401
+ (self).id = ::DatawireQuarkCore.cast(value) { ::String }
1402
+ end
1403
+ if ((name) == ("log"))
1404
+ (self).log = value
1405
+ end
1406
+ if ((name) == ("impl"))
1407
+ (self).impl = ::DatawireQuarkCore.cast(value) { ::Quark.quark.Runtime }
1408
+ end
1409
+
1410
+ nil
1411
+ end
1412
+
1413
+ def __init_fields__()
1414
+
1415
+ super
1416
+ self.impl = nil
1417
+
1418
+ nil
1419
+ end
1420
+
1421
+
1422
+ end
1423
+ RuntimeProxy.unlazy_statics
1424
+ end # module SpiApiTracing
1425
+ end # module Quark
1426
+ end # module Quark