|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gov.nasa.arc.brahms.common.rt.BrahmsObjectCtx gov.nasa.arc.brahms.common.rt.ConceptCtx gov.nasa.arc.brahms.common.rt.ConceptualInstanceCtx gov.nasa.arc.brahms.vm.rt.VMConceptualInstanceCtx
public class VMConceptualInstanceCtx
The VMConceptualInstanceCtx is the runtime representation of conceptual instances defined in a Brahms model with extensions for use in the virtual machine. The conceptual instance context manages the creation and deletion time of the conceptual instances. The conceptual instance context also manages the list of sub aggregates or parts of the conceptual instance and the parent aggregates of the conceptual instance.
ConceptualInstanceCtx
,
Serialized FormField 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 | |
---|---|
VMConceptualInstanceCtx(ConceptualInstance ci)
Constructor, creates a new context for the specified conceptual instance. |
Method Summary | |
---|---|
void |
addDeletedListener(gov.nasa.arc.brahms.vm.memory.IDeletedListener listener)
Registers the specified listener to be notified when this element was deleted. |
void |
addEventReference(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Adds the specified DiscreteEvent as an event in which this element is referenced. |
void |
addFrameBindingReference(ActiveInstance refHolder,
gov.nasa.arc.brahms.vm.engine.rsn.RSNFrameNode frame,
gov.nasa.arc.brahms.vm.engine.rsn.RSNFrameNode.FrameBinding binding)
Adds the specified FrameBinding as a binding in which this element was used in a variable in the completed execution of the frame defined by the RSNFrameNode executed by the specified ActiveInstance. |
gov.nasa.arc.brahms.vm.memory.HardReference |
addHardReference(ActiveInstance refHolder,
long time)
Adds the specified refHolder as an ActiveInstance holding a hard reference to this concept. |
gov.nasa.arc.brahms.vm.memory.SoftReference |
addSoftReference(ActiveInstance refHolder,
long time)
Adds the specified refHolder as an ActiveInstance holding a soft reference to this concept. |
void |
addStatementReference(ActiveInstance refHolder,
VMStatementCtx statement,
long time)
Adds the specified VMStatementCtx as a statement in which this element is referenced, either on the left or right hand side asserted by the specified ActiveInstance. |
PartCtx |
createAggregateRelation(ConceptualInstance oCO,
long time,
gov.nasa.arc.brahms.vm.controller.VMController vmc)
Creates the aggregate relationship between this conceptual instance and the specified conceptual instance where the specified conceptual instance is a sub aggregate of this conceptual instance. |
PartCtx |
createAggregateRelation(ObjectInstance oObject,
long time,
gov.nasa.arc.brahms.vm.controller.VMController vmc)
Creates the aggregate relationship between this conceptual instance and the specified object instance where the specified object instance is a part of this conceptual instance. |
void |
finalizeDelete(long time)
Finalizes the deletes of this element from memory, cleaning up any internal structures kept for this element and marking the element as deleted. |
protected Relation |
getConceptualObjectOfRelation()
Returns the relation used to specify the aggregate relations between conceptual objects and other conceptual objects or object instances in facts and beliefs. |
ModelElement |
getElement()
Returns the model element for which its memory is being managed. |
java.util.List<gov.nasa.arc.brahms.vm.memory.SoftReference> |
getSoftReferences()
Returns a list of all the actors holding a soft reference to this element. |
boolean |
hasEventReferences()
Indicates whether any events hold references to this element. |
boolean |
hasSoftReferences()
Indicates whether there are any actors that hold a soft reference to this element. |
void |
initialize(gov.nasa.arc.brahms.vm.controller.VMController vmc,
long time)
Initializes the concept for use in a virtual machine controller by the specified virtual machine controller. |
void |
initiateDelete(long time)
Initiates the deletion of this element from memory causing the element to be marked as in the process of being deleted and causing the retraction of the facts referencing the element. |
boolean |
isDeleted()
Indicates whether the element was deleted. |
boolean |
isDeleteInitiated()
Indicates whether the process to start the deletion of the element was started. |
boolean |
isMarkedForGC()
Indicates whether the element is marked for garbage collection. |
void |
removeEventReference(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
Removes the specified DiscreteEvent as an event in which this element is referenced. |
void |
removeFrameBindingReference(ActiveInstance refHolder,
gov.nasa.arc.brahms.vm.engine.rsn.RSNFrameNode frame,
gov.nasa.arc.brahms.vm.engine.rsn.RSNFrameNode.FrameBinding binding)
Removes the specified FrameBinding as a binding in which this element was used in a variable in the completed execution of the frame defined by the RSNFrameNode executed by the specified ActiveInstance. |
void |
removeHardReference(ActiveInstance refHolder,
long time)
Removes the specified refHolder as an ActiveInstance holding a hard reference to this concept. |
void |
removeSoftReference(ActiveInstance refHolder,
long time)
Removes the specified refHolder as an ActiveInstance holding a soft reference to this concept. |
void |
removeStatementReference(ActiveInstance refHolder,
VMStatementCtx statement,
long time)
Removes the specified VMStatementCtx as a statement in which the element is referenced, either on the left or right hand side retracted by the specified ActiveInstance. |
void |
reset()
Resets this context, removing any references to other contexts |
void |
setMarkedForGC(boolean marked)
Sets whether the element is marked for garbage collection. |
Methods inherited from class gov.nasa.arc.brahms.common.rt.ConceptualInstanceCtx |
---|
addAggregate, addSubAggregate, getAggregates, getSubAggregates, removeAggregate, removeAllAggregates, removeAllSubAggregates, removeSubAggregate |
Methods inherited from class gov.nasa.arc.brahms.common.rt.ConceptCtx |
---|
addAttribute, addRelation, getAttribute, getRelation, initAttributeRelationCache, removeAttribute, removeRelation, resetAttributeRelationCache, 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 |
---|
public VMConceptualInstanceCtx(ConceptualInstance ci)
ci
- the ConceptualInstance for which to create a contextMethod Detail |
---|
public void initialize(gov.nasa.arc.brahms.vm.controller.VMController vmc, long time) throws VMException
initialize
in interface IRuntimeConceptCtx
vmc
- the VMController controlling the virtual machine in which this
concept is to be used.time
- the time at which the initialization is performed
VMException
- if an error occurs in initializing the conceptpublic ModelElement getElement() throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
getElement
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
gov.nasa.arc.brahms.common.exceptions.BrahmsException
- if there is an error obtaining the elementpublic gov.nasa.arc.brahms.vm.memory.HardReference addHardReference(ActiveInstance refHolder, long time)
addHardReference
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
refHolder
- the ActiveInstance holding a reference to this concepttime
- the event time at which the reference is added
public void removeHardReference(ActiveInstance refHolder, long time)
If the specified refHolder is not listed as a concept holding a reference to this concept then this method is a no-op.
removeHardReference
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
refHolder
- the ActiveInstance that no longer holds any
references to this concepttime
- the event time at which the reference is removedpublic gov.nasa.arc.brahms.vm.memory.SoftReference addSoftReference(ActiveInstance refHolder, long time)
addSoftReference
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
refHolder
- the ActiveInstance holding a reference to this
concepttime
- the event time at which the reference is added
public void removeSoftReference(ActiveInstance refHolder, long time)
If the specified refHolder is not listed as a concept holding a reference to this concept then this method is a no-op.
removeSoftReference
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
refHolder
- the ActiveInstance that no longers holds any
references to this concepttime
- the event time at which the reference is removedpublic boolean hasSoftReferences()
hasSoftReferences
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
public java.util.List<gov.nasa.arc.brahms.vm.memory.SoftReference> getSoftReferences()
getSoftReferences
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
public void addEventReference(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
addEventReference
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
evt
- the DiscreteEvent in which the element is referencedpublic void removeEventReference(gov.nasa.arc.brahms.vm.events.DiscreteEvent evt)
removeEventReference
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
evt
- the DiscreteEvent in which the element is referencedpublic boolean hasEventReferences()
hasEventReferences
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
public void addStatementReference(ActiveInstance refHolder, VMStatementCtx statement, long time)
addStatementReference
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
refHolder
- the ActiveInstance that asserted the statement
referencing this elementstatement
- the VMStatementCtx to be addedtime
- the time at which the statement reference is addedpublic void removeStatementReference(ActiveInstance refHolder, VMStatementCtx statement, long time)
removeStatementReference
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
refHolder
- the ActiveInstance that retracted the statement
referencing this elementstatement
- the VMStatementCtx to be removedtime
- the time at which the statement reference is removedpublic void addFrameBindingReference(ActiveInstance refHolder, gov.nasa.arc.brahms.vm.engine.rsn.RSNFrameNode frame, gov.nasa.arc.brahms.vm.engine.rsn.RSNFrameNode.FrameBinding binding)
addFrameBindingReference
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
refHolder
- the ActiveInstance that executed the frameframe
- the RSNFrameNode in which the used binding is maintainedbinding
- the FrameBinding in which the element is referencedpublic void removeFrameBindingReference(ActiveInstance refHolder, gov.nasa.arc.brahms.vm.engine.rsn.RSNFrameNode frame, gov.nasa.arc.brahms.vm.engine.rsn.RSNFrameNode.FrameBinding binding)
removeFrameBindingReference
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
refHolder
- the ActiveInstance that executed the frameframe
- the RSNFrameNode in which the used binding is maintainedbinding
- the FrameBinding in which the element is referencedpublic void setMarkedForGC(boolean marked)
setMarkedForGC
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
marked
- true if marked, false if notpublic boolean isMarkedForGC()
isMarkedForGC
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
public void initiateDelete(long time)
initiateDelete
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
time
- the event time at which the element's deletion
is initiatedpublic boolean isDeleteInitiated()
isDeleteInitiated
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
public void finalizeDelete(long time)
finalizeDelete
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
time
- the event time at which the element's deletion is
finalizedpublic void addDeletedListener(gov.nasa.arc.brahms.vm.memory.IDeletedListener listener)
addDeletedListener
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
listener
- the IDeletedListener to be addedpublic boolean isDeleted()
isDeleted
in interface gov.nasa.arc.brahms.vm.memory.IMemoryManagedElement
public PartCtx createAggregateRelation(ConceptualInstance oCO, long time, gov.nasa.arc.brahms.vm.controller.VMController vmc) throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
oCO
- the sub aggregate conceptual instancetime
- the time at which the relationship is createdvmc
- the virtual machine controller
gov.nasa.arc.brahms.common.exceptions.BrahmsException
- if an internal error occurs.public PartCtx createAggregateRelation(ObjectInstance oObject, long time, gov.nasa.arc.brahms.vm.controller.VMController vmc) throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
oObject
- the part to be added to this conceptual instancetime
- the time at which the relationship is createdvmc
- the virtual machine controller
gov.nasa.arc.brahms.common.exceptions.BrahmsException
- if an internal error occurs.protected Relation getConceptualObjectOfRelation() throws gov.nasa.arc.brahms.common.exceptions.BrahmsException
gov.nasa.arc.brahms.common.exceptions.BrahmsException
public void reset() throws VMException
reset
in interface IRuntimeConceptCtx
VMException
- if in error occurs in resetting the concept
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |