gov.nasa.arc.brahms.common.rt
Class CreateObjectActivityCtx

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.ActivityCtx
          extended by gov.nasa.arc.brahms.common.rt.PrimitiveActivityCtx
              extended by gov.nasa.arc.brahms.common.rt.CreateObjectActivityCtx
All Implemented Interfaces:
IActivityCtx, IBrahmsObjectCtx, ICreateObjectActivityCtx, IPrimitiveActivityCtx, IRuntimeConstants, java.io.Serializable

public class CreateObjectActivityCtx
extends PrimitiveActivityCtx
implements ICreateObjectActivityCtx

The CreateObjectActivityCtx maintains the context of a create object activity being or to be executed by an active instance. The context maintains the start and end times for an activity, the duration, priority, status, randomness, duration, resources, source object, destination object, name and location of the destination object, aggregate conceptual instances and the action and when the action is to take place.

Version:
29 November 1999
Author:
Ron van Hoof
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface gov.nasa.arc.brahms.common.rt.IRuntimeConstants
ABORTED, ACTIVE, ACTIVITY, AVAILABLE, COMPLETED, CONSEQUENCE, DETECTABLE, ENDED, ENGINE, EXTERNAL_AGENT, FROM, IMPASSED, INITIAL, INTERRUPTED, JAVA_PROPERTY, sABORTED, sACTIVE, sAVAILABLE, sCOMPLETED, sENDED, sIMPASSED, sINTERRUPTED, sUNAVAILABLE, TO, TRANSFER, UNAVAILABLE
 
Constructor Summary
CreateObjectActivityCtx(CreateObjectActivity act)
          Constructor, creates a new context for the specified CreateObjectActivity.
 
Method Summary
 void addBoundVariable(VariableCtx var)
          Adds the specified variable as a variable bound by this activity.
 void addDestinationAggregate(ParameterCtx aggregate)
          Adds the specified aggregate (ParameterCtx) as an aggregate for the created object.
 ParameterCtx getAction()
          Returns the create object's action (NEW or COPY).
 java.util.Enumeration getBoundVariables()
          Returns a list of all the variables used by this activity.
 ParameterCtx getDestination()
          Returns the create object's destination object or class.
 java.util.Enumeration getDestinationAggregates()
          Returns a list of all the destination aggregates (ParameterCtx).
 ParameterCtx getDestinationLocation()
          Returns the location for the created object.
 ParameterCtx getDestinationName()
          Returns the name for the created object.
 ParameterCtx getSource()
          Returns the create object's source object or class.
 ParameterCtx getWhen()
          Returns when the create object action is to take place (start or end).
 void removeBoundVariable(VariableCtx var)
          Removes the specified variable as a variable bound by this activity.
 void removeDestinationAggregate(PartCtx aggregate)
          Removes the specified aggregate (ParameterCtx) as an aggregate for the created object.
 void setAction(ParameterCtx action)
          Sets the create object's action (NEW or COPY).
 void setDestination(ParameterCtx destination)
          Sets the create object's destination object or class.
 void setDestinationLocation(ParameterCtx destinationLocation)
          Sets the location for the created object.
 void setDestinationName(ParameterCtx destinationName)
          Sets the name for the created object.
 void setSource(ParameterCtx source)
          Sets the create object's source object or class.
 void setWhen(ParameterCtx when)
          Sets when the create object action is to take place (start or end).
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.PrimitiveActivityCtx
addResource, getDuration, getElapsedTime, getMaxDuration, getMinDuration, getRandom, getResourceCount, getResources, removeResource, setDuration, setElapsedTime, setMaxDuration, setMinDuration, setRandom
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.ActivityCtx
getCompletionCause, getDisplayText, getParentFrame, getPerformedBy, getPriority, getReferencedBy, getState, getStatus, setCompletionCause, setDisplayText, setParentFrame, setPerformedBy, setPriority, setReferencedBy, setState, setState, setStatus, toString
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setContextFor, setEndTime, setID, setStartTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.nasa.arc.brahms.common.rt.IPrimitiveActivityCtx
addResource, getDuration, getElapsedTime, getMaxDuration, getMinDuration, getRandom, getResourceCount, getResources, removeResource, setElapsedTime
 
Methods inherited from interface gov.nasa.arc.brahms.common.rt.IActivityCtx
getCompletionCause, getDisplayText, getParentFrame, getPerformedBy, getPriority, getReferencedBy, getStatus, setCompletionCause, setDisplayText, setParentFrame, setPerformedBy, setReferencedBy, setStatus
 
Methods inherited from interface gov.nasa.arc.brahms.common.rt.IBrahmsObjectCtx
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setEndTime, setID, setStartTime
 

Constructor Detail

CreateObjectActivityCtx

public CreateObjectActivityCtx(CreateObjectActivity act)
Constructor, creates a new context for the specified CreateObjectActivity.

Parameters:
act - the CreateObjectActivity for which to create a context
Method Detail

setAction

public void setAction(ParameterCtx action)
               throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the create object's action (NEW or COPY). The action is specified through a parameter context containing either the actual value (int) or a reference to a variable containing the value.

Parameters:
action - the ParameterCtx containing the action
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null action is specified

getAction

public ParameterCtx getAction()
                       throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the create object's action (NEW or COPY). The action is specified through a parameter context containing either the actual value (int) or a reference to a variable containing the value.

Specified by:
getAction in interface ICreateObjectActivityCtx
Returns:
ParameterCtx the action
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no action is specified

setWhen

public void setWhen(ParameterCtx when)
             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets when the create object action is to take place (start or end). The when value is set through a parameter context containing either the actual value (int) or a reference to a variable containing the when value.

Parameters:
when - the ParameterCtx defining the when the create object action is to occur
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null when value is defined

getWhen

public ParameterCtx getWhen()
                     throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns when the create object action is to take place (start or end). The when value is set through a parameter context containing either the actual value (int) or a reference to a variable containing the when value.

Specified by:
getWhen in interface ICreateObjectActivityCtx
Returns:
ParameterCtx the when value defining when the create object action is to occur
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if the when value is not defined

setSource

public void setSource(ParameterCtx source)
               throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the create object's source object or class. The source is specified through a parameter context containing either the actual value (ConceptCtx) or a reference to a variable containing the value.

Parameters:
source - the ParameterCtx containing the source
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null source is specified

getSource

public ParameterCtx getSource()
                       throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the create object's source object or class. The source is specified through a parameter context containing either the actual value (ConceptCtx) or a reference to a variable containing the value.

Specified by:
getSource in interface ICreateObjectActivityCtx
Returns:
ParameterCtx the source
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no source is specified

setDestination

public void setDestination(ParameterCtx destination)
                    throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the create object's destination object or class. The destination is specified through a parameter context containing either the actual value (ConceptCtx) or a reference to a variable containing the value.

Parameters:
destination - the ParameterCtx containing the destination
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null destination is specified

getDestination

public ParameterCtx getDestination()
                            throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the create object's destination object or class. The destination is specified through a parameter context containing either the actual value (ConceptCtx) or a reference to a variable containing the value.

Specified by:
getDestination in interface ICreateObjectActivityCtx
Returns:
ParameterCtx the destination
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no destination is specified

setDestinationName

public void setDestinationName(ParameterCtx destinationName)
                        throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the name for the created object. The destination name is specified through a parameter context containing either the actual value (String) or a reference to a variable containing the value.

Parameters:
destinationName - the ParameterCtx containing the destination name
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null destination name is specified

getDestinationName

public ParameterCtx getDestinationName()
                                throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the name for the created object. The destination name is specified through a parameter context containing either the actual value (String) or a reference to a variable containing the value.

Specified by:
getDestinationName in interface ICreateObjectActivityCtx
Returns:
ParameterCtx the destination name
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no destination name is specified

setDestinationLocation

public void setDestinationLocation(ParameterCtx destinationLocation)
                            throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Sets the location for the created object. The destination location is specified a parameter context containing either the actual value (AreaCtx) or a reference to a variable containing the value.

Parameters:
destinationLocation - the ParameterCtx containing the destination location
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if a null destination location is specified

getDestinationLocation

public ParameterCtx getDestinationLocation()
                                    throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the location for the created object. The destination location is specified through a parameter context containing either the actual value (AreaCtx) or a reference to a variable containing the value.

Specified by:
getDestinationLocation in interface ICreateObjectActivityCtx
Returns:
ParameterCtx the destination location
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no destination location is specified

addDestinationAggregate

public void addDestinationAggregate(ParameterCtx aggregate)
                             throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified aggregate (ParameterCtx) as an aggregate for the created object. The aggregate is specified through a parameter context containing either the actual value (ConceptualInstanceCtx) or a reference to a variable containing the value.

Parameters:
aggregate - the aggregate (ParameterCtx) to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if aggregate is null

removeDestinationAggregate

public void removeDestinationAggregate(PartCtx aggregate)
                                throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified aggregate (ParameterCtx) as an aggregate for the created object. The aggregate is specified through a parameter context containing either the actual value (ConceptualInstanceCtx) or a reference to a variable containing the value.

Parameters:
aggregate - the aggregate to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if aggregate is null, no aggregates are available, or the aggregate is not found

getDestinationAggregates

public java.util.Enumeration getDestinationAggregates()
                                               throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the destination aggregates (ParameterCtx).

Specified by:
getDestinationAggregates in interface ICreateObjectActivityCtx
Returns:
Enumeration an enumeration of ParameterCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no aggregates

addBoundVariable

public void addBoundVariable(VariableCtx var)
                      throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Adds the specified variable as a variable bound by this activity.

Specified by:
addBoundVariable in interface ICreateObjectActivityCtx
Parameters:
var - the variable (VariableCtx) to be added
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if var is null

removeBoundVariable

public void removeBoundVariable(VariableCtx var)
                         throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Removes the specified variable as a variable bound by this activity.

Specified by:
removeBoundVariable in interface ICreateObjectActivityCtx
Parameters:
var - the variable (VariableCtx) to be removed
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if variable is null, no variables are present, or the variable is not found

getBoundVariables

public java.util.Enumeration getBoundVariables()
                                        throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns a list of all the variables used by this activity.

Specified by:
getBoundVariables in interface ICreateObjectActivityCtx
Returns:
Enumeration an enumeration of VariableCtx
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if there are no variables


Copyright © 1997-2012 All Rights Reserved.