object
Class PublicObject
java.lang.Object
object.PublicObject
- Direct Known Subclasses:
- BasicTestObject
public abstract class PublicObject
- extends java.lang.Object
PublicObject is the primary class which should be subclassed
to represent globally shared objects in an HLA_RePast simulation.
All subclassing implementations of this class should ensure
the two abstract methods behave in the obvious (map-like) way. This
allows the instantiation and synchronisation of local and remote
objects with fairly low overhead and fairly high transparency.
PublicObject instances can be registered with the LocalManager,
this will lead to them being reflected by all other federates
throughout the federation as RemoteObject
proxy instances.
Locally registered PublicObjects are deleted from the federation
(leading to the deletion of corresponding proxies) in two situations:
delete()
or
LocalManager.deletePublicObject(PublicObject)
is called
- Lazy deletion is being used (see
LocalManager.setLazyDeletion(boolean)
) and the object is
garbage collected by the local JVM
An HLA_RePast model can use one of the two approaches or a mixture
depending on whatever fits best in to the structure of the code.
Always ensure previously delete()
ed objects are not
updated, refreshed, etc.
- Author:
- Rob Minson
- See Also:
RemoteObject
,
LocalManager.registerPublicObject(PublicObject)
,
LocalManager.deletePublicObject(PublicObject)
,
LocalManager.setLazyDeletion(boolean)
,
PublicVariable
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PublicObject
public PublicObject()
getPublicVariables
public abstract java.lang.String[] getPublicVariables()
getVariable
public abstract PublicVariable getVariable(java.lang.String varName)
delete
public void delete()
throws hla.rti13.java1.RTIexception,
ObjectNotFoundException
- Throws:
hla.rti13.java1.RTIexception
ObjectNotFoundException
refresh
public void refresh()
throws java.io.IOException,
hla.rti13.java1.RTIexception
- Throws:
java.io.IOException
hla.rti13.java1.RTIexception