Package mgui.pipelines
Class PipelineLauncher
java.lang.Object
javax.swing.SwingWorker<java.lang.Boolean,mgui.pipelines.PipelineLauncher.TaskEvent>
mgui.pipelines.PipelineLauncher
- All Implemented Interfaces:
java.lang.Runnable
,java.util.concurrent.Future<java.lang.Boolean>
,java.util.concurrent.RunnableFuture<java.lang.Boolean>
,DynamicPipelineListener
public class PipelineLauncher extends javax.swing.SwingWorker<java.lang.Boolean,mgui.pipelines.PipelineLauncher.TaskEvent> implements DynamicPipelineListener
A launcher for an
InterfacePipeline
object. Creates and runs its own thread and then
calls InterfacePipeline.launch
, which blocks until the pipeline has finished.- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.SwingWorker
javax.swing.SwingWorker.StateValue
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<DynamicPipelineListener>
dynamic_pipeline_listeners
java.lang.String
instance
InterfacePipeline
pipeline
InterfaceProject
project
-
Constructor Summary
Constructors Constructor Description PipelineLauncher(InterfacePipeline pipeline)
PipelineLauncher(InterfacePipeline pipeline, java.lang.String instance, InterfaceProject project)
-
Method Summary
Modifier and Type Method Description void
addDynamicListener(DynamicPipelineListener listener)
protected java.lang.Boolean
doInBackground()
protected void
done()
protected void
firePipelineLaunched(mgui.pipelines.PipelineLauncher.TaskEvent event)
protected void
firePipelineTaskLaunched(mgui.pipelines.PipelineLauncher.TaskEvent event)
protected void
firePipelineTaskTerminated(mgui.pipelines.PipelineLauncher.TaskEvent event)
protected void
firePipelineTaskUpdated(mgui.pipelines.PipelineLauncher.TaskEvent event)
protected void
firePipelineTerminated(mgui.pipelines.PipelineLauncher.TaskEvent event)
void
pipelineLaunched(DynamicPipelineEvent event)
Called when a pipeline is initially launchedvoid
pipelineTaskLaunched(DynamicPipelineEvent event, PipelineTask task)
Called when a pipeline task is launched.void
pipelineTaskTerminated(DynamicPipelineEvent event, PipelineTask task)
Called when a pipeline task is terminated.void
pipelineTaskUpdated(DynamicPipelineEvent event, PipelineTask task)
Called when a pipeline task requests to publish an update.void
pipelineTerminated(DynamicPipelineEvent event)
Called when a pipeline is terminated.protected void
process(java.util.List<mgui.pipelines.PipelineLauncher.TaskEvent> events)
void
removeDynamicListener(DynamicPipelineListener listener)
Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, publish, removePropertyChangeListener, run, setProgress
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
dynamic_pipeline_listeners
-
instance
public java.lang.String instance -
project
-
pipeline
-
-
Constructor Details
-
PipelineLauncher
-
PipelineLauncher
public PipelineLauncher(InterfacePipeline pipeline, java.lang.String instance, InterfaceProject project)
-
-
Method Details
-
addDynamicListener
-
removeDynamicListener
-
doInBackground
protected java.lang.Boolean doInBackground() throws java.lang.Exception- Specified by:
doInBackground
in classjavax.swing.SwingWorker<java.lang.Boolean,mgui.pipelines.PipelineLauncher.TaskEvent>
- Throws:
java.lang.Exception
-
done
protected void done()- Overrides:
done
in classjavax.swing.SwingWorker<java.lang.Boolean,mgui.pipelines.PipelineLauncher.TaskEvent>
-
process
protected void process(java.util.List<mgui.pipelines.PipelineLauncher.TaskEvent> events)- Overrides:
process
in classjavax.swing.SwingWorker<java.lang.Boolean,mgui.pipelines.PipelineLauncher.TaskEvent>
-
firePipelineTaskLaunched
protected void firePipelineTaskLaunched(mgui.pipelines.PipelineLauncher.TaskEvent event) -
firePipelineTaskTerminated
protected void firePipelineTaskTerminated(mgui.pipelines.PipelineLauncher.TaskEvent event) -
firePipelineTaskUpdated
protected void firePipelineTaskUpdated(mgui.pipelines.PipelineLauncher.TaskEvent event) -
firePipelineLaunched
protected void firePipelineLaunched(mgui.pipelines.PipelineLauncher.TaskEvent event) -
firePipelineTerminated
protected void firePipelineTerminated(mgui.pipelines.PipelineLauncher.TaskEvent event) -
pipelineLaunched
Description copied from interface:DynamicPipelineListener
Called when a pipeline is initially launched- Specified by:
pipelineLaunched
in interfaceDynamicPipelineListener
-
pipelineTerminated
Description copied from interface:DynamicPipelineListener
Called when a pipeline is terminated. The state of the pipeline can be queried via theStaticPipelineEvent
object.- Specified by:
pipelineTerminated
in interfaceDynamicPipelineListener
-
pipelineTaskTerminated
Description copied from interface:DynamicPipelineListener
Called when a pipeline task is terminated. The state of the pipeline can be queried via theStaticPipelineEvent
object.- Specified by:
pipelineTaskTerminated
in interfaceDynamicPipelineListener
-
pipelineTaskUpdated
Description copied from interface:DynamicPipelineListener
Called when a pipeline task requests to publish an update.- Specified by:
pipelineTaskUpdated
in interfaceDynamicPipelineListener
-
pipelineTaskLaunched
Description copied from interface:DynamicPipelineListener
Called when a pipeline task is launched.- Specified by:
pipelineTaskLaunched
in interfaceDynamicPipelineListener
-