Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TeeTime-Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nelson Tavares de Sousa
TeeTime-Framework
Commits
213d1e8f
Commit
213d1e8f
authored
9 years ago
by
Nelson Tavares de Sousa
Browse files
Options
Downloads
Patches
Plain Diff
set methods to package private;
moved javadoc to the public class
parent
08d11d9e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/teetime/framework/AbstractCompositeStage.java
+34
-1
34 additions, 1 deletion
src/main/java/teetime/framework/AbstractCompositeStage.java
src/main/java/teetime/framework/ConfigurationContext.java
+2
-30
2 additions, 30 deletions
src/main/java/teetime/framework/ConfigurationContext.java
with
36 additions
and
31 deletions
src/main/java/teetime/framework/AbstractCompositeStage.java
+
34
−
1
View file @
213d1e8f
...
...
@@ -25,6 +25,11 @@ package teetime.framework;
*/
public
abstract
class
AbstractCompositeStage
{
/**
* Default capacity for pipes
*/
private
static
final
int
DEFAULT_CAPACITY
=
4
;
private
final
ConfigurationContext
context
;
public
AbstractCompositeStage
(
final
ConfigurationContext
context
)
{
...
...
@@ -38,14 +43,42 @@ public abstract class AbstractCompositeStage {
return
context
;
}
/**
* Execute this method, to add a stage to the configuration, which should be executed in a own thread.
*
* @param stage
* A arbitrary stage, which will be added to the configuration and executed in a thread.
*/
protected
final
void
addThreadableStage
(
final
Stage
stage
)
{
context
.
addThreadableStage
(
stage
);
}
/**
* Connects two ports with a pipe with a default capacity of currently {@value #DEFAULT_CAPACITY}.
*
* @param sourcePort
* {@link OutputPort} of the sending stage
* @param targetPort
* {@link InputPort} of the sending stage
* @param <T>
* the type of elements to be sent
*/
protected
final
<
T
>
void
connectPorts
(
final
OutputPort
<?
extends
T
>
sourcePort
,
final
InputPort
<
T
>
targetPort
)
{
context
.
connectPorts
(
sourcePort
,
targetPort
);
context
.
connectPorts
(
sourcePort
,
targetPort
,
DEFAULT_CAPACITY
);
}
/**
* Connects to ports with a pipe of a certain capacity
*
* @param sourcePort
* {@link OutputPort} of the sending stage
* @param targetPort
* {@link InputPort} of the sending stage
* @param capacity
* the pipe is set to this capacity, if the value is greater than 0. If it is 0, than the pipe is unbounded, thus growing of the pipe is enabled.
* @param <T>
* the type of elements to be sent
*/
protected
final
<
T
>
void
connectPorts
(
final
OutputPort
<?
extends
T
>
sourcePort
,
final
InputPort
<
T
>
targetPort
,
final
int
capacity
)
{
context
.
connectPorts
(
sourcePort
,
targetPort
,
capacity
);
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/teetime/framework/ConfigurationContext.java
+
2
−
30
View file @
213d1e8f
...
...
@@ -31,8 +31,6 @@ import teetime.framework.pipe.InstantiationPipe;
*/
public
final
class
ConfigurationContext
{
private
static
final
int
DEFAULT_CAPACITY
=
4
;
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ConfigurationContext
.
class
);
private
final
Set
<
Stage
>
threadableStages
=
new
HashSet
<
Stage
>();
...
...
@@ -44,10 +42,7 @@ public final class ConfigurationContext {
}
/**
* Execute this method, to add a stage to the configuration, which should be executed in a own thread.
*
* @param stage
* A arbitrary stage, which will be added to the configuration and executed in a thread.
* @see AbstractCompositeStage#addThreadableStage(Stage)
*/
final
void
addThreadableStage
(
final
Stage
stage
)
{
if
(!
this
.
threadableStages
.
add
(
stage
))
{
...
...
@@ -56,30 +51,7 @@ public final class ConfigurationContext {
}
/**
* Connects two ports with a pipe with a default capacity of currently {@value #DEFAULT_CAPACITY}.
*
* @param sourcePort
* {@link OutputPort} of the sending stage
* @param targetPort
* {@link InputPort} of the sending stage
* @param <T>
* the type of elements to be sent
*/
final
<
T
>
void
connectPorts
(
final
OutputPort
<?
extends
T
>
sourcePort
,
final
InputPort
<
T
>
targetPort
)
{
connectPorts
(
sourcePort
,
targetPort
,
DEFAULT_CAPACITY
);
}
/**
* Connects to ports with a pipe of a certain capacity
*
* @param sourcePort
* {@link OutputPort} of the sending stage
* @param targetPort
* {@link InputPort} of the sending stage
* @param capacity
* the pipe is set to this capacity, if the value is greater than 0. If it is 0, than the pipe is unbounded, thus growing of the pipe is enabled.
* @param <T>
* the type of elements to be sent
* @see AbstractCompositeStage#connectPorts(OutputPort, InputPort, int)
*/
final
<
T
>
void
connectPorts
(
final
OutputPort
<?
extends
T
>
sourcePort
,
final
InputPort
<
T
>
targetPort
,
final
int
capacity
)
{
if
(
sourcePort
.
getOwningStage
().
getInputPorts
().
length
==
0
&&
!
threadableStages
.
contains
(
sourcePort
.
getOwningStage
()))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment