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
b8dd46cf
Commit
b8dd46cf
authored
9 years ago
by
Nelson Tavares de Sousa
Browse files
Options
Downloads
Patches
Plain Diff
the CompositeStage now extends AnalysisConfiguration
parent
efa6071d
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
+1
-83
1 addition, 83 deletions
src/main/java/teetime/framework/AbstractCompositeStage.java
src/main/java/teetime/framework/AnalysisConfiguration.java
+11
-8
11 additions, 8 deletions
src/main/java/teetime/framework/AnalysisConfiguration.java
with
12 additions
and
91 deletions
src/main/java/teetime/framework/AbstractCompositeStage.java
+
1
−
83
View file @
b8dd46cf
...
...
@@ -15,12 +15,6 @@
*/
package
teetime.framework
;
import
java.util.LinkedList
;
import
java.util.List
;
import
teetime.framework.signal.ISignal
;
import
teetime.framework.validation.InvalidPortConnection
;
import
teetime.util.Connection
;
/**
* Represents a minimal stage that composes several other stages.
...
...
@@ -32,84 +26,8 @@ import teetime.util.Connection;
*
*/
@Deprecated
public
abstract
class
AbstractCompositeStage
extends
Stage
{
private
final
List
<
Connection
>
connections
=
new
LinkedList
<
Connection
>();
public
abstract
class
AbstractCompositeStage
extends
AnalysisConfiguration
{
protected
abstract
Stage
getFirstStage
();
protected
<
T
>
void
connectPorts
(
final
OutputPort
<?
extends
T
>
out
,
final
InputPort
<
T
>
in
)
{
connections
.
add
(
new
Connection
(
out
,
in
));
}
public
List
<
Connection
>
getConnections
()
{
return
connections
;
}
@Override
public
final
void
validateOutputPorts
(
final
List
<
InvalidPortConnection
>
invalidPortConnections
)
{
throw
new
IllegalStateException
(
"This method must never be called"
);
}
@Override
protected
final
void
executeStage
()
{
throw
new
IllegalStateException
(
"This method must never be called"
);
}
@Override
protected
final
void
onSignal
(
final
ISignal
signal
,
final
InputPort
<?>
inputPort
)
{
throw
new
IllegalStateException
(
"This method must never be called"
);
}
@Override
protected
final
TerminationStrategy
getTerminationStrategy
()
{
throw
new
IllegalStateException
(
"This method must never be called"
);
}
@Override
protected
final
void
terminate
()
{
throw
new
IllegalStateException
(
"This method must never be called"
);
}
@Override
protected
final
boolean
shouldBeTerminated
()
{
throw
new
IllegalStateException
(
"This method must never be called"
);
}
@Override
public
final
StageState
getCurrentState
()
{
throw
new
IllegalStateException
(
"This method must never be called"
);
}
@Override
protected
final
InputPort
<?>[]
getInputPorts
()
{
throw
new
IllegalStateException
(
"This method must never be called"
);
}
@Override
protected
final
OutputPort
<?>[]
getOutputPorts
()
{
throw
new
IllegalStateException
(
"This method must never be called"
);
}
@Override
public
final
void
onValidating
(
final
List
<
InvalidPortConnection
>
invalidPortConnections
)
{
throw
new
IllegalStateException
(
"This method must never be called"
);
}
@Override
public
final
void
onInitializing
()
throws
Exception
{
throw
new
IllegalStateException
(
"This method must never be called"
);
}
@Override
public
final
void
onStarting
()
throws
Exception
{
throw
new
IllegalStateException
(
"This method must never be called"
);
}
@Override
public
final
void
onTerminating
()
throws
Exception
{
throw
new
IllegalStateException
(
"This method must never be called"
);
}
}
This diff is collapsed.
Click to expand it.
src/main/java/teetime/framework/AnalysisConfiguration.java
+
11
−
8
View file @
b8dd46cf
...
...
@@ -32,7 +32,7 @@ import teetime.util.Connection;
public
abstract
class
AnalysisConfiguration
{
private
final
List
<
Stage
>
threadableStageJobs
=
new
LinkedList
<
Stage
>();
private
final
List
<
Connection
>
connections
=
new
LinkedList
<
Connection
>();
private
final
List
<
Connection
<?>
>
connections
=
new
LinkedList
<
Connection
<?>
>();
@SuppressWarnings
(
"deprecation"
)
private
static
final
PipeFactoryRegistry
PIPE_FACTORY_REGISTRY
=
PipeFactoryRegistry
.
INSTANCE
;
...
...
@@ -61,11 +61,14 @@ public abstract class AnalysisConfiguration {
* A arbitrary stage, which will be added to the configuration and executed in a thread.
*/
protected
void
addThreadableStage
(
final
Stage
stage
)
{
if
(
stage
instanceof
AbstractCompositeStage
)
{
this
.
threadableStageJobs
.
add
(((
AbstractCompositeStage
)
stage
).
getFirstStage
());
this
.
connections
.
addAll
(((
AbstractCompositeStage
)
stage
).
getConnections
());
}
else
{
this
.
threadableStageJobs
.
add
(
stage
);
this
.
threadableStageJobs
.
add
(
stage
);
}
protected
void
addThreadableStage
(
final
AbstractCompositeStage
stage
)
{
this
.
threadableStageJobs
.
add
(
stage
.
getFirstStage
());
this
.
connections
.
addAll
(
stage
.
getConnections
());
for
(
Stage
threadableStage
:
stage
.
getThreadableStageJobs
())
{
this
.
addThreadableStage
(
threadableStage
);
}
}
...
...
@@ -169,7 +172,7 @@ public abstract class AnalysisConfiguration {
* 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.
*/
protected
<
T
>
void
connectPorts
(
final
OutputPort
<?
extends
T
>
sourcePort
,
final
InputPort
<
T
>
targetPort
,
final
int
capacity
)
{
connections
.
add
(
new
Connection
(
sourcePort
,
targetPort
,
capacity
));
connections
.
add
(
new
Connection
<
T
>
(
sourcePort
,
targetPort
,
capacity
));
}
/**
...
...
@@ -177,7 +180,7 @@ public abstract class AnalysisConfiguration {
*
* @return a list of pairs of Out- and InputPorts, which are connected
*/
protected
List
<
Connection
>
getConnections
()
{
protected
List
<
Connection
<?>
>
getConnections
()
{
return
connections
;
}
...
...
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