-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcpd.html
913 lines (817 loc) · 30.5 KB
/
cpd.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
<!DOCTYPE html>
<!--
Generated by Apache Maven Doxia at 2019-02-12
Rendered using Reflow Maven Skin 1.1.1 (http://andriusvelykis.github.io/reflow-maven-skin)
-->
<html xml:lang="en" lang="en">
<head>
<meta charset="UTF-8" />
<title>CPD Results | TeeTime</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<meta http-equiv="content-language" content="en" />
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://teetime-framework.github.io/css/docs.css" rel="stylesheet" />
<link href="https://teetime-framework.github.io/css/reflow-skin.css" rel="stylesheet" />
<link href="https://teetime-framework.github.io/css/lightbox.css" rel="stylesheet" />
<link href="https://teetime-framework.github.io/css/site.css" rel="stylesheet" />
<link href="https://teetime-framework.github.io/css/print.css" rel="stylesheet" media="print" />
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script type="text/javascript">window.twttr = (function(d, s, id) {
var js, fjs =
d.getElementsByTagName(s)[0],
t = window.twttr || {};
if
(d.getElementById(id)) return t;
js =
d.createElement(s);
js.id = id;
js.src =
"https://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);
t._e = [];
t.ready = function(f)
{
t._e.push(f);
};
return t;
}(document, "script", "twitter-wjs"));</script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.0.0/styles/xcode.min.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.0.0/highlight.min.js"></script>
<link sizes="57x57" rel="apple-touch-icon" href="https://teetime-framework.github.io/apple-touch-icon-57x57.png"/>
<link sizes="114x114" rel="apple-touch-icon" href="/apple-touch-icon-114x114.png"/>
<link sizes="72x72" rel="apple-touch-icon" href="https://teetime-framework.github.io/apple-touch-icon-72x72.png"/>
<link sizes="144x144" rel="apple-touch-icon" href="/apple-touch-icon-144x144.png"/>
<link sizes="60x60" rel="apple-touch-icon" href="https://teetime-framework.github.io/apple-touch-icon-60x60.png"/>
<link sizes="120x120" rel="apple-touch-icon" href="/apple-touch-icon-120x120.png"/>
<link sizes="76x76" rel="apple-touch-icon" href="https://teetime-framework.github.io/apple-touch-icon-76x76.png"/>
<link sizes="152x152" rel="apple-touch-icon" href="https://teetime-framework.github.io/apple-touch-icon-152x152.png"/>
<link sizes="180x180" rel="apple-touch-icon" href="https://teetime-framework.github.io/apple-touch-icon-180x180.png"/>
<meta name="apple-mobile-web-app-title" content="TeeTime"/>
<link sizes="192x192" rel="icon" href="https://teetime-framework.github.io/favicon-192x192.png" type="image/png"/>
<link sizes="160x160" rel="icon" href="https://teetime-framework.github.io/favicon-160x160.png" type="image/png"/>
<link sizes="96x96" rel="icon" href="https://teetime-framework.github.io/favicon-96x96.png" type="image/png"/>
<link sizes="16x16" rel="icon" href="https://teetime-framework.github.io/favicon-16x16.png" type="image/png"/>
<link sizes="32x32" rel="icon" href="https://teetime-framework.github.io/favicon-32x32.png" type="image/png"/>
<meta name="msapplication-TileColor" content="#2b5797"/>
<meta name="msapplication-TileImage" content="https://teetime-framework.github.io/mstile-144x144.png"/>
<meta name="application-name" content="TeeTime"/>
</head>
<body class="page-cpd project-teetime" data-spy="scroll" data-offset="60" data-target="#toc-scroll-target">
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target="#top-nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="https://teetime-framework.github.io/">TeeTime</a>
<div class="nav-collapse collapse" id="top-nav-collapse">
<ul class="nav pull-right">
<li ><a href="download.html" title="Download">Download</a></li>
<li ><a href="wiki/home.html" title="Wiki">Wiki</a></li>
<li ><a href="https://eprints.uni-kiel.de/cgi/search/archive/advanced?_action_search=1&dataset=archive&exp=0%7C1%7C-date%2Fcreators_name%2Ftitle%7Carchive%7C-%7Cprojects%3Aprojects%3AALL%3AIN%3ATeeTime" title="Publications" class="externalLink">Publications</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation <b class="caret"></b></a>
<ul class="dropdown-menu">
<li ><a href="stabledocs/index.html" title="JavaDoc">JavaDoc</a></li>
<li ><a href="changes-report.html" title="Release Notes">Release Notes</a></li>
<li ><a href="dependencies.html" title="Project Dependencies">Project Dependencies</a></li>
<li ><a href="license.html" title="License">License</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Get Involved <b class="caret"></b></a>
<ul class="dropdown-menu">
<li ><a href="contribute.html" title="Contribute">Contribute</a></li>
<li ><a href="https://github.com/teetime-framework/teetime" title="Visit us on GitHub" class="externalLink">Visit us on GitHub</a></li>
<li ><a href="https://build.se.informatik.uni-kiel.de/gitlab/teetime/teetime/issues" title="Issue Tracking" class="externalLink">Issue Tracking</a></li>
<li ><a href="team-list.html" title="Team">Team</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container">
<!-- Masthead
================================================== -->
<header>
<div class="jumbotron subhead">
<div class="row" id="banner">
<div class="span12">
<div class="pull-left">
<a href="https://teetime-framework.github.io/" id="bannerLeft"><h1><img src="//teetime-framework.github.io/images/teetime-path.svg" id="logo"></h1></a>
<p class="lead"><span class="slogan">The Next-Generation Pipe-and-Filter Framework</span></p>
</div>
<div class="pull-right">
</div>
</div>
</div>
</div>
</header>
<div class="main-body">
<div class="row">
<div class="span12">
<div class="body-content">
<div class="section">
<div class="page-header">
<h2 id="CPD_Results">CPD Results</h2>
</div>
<p>The following document contains the results of PMD's <a class="externalLink" href="http://pmd.sourceforge.net/cpd.html">CPD</a> 5.6.1.</p>
</div>
<div class="section">
<h2 id="Duplications">Duplications</h2>
<table border="0" class="bodyTable table table-striped table-hover">
<thead>
<tr class="a">
<th>File</th>
<th>Line</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td>teetime/framework/A2InvalidThreadAssignmentCheck.java</td>
<td><a href="./xref/teetime/framework/A2InvalidThreadAssignmentCheck.html#L33">33</a></td>
</tr>
<tr class="a">
<td>teetime/framework/scheduling/pushpullmodel/A2InvalidThreadAssignmentCheck.java</td>
<td><a href="./xref/teetime/framework/scheduling/pushpullmodel/A2InvalidThreadAssignmentCheck.html#L34">34</a></td>
</tr>
<tr class="b">
<td colspan="2">
<div>
<pre>public class A2InvalidThreadAssignmentCheck {
private static final int DEFAULT_COLOR = 0;
private final Set<AbstractStage> threadableStages;
public A2InvalidThreadAssignmentCheck(final Set<AbstractStage> threadableStages) {
this.threadableStages = threadableStages;
}
@SuppressWarnings("PMD.DataflowAnomalyAnalysis")
public void check() {
int color = DEFAULT_COLOR;
ObjectIntMap<AbstractStage> colors = new ObjectIntHashMap<AbstractStage>();
ThreadPainter threadPainter = new ThreadPainter();
Traverser traverser = new Traverser(threadPainter);
for (AbstractStage threadableStage : threadableStages) {
color++;
colors.put(threadableStage, color);
threadPainter.reset(colors, color, threadableStages);
traverser.traverse(threadableStage);
}
}
private static class ThreadPainter implements ITraverserVisitor {
private ObjectIntMap<AbstractStage> colors;
private int color;
private Set<AbstractStage> threadableStages;
public void reset(final ObjectIntMap<AbstractStage> colors, final int color, final Set<AbstractStage> threadableStages) {
this.colors = colors;
this.color = color;
this.threadableStages = threadableStages;
}
@Override
public VisitorBehavior visit(final AbstractStage stage) {
return VisitorBehavior.CONTINUE_FORWARD;
}
@Override
public VisitorBehavior visit(final AbstractPort<?> port) {
IPipe<?> pipe = port.getPipe();
AbstractStage targetStage = pipe.getTargetPort().getOwningStage();
int targetColor = colors.containsKey(targetStage) ? colors.get(targetStage) : DEFAULT_COLOR;
if (!threadableStages.contains(targetStage) || targetColor == color) {
if (colors.containsKey(targetStage) && colors.get(targetStage) != color) {
throw new IllegalStateException("1001 - Crossing threads in " + targetStage.getId()); // One stage is connected to a stage of another thread
// (but not its "headstage")
}
colors.put(targetStage, color);
return VisitorBehavior.CONTINUE_FORWARD; // NOPMD makes it clearer
}
return VisitorBehavior.STOP;
}
@Override
public void visit(final DummyPipe pipe, final AbstractPort<?> port) {
// do nothing
}
}
}</pre>
</div></td>
</tr>
</tbody>
</table>
<table border="0" class="bodyTable table table-striped table-hover">
<thead>
<tr class="a">
<th>File</th>
<th>Line</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td>teetime/stage/basic/merger/strategy/BlockingBusyWaitingRoundRobinMergerStrategy.java</td>
<td><a href="./xref/teetime/stage/basic/merger/strategy/BlockingBusyWaitingRoundRobinMergerStrategy.html#L28">28</a></td>
</tr>
<tr class="a">
<td>teetime/stage/basic/merger/strategy/BusyWaitingRoundRobinStrategy.java</td>
<td><a href="./xref/teetime/stage/basic/merger/strategy/BusyWaitingRoundRobinStrategy.html#L31">31</a></td>
</tr>
<tr class="b">
<td colspan="2">
<div>
<pre>public class BlockingBusyWaitingRoundRobinMergerStrategy implements IMergerStrategy {
private int index = 0;
@Override
public <T> T getNextInput(final Merger<T> merger) {
final List<InputPort<?>> inputPorts = merger.getInputPorts();
final InputPort<?> inputPort = getOpenInputPort(inputPorts);
if (null == inputPort) {
return null;
}
@SuppressWarnings("unchecked")
final T token = (T) inputPort.receive();
if (null != token) {
this.index = (this.index + 1) % inputPorts.size();
}
return token;
}
private InputPort<?> getOpenInputPort(final List<InputPort<?>> inputPorts) {
final int startedIndex = index;
InputPort<?> inputPort = inputPorts.get(this.index);
while (inputPort.isClosed()) {
this.index = (this.index + 1) % inputPorts.size();
if (index == startedIndex) {
return null;
}
inputPort = inputPorts.get(this.index);
}
return inputPort;
}
@Override
public void onPortRemoved(final InputPort<?> removedInputPort) {
Merger<?> merger = (Merger<?>) removedInputPort.getOwningStage();
// correct the index if it is out-of-bounds
this.index = (this.index + 1) % merger.getInputPorts().size();
}
}</pre>
</div></td>
</tr>
</tbody>
</table>
<table border="0" class="bodyTable table table-striped table-hover">
<thead>
<tr class="a">
<th>File</th>
<th>Line</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td>teetime/stage/taskfarm/StaticTaskFarmStage.java</td>
<td><a href="./xref/teetime/stage/taskfarm/StaticTaskFarmStage.html#L74">74</a></td>
</tr>
<tr class="a">
<td>teetime/stage/taskfarm/TaskFarmStage.java</td>
<td><a href="./xref/teetime/stage/taskfarm/TaskFarmStage.html#L72">72</a></td>
</tr>
<tr class="b">
<td colspan="2">
<div>
<pre> protected StaticTaskFarmStage(final T workerStage, final int numberStages, final int pipeCapacity, final Distributor<I> distributor, final Merger<O> merger) {
super();
if (null == workerStage) {
throw new IllegalArgumentException("The constructor of a Task Farm may not be called with null as the worker stage.");
}
if (numberStages < 1) {
throw new IllegalArgumentException("The number of worker stages must be at least 1.");
}
if (pipeCapacity < 1) {
throw new IllegalArgumentException("The capacity of the pipe(s) must be at least 1.");
}
this.distributor = distributor;
this.merger = merger;
this.workerStages = new ArrayList<ITaskFarmDuplicable<I, O>>();
this.init(workerStage, numberStages, pipeCapacity);
}
private void init(final T workerStage, final int numberStages, final int pipeCapacity) {
connectWorkerStage(workerStage, pipeCapacity);
workerStage.getInputPort().getOwningStage().declareActive();
for (int i = 1; i < numberStages; i++) {
ITaskFarmDuplicable<I, O> duplicatedWorkerStage = workerStage.duplicate();
connectWorkerStage(duplicatedWorkerStage, pipeCapacity);
duplicatedWorkerStage.getInputPort().getOwningStage().declareActive();
}
if (numberStages > 1) {
this.merger.declareActive();
}</pre>
</div></td>
</tr>
</tbody>
</table>
<table border="0" class="bodyTable table table-striped table-hover">
<thead>
<tr class="a">
<th>File</th>
<th>Line</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td>teetime/stage/basic/merger/strategy/NonBlockingFiniteRoundRobinStrategy.java</td>
<td><a href="./xref/teetime/stage/basic/merger/strategy/NonBlockingFiniteRoundRobinStrategy.html#L35">35</a></td>
</tr>
<tr class="a">
<td>teetime/stage/basic/merger/strategy/RoundRobinStrategy.java</td>
<td><a href="./xref/teetime/stage/basic/merger/strategy/RoundRobinStrategy.html#L31">31</a></td>
</tr>
<tr class="b">
<td colspan="2">
<div>
<pre>public class NonBlockingFiniteRoundRobinStrategy implements IMergerStrategy {
private int index = 0;
@Override
public <T> T getNextInput(final Merger<T> merger) {
final List<InputPort<?>> inputPorts = merger.getInputPorts();
int size = inputPorts.size();
// check each port at most once to avoid a potentially infinite loop
while (size > 0) {
InputPort<?> inputPort = inputPorts.get(this.index);
@SuppressWarnings("unchecked")
final T token = (T) inputPort.receive();
if (token != null) {
return token;
}
this.index = (this.index + 1) % inputPorts.size();
size--;
}
return null;
}
@Override
public void onPortRemoved(final InputPort<?> removedInputPort) {
Merger<?> merger = (Merger<?>) removedInputPort.getOwningStage();
// correct the index if it is out-of-bounds
this.index = (this.index + 1) % merger.getInputPorts().size();
}
}</pre>
</div></td>
</tr>
</tbody>
</table>
<table border="0" class="bodyTable table table-striped table-hover">
<thead>
<tr class="a">
<th>File</th>
<th>Line</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td>teetime/stage/basic/distributor/strategy/BlockingBusyWaitingRoundRobinDistributorStrategy.java</td>
<td><a href="./xref/teetime/stage/basic/distributor/strategy/BlockingBusyWaitingRoundRobinDistributorStrategy.html#L28">28</a></td>
</tr>
<tr class="a">
<td>teetime/stage/basic/distributor/strategy/BlockingRoundRobinStrategy.java</td>
<td><a href="./xref/teetime/stage/basic/distributor/strategy/BlockingRoundRobinStrategy.html#L31">31</a></td>
</tr>
<tr class="b">
<td colspan="2">
<div>
<pre>public class BlockingBusyWaitingRoundRobinDistributorStrategy implements IDistributorStrategy {
private int index;
@SuppressWarnings("unchecked")
@Override
public <T> OutputPort<?> distribute(final List<OutputPort<?>> outputPorts, final T element) {
final OutputPort<T> outputPort = (OutputPort<T>) this.getNextPortInRoundRobinOrder(outputPorts);
outputPort.send(element);
return outputPort;
}
private OutputPort<?> getNextPortInRoundRobinOrder(final List<OutputPort<?>> outputPorts) {
final OutputPort<?> outputPort = outputPorts.get(this.index);
this.index = (this.index + 1) % outputPorts.size();
return outputPort;
}
@Override
public void onPortRemoved(final OutputPort<?> removedOutputPort) {
Distributor<?> distributor = (Distributor<?>) removedOutputPort.getOwningStage();
// correct the index if it is out-of-bounds
this.index = this.index % distributor.getOutputPorts().size();
}
}</pre>
</div></td>
</tr>
</tbody>
</table>
<table border="0" class="bodyTable table table-striped table-hover">
<thead>
<tr class="a">
<th>File</th>
<th>Line</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td>teetime/framework/AbstractSynchedPipe.java</td>
<td><a href="./xref/teetime/framework/AbstractSynchedPipe.html#L41">41</a></td>
</tr>
<tr class="a">
<td>teetime/framework/pipe/AbstractSynchedPipe.java</td>
<td><a href="./xref/teetime/framework/pipe/AbstractSynchedPipe.html#L45">45</a></td>
</tr>
<tr class="b">
<td colspan="2">
<div>
<pre>public abstract class AbstractSynchedPipe<T> extends AbstractPipe<T> {
private final BlockingQueue<ISignal> signalQueue;
private volatile boolean closed;
protected AbstractSynchedPipe(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) {
super(sourcePort, targetPort);
final Queue<ISignal> localSignalQueue = QueueFactory.newQueue(new ConcurrentQueueSpec(1, 1, 0, Ordering.FIFO, Preference.THROUGHPUT));
final PutStrategy<ISignal> putStrategy = new YieldPutStrategy<ISignal>();
final TakeStrategy<ISignal> takeStrategy = new SCParkTakeStrategy<ISignal>();
signalQueue = new PCBlockingQueue<ISignal>(localSignalQueue, putStrategy, takeStrategy);
}
@Override
public void sendSignal(final ISignal signal) {
this.signalQueue.offer(signal);
}
/**
* Retrieves and removes the head of the signal queue
*
* @return Head of signal queue, <code>null</code> if signal queue is empty.
*/
public ISignal getSignal() {
return this.signalQueue.poll();
}
@Override</pre>
</div></td>
</tr>
</tbody>
</table>
<table border="0" class="bodyTable table table-striped table-hover">
<thead>
<tr class="a">
<th>File</th>
<th>Line</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td>teetime/util/io/network/AbstractTcpReader.java</td>
<td><a href="./xref/teetime/util/io/network/AbstractTcpReader.html#L66">66</a></td>
</tr>
<tr class="a">
<td>teetime/util/stage/io/network/AbstractTcpReader.java</td>
<td><a href="./xref/teetime/util/stage/io/network/AbstractTcpReader.html#L68">68</a></td>
</tr>
<tr class="b">
<td colspan="2">
<div>
<pre> serverSocketChannel.close();
} catch (final IOException e) {
logger.debug("Failed to close TCP connection.", e);
}
}
}
}
private void process(final ByteBuffer buffer) {
buffer.flip();
try {
while (buffer.hasRemaining()) {
buffer.mark();
boolean success = this.onBufferReceived(buffer);
if (!success) {
buffer.reset();
buffer.compact();
return;
}
}
buffer.clear();
} catch (final BufferUnderflowException ex) {
logger.warn("Unexpected buffer underflow. Resetting and compacting buffer.", ex);
buffer.reset();
buffer.compact();
}
}
/**
* @param buffer
* to be read from
* @return
* <ul>
* <li><code>true</code> when there were enough bytes to perform the read operation
* <li><code>false</code> otherwise. In this case, the buffer is reset, compacted, and filled with new content.
* </ul>
*/
protected abstract boolean onBufferReceived(final ByteBuffer buffer);
public void terminate() {
this.terminated = true;
}
public int getPort() {
return port;
}
}</pre>
</div></td>
</tr>
</tbody>
</table>
<table border="0" class="bodyTable table table-striped table-hover">
<thead>
<tr class="a">
<th>File</th>
<th>Line</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td>teetime/framework/AbstractUnsynchedPipe.java</td>
<td><a href="./xref/teetime/framework/AbstractUnsynchedPipe.html#L30">30</a></td>
</tr>
<tr class="a">
<td>teetime/framework/pipe/AbstractUnsynchedPipe.java</td>
<td><a href="./xref/teetime/framework/pipe/AbstractUnsynchedPipe.html#L31">31</a></td>
</tr>
<tr class="b">
<td colspan="2">
<div>
<pre>public abstract class AbstractUnsynchedPipe<T> extends AbstractPipe<T> {
private boolean closed;
protected AbstractUnsynchedPipe(final OutputPort<? extends T> sourcePort, final InputPort<T> targetPort) {
super(sourcePort, targetPort);
}
@Override
public final void sendSignal(final ISignal signal) {
// getTargetPort is always non-null since the framework adds dummy ports if necessary
this.cachedTargetStage.onSignal(signal, this.getTargetPort());
}
@Override
public final void reportNewElement() {
this.cachedTargetStage.executeByFramework();
}
@Override
public boolean isClosed() {
return closed;
}
@Override
public void close() {
closed = true;
}
@SuppressWarnings("PMD.EmptyMethodInAbstractClassShouldBeAbstract")
@Override
public void waitForStartSignal() throws InterruptedException {
// default implementation
}
}</pre>
</div></td>
</tr>
</tbody>
</table>
<table border="0" class="bodyTable table table-striped table-hover">
<thead>
<tr class="a">
<th>File</th>
<th>Line</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td>teetime/framework/AbstractSynchedPipe.java</td>
<td><a href="./xref/teetime/framework/AbstractSynchedPipe.html#L69">69</a></td>
</tr>
<tr class="a">
<td>teetime/framework/pipe/AbstractSynchedPipe.java</td>
<td><a href="./xref/teetime/framework/pipe/AbstractSynchedPipe.html#L77">77</a></td>
</tr>
<tr class="b">
<td colspan="2">
<div>
<pre> @Override
public void reportNewElement() { // NOPMD
// default implementation
}
@Override
public final void waitForStartSignal() throws InterruptedException {
final ISignal signal = signalQueue.take();
if (signal instanceof ValidatingSignal) {
this.waitForStartSignal(); // recursive call
return;
}
if (!(signal instanceof StartingSignal)) {
throw new IllegalStateException(
"2001 - Expected StartingSignal, but was " + signal.getClass().getSimpleName() + " in " + getTargetPort().getOwningStage().getId());
}
cachedTargetStage.onSignal(signal, getTargetPort());
}
@Override
public final boolean isClosed() {
return closed;
}
@Override
public final void close() {
closed = true;
}
}</pre>
</div></td>
</tr>
</tbody>
</table>
<table border="0" class="bodyTable table table-striped table-hover">
<thead>
<tr class="a">
<th>File</th>
<th>Line</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td>teetime/framework/pipe/BoundedSynchedPipe.java</td>
<td><a href="./xref/teetime/framework/pipe/BoundedSynchedPipe.html#L46">46</a></td>
</tr>
<tr class="a">
<td>teetime/framework/pipe/UnboundedSynchedPipe.java</td>
<td><a href="./xref/teetime/framework/pipe/UnboundedSynchedPipe.html#L40">40</a></td>
</tr>
<tr class="b">
<td colspan="2">
<div>
<pre> strategy.add(this, element);
getScheduler().onElementAdded(this);
}
@Override
public boolean addNonBlocking(final Object element) {
boolean offered = this.queue.offer(element);
if (offered) {
getScheduler().onElementAdded(this);
} else {
getScheduler().onElementNotAdded(this);
}
return offered;
}
@Override
public Object removeLast() {
return this.queue.poll();
}
@Override
public boolean isEmpty() {
return this.queue.isEmpty();
}
@Override
public int size() {
return this.queue.size();
}
@Override
public int getNumWaits() {</pre>
</div></td>
</tr>
</tbody>
</table>
<table border="0" class="bodyTable table table-striped table-hover">
<thead>
<tr class="a">
<th>File</th>
<th>Line</th>
</tr>
</thead>
<tbody>
<tr class="b">
<td>teetime/stage/basic/distributor/dynamic/CreatePortAction.java</td>
<td><a href="./xref/teetime/stage/basic/distributor/dynamic/CreatePortAction.html#L55">55</a></td>
</tr>
<tr class="a">
<td>teetime/stage/basic/distributor/dynamic/CreatePortActionDistributor.java</td>
<td><a href="./xref/teetime/stage/basic/distributor/dynamic/CreatePortActionDistributor.html#L49">49</a></td>
</tr>
<tr class="b">
<td colspan="2">
<div>
<pre> new BoundedSynchedPipe<T>(newOutputPort, inputPort, capacity);
newOutputPort.sendSignal(new StartingSignal());
onOutputPortCreated(dynamicDistributor, newOutputPort);
condition.signalAll();
}
private void onOutputPortCreated(final DynamicDistributor<T> dynamicDistributor, final OutputPort<T> newOutputPort) {
for (PortActionListener<T> listener : listeners) {
listener.onOutputPortCreated(dynamicDistributor, newOutputPort);
}
}
/* default */ InputPort<T> getInputPort() { // for testing purposes only
return inputPort;
}
public void addPortActionListener(final PortActionListener<T> listener) {
listeners.add(listener);
}
public void waitForCompletion() throws InterruptedException {
condition.await();
}
}</pre>
</div></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div><!-- /container -->
<!-- Footer
================================================== -->
<footer class="well">
<div class="container">
<div class="row">
<div class="span3 bottom-nav">
<ul class="nav nav-list">
<li class="nav-header">Main</li>
<li >
<a href="index.html" title="Home">Home</a>
</li>
<li >
<a href="download.html" title="Download">Download</a>
</li>
<li >
<a href="wiki/home.html" title="Wiki">Wiki</a>
</li>
</ul>
</div>
<div class="span3 bottom-nav">
<ul class="nav nav-list">
<li class="nav-header">Documentation</li>
<li >
<a href="stabledocs/index.html" title="JavaDoc">JavaDoc</a>
</li>
<li >
<a href="changes-report.html" title="Release Notes">Release Notes</a>
</li>
<li >
<a href="dependencies.html" title="Project Dependencies">Project Dependencies</a>
</li>
<li >
<a href="license.html" title="License">License</a>
</li>
</ul>
</div>
<div class="span3 bottom-nav">
<ul class="nav nav-list">
<li class="nav-header">Get Involved</li>
<li >
<a href="contribute.html" title="Contribute">Contribute</a>
</li>
<li >
<a href="https://github.com/teetime-framework/teetime" title="Visit us on GitHub" class="externalLink">Visit us on GitHub</a>
</li>
<li >
<a href="https://build.se.informatik.uni-kiel.de/gitlab/teetime/teetime/issues" title="Issue Tracking" class="externalLink">Issue Tracking</a>
</li>
<li >
<a href="team-list.html" title="Team">Team</a>
</li>
</ul>
</div>
<div class="span3 bottom-description">
<blockquote><a class="twitter-follow-button" data-show-count="false" href="https://twitter.com/TeeTime_Fwrk">Follow @TeeTime_Fwrk</a>
<br />
Snapshot state:
<br />
<a href="https://build.se.informatik.uni-kiel.de/jenkins/view/TeeTime/job/teetime-nightly-release/">
<img alt="Jenkins build status"
src="https://img.shields.io/jenkins/s/https/build.se.informatik.uni-kiel.de/jenkins/view/TeeTime/job/teetime-nightly-release.svg?style=flat-square">
</a>
<br />
<a href="https://build.se.informatik.uni-kiel.de/jenkins/view/TeeTime/job/teetime-nightly-release/lastCompletedBuild/testReport/">
<img alt="Jenkins build status"
src="https://img.shields.io/jenkins/t/https/build.se.informatik.uni-kiel.de/jenkins/view/TeeTime/job/teetime-nightly-release.svg?style=flat-square">
</a>
<br />Stable state:
<br />
<a href="https://github.com/teetime-framework/teetime/releases/latest" rel="nofollow"><img alt="Download TeeTime" src="https://img.shields.io/badge/GitHub-v2.1-blue.svg?style=flat-square"></a>
<br />
<a href="https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22net.sourceforge.teetime%22%20AND%20a%3A%22teetime%22">
<img alt="Download TeeTime" src="https://img.shields.io/maven-central/v/net.sourceforge.teetime/teetime.svg?style=flat-square">
</a></blockquote>
<blockquote class="version-date"><span class="publishDate">Last Published: 2019-02-12</span></blockquote>
</div>
</div>
</div>
</footer>
<div class="container subfooter">
<div class="row">
<div class="span12">
<p class="pull-right"><a href="#">Back to top</a></p>
<p class="copyright">Copyright ©2015-2019. All Rights Reserved.</p>
<p><a href="http://github.com/andriusvelykis/reflow-maven-skin" title="Reflow Maven skin">Reflow Maven skin</a> by <a href="http://andrius.velykis.lt" target="_blank" title="Andrius Velykis">Andrius Velykis</a>.</p>
</div>
</div>
</div>
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script src="https://teetime-framework.github.io/js/lightbox.min.js"></script>
<script src="https://teetime-framework.github.io/js/reflow-scroll.js"></script>
<script src="https://teetime-framework.github.io/js/jquery.cookiesdirective.js"></script>
<script src="https://teetime-framework.github.io/js/teetime.js"></script>
<script src="https://teetime-framework.github.io/js/reflow-skin.js"></script>
</body>
</html>