|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object gov.nasa.arc.brahms.vm.rt.VMJavaObjectCtx
public class VMJavaObjectCtx
VMJavaObjectCtx is a Virtual Machine context object used for memory management of Java objects that are the subject of Brahms facts and beliefs.
Constructor Summary | |
---|---|
VMJavaObjectCtx(java.lang.Object object)
Constructor, creates a new context for the specified Java object. |
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. |
static VMJavaObjectCtx |
createContext(java.lang.Object object)
Retrieve the VMJavaObjectCtx context for a given Java object or create a new one if it doesn't already exist. |
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. |
static VMJavaObjectCtx |
getContext(java.lang.Object object)
Retrieve the VMJavaObjectCtx context for a given Java object |
java.lang.Object |
getElement()
Returns the object for which 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 |
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. |
static void |
removeContext(java.lang.Object object)
Removes the context, if any, associated with a given Java object |
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 |
setMarkedForGC(boolean marked)
Sets whether the element is marked for garbage collection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VMJavaObjectCtx(java.lang.Object object)
object
- the Java object for which a context is to be createdMethod Detail |
---|
public static VMJavaObjectCtx createContext(java.lang.Object object)
object
- the Java object whose context is to be retrieved or created
public static VMJavaObjectCtx getContext(java.lang.Object object)
object
- the Java object whose context is to be retrieved
public static void removeContext(java.lang.Object object)
object
- the Java object whose context object is to be removedpublic java.lang.Object 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 objectpublic 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |