de.unihalle.informatik.Alida.operator
Class ALDOperatorControllable

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDOperator
      extended by de.unihalle.informatik.Alida.operator.ALDOperatorControllable
All Implemented Interfaces:
ALDConfigurationValidator, ALDConfigurationEventListener, ALDConfigurationEventReporter, ALDControlEventListener, ALDControlEventReporter, ALDOperatorExecutionProgressEventListener, EventListener
Direct Known Subclasses:
ALDDemoOpControllable, ALDWorkflow

@ALDAOperator
public class ALDOperatorControllable
extends ALDOperator
implements ALDControlEventListener, ALDControlEventReporter, ALDConfigurationEventListener, ALDConfigurationEventReporter

Operator class with inherent event handling for execution control.

This operator acts as listener for `Alida` control events. On receiving events the operator changes its control status which may be used to control operator execution, and in particular to interrupt calculations in a controlled fashion, i.e. to keep results already obtained.

Author:
moeller

Nested Class Summary
static class ALDOperatorControllable.OperatorControlStatus
          Control command and/or operator status, respectively.
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
ALDOperator.HidingMode
 
Field Summary
protected  EventListenerList configurationEventlistenerList
          List of configuration event listeners attached to this reporter.
protected  EventListenerList controlEventlistenerList
          List of control event listeners attached to this reporter.
protected  boolean notifyListenersRecursively
          Flag for recursive propagation of events to nested listeners.
protected  ALDOperatorControllable.OperatorControlStatus operatorStatus
          Status of operator, used to stop/pause/resume calculations.
protected  int stepSize
          Step size in step-wise execution mode.
protected  boolean stepWiseExecution
          Flag for step-wise execution.
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, operatorExecutionEventlistenerList, portHashAccess, verbose, versionProvider
 
Constructor Summary
ALDOperatorControllable()
          Default constructor.
 
Method Summary
 void addALDConfigurationEventListener(ALDConfigurationEventListener listener)
          Adds a listener to this reporter.
 void addALDControlEventListener(ALDControlEventListener listener)
          Adds a listener to this reporter.
 void fireALDConfigurationEvent(ALDConfigurationEvent event)
          Sends an event to all registered listeners.
 void fireALDControlEvent(ALDControlEvent event)
          Sends the given event to all registered listeners.
 void handleALDConfigurationEvent(ALDConfigurationEvent event)
          Method which is called on event occurence.
 void handleALDControlEvent(ALDControlEvent event)
          Method which is called on event occurence.
protected  void operate()
          This method does the actual work and needs to be implemented by every subclass.
 void removeALDConfigurationEventListener(ALDConfigurationEventListener listener)
          Removes a listener from this reporter.
 void removeALDControlEventListener(ALDControlEventListener listener)
          Removes a listener from this reporter.
 void setNotifyRecursiveFlag(boolean flag)
          Specify if events are to be passed forward to nested listeners or not.
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
addOperatorExecutionProgressEventListener, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getHidingMode, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVerbose, getVersion, handleOperatorExecutionProgressEvent, isConfigured, print, print, print, printInterface, printInterface, readHistory, readResolve, reinitializeParameterDescriptors, removeOperatorExecutionProgressEventListener, runOp, runOp, runOp, setConstructionMode, setHidingMode, setName, setParameter, setVerbose, toStringVerbose, unconfiguredItems, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stepWiseExecution

protected boolean stepWiseExecution
Flag for step-wise execution.


stepSize

protected int stepSize
Step size in step-wise execution mode.


notifyListenersRecursively

protected boolean notifyListenersRecursively
Flag for recursive propagation of events to nested listeners.


controlEventlistenerList

protected volatile EventListenerList controlEventlistenerList
List of control event listeners attached to this reporter.


configurationEventlistenerList

protected volatile EventListenerList configurationEventlistenerList
List of configuration event listeners attached to this reporter.


operatorStatus

protected volatile ALDOperatorControllable.OperatorControlStatus operatorStatus
Status of operator, used to stop/pause/resume calculations.

Constructor Detail

ALDOperatorControllable

public ALDOperatorControllable()
                        throws ALDOperatorException
Default constructor.

Throws:
ALDOperatorException
Method Detail

setNotifyRecursiveFlag

public void setNotifyRecursiveFlag(boolean flag)
Specify if events are to be passed forward to nested listeners or not.


handleALDControlEvent

public void handleALDControlEvent(ALDControlEvent event)
Description copied from interface: ALDControlEventListener
Method which is called on event occurence.

Specified by:
handleALDControlEvent in interface ALDControlEventListener
Parameters:
event - Event to be handled.

addALDControlEventListener

public void addALDControlEventListener(ALDControlEventListener listener)
Description copied from interface: ALDControlEventReporter
Adds a listener to this reporter.

Specified by:
addALDControlEventListener in interface ALDControlEventReporter
Parameters:
listener - Listener to be added.

removeALDControlEventListener

public void removeALDControlEventListener(ALDControlEventListener listener)
Description copied from interface: ALDControlEventReporter
Removes a listener from this reporter.

Specified by:
removeALDControlEventListener in interface ALDControlEventReporter
Parameters:
listener - Listener to be removed.

fireALDControlEvent

public void fireALDControlEvent(ALDControlEvent event)
Description copied from interface: ALDControlEventReporter
Sends the given event to all registered listeners.

Specified by:
fireALDControlEvent in interface ALDControlEventReporter
Parameters:
event - Event to be send to all listeners.

operate

protected void operate()
                throws ALDOperatorException,
                       ALDProcessingDAGException
Description copied from class: ALDOperator
This method does the actual work and needs to be implemented by every subclass.

Specified by:
operate in class ALDOperator
Throws:
ALDOperatorException
ALDProcessingDAGException

addALDConfigurationEventListener

public void addALDConfigurationEventListener(ALDConfigurationEventListener listener)
Description copied from interface: ALDConfigurationEventReporter
Adds a listener to this reporter.

Specified by:
addALDConfigurationEventListener in interface ALDConfigurationEventReporter
Parameters:
listener - Listener to be added.

removeALDConfigurationEventListener

public void removeALDConfigurationEventListener(ALDConfigurationEventListener listener)
Description copied from interface: ALDConfigurationEventReporter
Removes a listener from this reporter.

Specified by:
removeALDConfigurationEventListener in interface ALDConfigurationEventReporter
Parameters:
listener - Listener to be removed.

fireALDConfigurationEvent

public void fireALDConfigurationEvent(ALDConfigurationEvent event)
Description copied from interface: ALDConfigurationEventReporter
Sends an event to all registered listeners.

Specified by:
fireALDConfigurationEvent in interface ALDConfigurationEventReporter
Parameters:
event - Event to be send to all listeners.

handleALDConfigurationEvent

public void handleALDConfigurationEvent(ALDConfigurationEvent event)
Description copied from interface: ALDConfigurationEventListener
Method which is called on event occurence.

Specified by:
handleALDConfigurationEvent in interface ALDConfigurationEventListener
Parameters:
event - Event to be handled.


Copyright © 2010–2014 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.