org.embl.ebi.escience.scufl
Class ConcurrencyConstraint

java.lang.Object
  extended by org.embl.ebi.escience.scufl.ConcurrencyConstraint
All Implemented Interfaces:
java.io.Serializable

public class ConcurrencyConstraint
extends java.lang.Object
implements java.io.Serializable

Represents a concurrency constraint between two processors

Author:
Tom Oinn
See Also:
Serialized Form

Field Summary
static int ABORTED
          Signifies that the processor has failed in some fashion
static int COMPLETED
          Signifies that the processor has completed
static int RUNNING
          Signifies that the processor has an active thread in the 'invoke' method
static int SCHEDULED
          Signifies that the processor has been created but is not running
 
Constructor Summary
ConcurrencyConstraint(ScuflModel model, java.lang.String name, Processor controller, Processor target, int targetStateFrom, int targetStateTo, int controllerStateGuard)
          Create a new concurrency constraint.
 
Method Summary
 int getControllerStateGuard()
          Return the state the controller processor must be in in order to permit the specified transition of the target processor
 Processor getControllingProcessor()
          Return the processor whos state is controlling the transition of the target processor
 java.lang.String getName()
          Return the name of the constraint
 Processor getTargetProcessor()
          Return the processor that this constraint is regulating
 int getTargetStateFrom()
          Return the state from which the target processor will move in the event of the control state being satisfied
 int getTargetStateTo()
          Return the state to which the target processor will be allowed to change if the control state is satisfied
static java.lang.String statusCodeToString(int status)
          Convert a state int to a String representation of it
static int statusStringToInt(java.lang.String status)
          Convert a string into an int status code, the string must be one of scheduled, running, completed, aborted and is not case sensitive.
 java.lang.String toString()
          Override toString method to display the two processors, controller first, that this constraint applies to.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SCHEDULED

public static final int SCHEDULED
Signifies that the processor has been created but is not running

See Also:
Constant Field Values

RUNNING

public static final int RUNNING
Signifies that the processor has an active thread in the 'invoke' method

See Also:
Constant Field Values

COMPLETED

public static final int COMPLETED
Signifies that the processor has completed

See Also:
Constant Field Values

ABORTED

public static final int ABORTED
Signifies that the processor has failed in some fashion

See Also:
Constant Field Values
Constructor Detail

ConcurrencyConstraint

public ConcurrencyConstraint(ScuflModel model,
                             java.lang.String name,
                             Processor controller,
                             Processor target,
                             int targetStateFrom,
                             int targetStateTo,
                             int controllerStateGuard)
                      throws DuplicateConcurrencyConstraintNameException,
                             ConcurrencyConstraintCreationException
Create a new concurrency constraint. The arguments mean that the constraint should prevent the target processor moving from targetStateFrom to targetStateTo unless the controller processer is in state controllerStateGuard

Throws:
DuplicateConcurrencyConstraintNameException
ConcurrencyConstraintCreationException
Method Detail

getName

public java.lang.String getName()
Return the name of the constraint


getTargetProcessor

public Processor getTargetProcessor()
Return the processor that this constraint is regulating


getControllingProcessor

public Processor getControllingProcessor()
Return the processor whos state is controlling the transition of the target processor


getTargetStateFrom

public int getTargetStateFrom()
Return the state from which the target processor will move in the event of the control state being satisfied


getTargetStateTo

public int getTargetStateTo()
Return the state to which the target processor will be allowed to change if the control state is satisfied


getControllerStateGuard

public int getControllerStateGuard()
Return the state the controller processor must be in in order to permit the specified transition of the target processor


statusCodeToString

public static java.lang.String statusCodeToString(int status)
Convert a state int to a String representation of it


statusStringToInt

public static int statusStringToInt(java.lang.String status)
Convert a string into an int status code, the string must be one of scheduled, running, completed, aborted and is not case sensitive.


toString

public java.lang.String toString()
Override toString method to display the two processors, controller first, that this constraint applies to.

Overrides:
toString in class java.lang.Object