gov.nasa.arc.brahms.vm.rt
Class VMDeleteCtx

java.lang.Object
  extended by gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx
      extended by gov.nasa.arc.brahms.common.rt.DeleteCtx
          extended by gov.nasa.arc.brahms.vm.rt.VMDeleteCtx
All Implemented Interfaces:
IBrahmsObjectCtx, IDeleteCtx, IRuntimeConstants, gov.nasa.arc.brahms.vm.events.IDiscreteEventData, gov.nasa.arc.brahms.vm.events.IDiscreteEventHandler, java.io.Serializable

public class VMDeleteCtx
extends DeleteCtx
implements gov.nasa.arc.brahms.vm.events.IDiscreteEventData, gov.nasa.arc.brahms.vm.events.IDiscreteEventHandler

The VMDeleteCtx is a DeleteCtx with specializations for use in the virtual machine. A DeleteCtx is the context for an executed delete operation. It defines the delete operation that was executed, what frame executed the operation and defines what element(s) was/were marked for deletion.

Version:
$Revision: 1.2 $ $Date: 2009/11/24 00:01:57 $ $Author: rnado $
Author:
Ron van Hoof
See Also:
DeleteCtx, 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
VMDeleteCtx(Delete delete)
          Constructor, creates a new delete context for the specified delete operation.
 
Method Summary
 java.util.List<java.lang.Object> getDeletedElements()
          Returns the elements that are to be deleted.
 boolean handleDiscreteEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
          Process the specified discrete event.
 boolean handleDiscreteEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt, gov.nasa.arc.brahms.vm.events.IDiscreteEventHandlerFactory ehf)
          Handles the specified discrete event by selecting the appropriate event handler from the specified event handler factory.
protected  void onExecute(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
          Executes the delete operation
 
Methods inherited from class gov.nasa.arc.brahms.common.rt.DeleteCtx
addDeletedElement, getParent, getUsedVariable, hasDeletedElements, removeDeletedElement, setParent, setUsedVariable, 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.IBrahmsObjectCtx
addNote, getContextFor, getEndTime, getID, getNote, getNotes, getStartTime, removeNote, setEndTime, setID, setStartTime
 

Constructor Detail

VMDeleteCtx

public VMDeleteCtx(Delete delete)
Constructor, creates a new delete context for the specified delete operation.

Parameters:
delete - the delete operation for which this context is the context
Method Detail

getDeletedElements

public java.util.List<java.lang.Object> getDeletedElements()
                                                    throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
Returns the elements that are to be deleted.

Specified by:
getDeletedElements in interface IDeleteCtx
Overrides:
getDeletedElements in class DeleteCtx
Returns:
List the list of elements to be deleted
Throws:
gov.nasa.arc.brahms.common.exceptions.BrahmsException - if no elements are specified

handleDiscreteEvent

public boolean handleDiscreteEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt,
                                   gov.nasa.arc.brahms.vm.events.IDiscreteEventHandlerFactory ehf)
Handles the specified discrete event by selecting the appropriate event handler from the specified event handler factory. The specified event contains as its data the object implementing this interface. The following should be the case: evt.getData() == this

Specified by:
handleDiscreteEvent in interface gov.nasa.arc.brahms.vm.events.IDiscreteEventData
Parameters:
evt - the DiscreteEvent to be handled
ehf - the EventHandlerFactory containing handlers from which this DiscreteEventData selects the appropriate handler
Returns:
boolean true if the event could be processed, false if not

handleDiscreteEvent

public boolean handleDiscreteEvent(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Process the specified discrete event.

Specified by:
handleDiscreteEvent in interface gov.nasa.arc.brahms.vm.events.IDiscreteEventHandler
Parameters:
evt - the DiscreteEvent to be processed.
Returns:
boolean true if the event could be processed, false if not

onExecute

protected void onExecute(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Executes the delete operation

Parameters:
evt - the DiscreteEvent that initiated the delete operation


Copyright © 1997-2012 All Rights Reserved.