object
Class ObjectLookup

java.lang.Object
  extended by object.ObjectLookup

public class ObjectLookup
extends java.lang.Object

This gives an interface on to the local and remote object databases. The database is divided in to locally registered PublicObject and locally discovered RemoteObject instances. Individual PublicVariable instances hold back-references to an ObjectLookup which provides them access to methods implementing attribute updates invoked on the RTI. The ObjectLookup for a federate also coordinates the ownership management for doing conflict resolution.

Author:
Rob Minson

Constructor Summary
ObjectLookup(ClassLookup lookup, Logger logger)
          Creates an ObjectLookup with a ClassLookup configured for this federation.
 
Method Summary
 boolean checkOwnership(PublicVariable var)
           
 void cleanPublicObjects()
           
 void discoverRemoteObject(int instanceHandle, int classHandle)
           
 ProxyList getProxyList(java.lang.Class globalClass, java.lang.Class localClass)
          Obtains a list of proxies of objects registered by other federates
 void internalUpdate(PublicVariable var)
           
 void localDelete(PublicObject obj)
           
 void loggingOn(boolean on)
           
 void notifyOwnership(int objectHandle, hla.rti13.java1.AttributeHandleSet handles)
           
 void notifyOwnershipFailure(int objectHandle, hla.rti13.java1.AttributeHandleSet handles)
           
 void refreshObject(int handle)
           
 void registerPublicObject(PublicObject obj)
           
 void removeInstance(int objectHandle)
           
 void requestOwnership(PublicVariable var)
           
 void resetOwnership()
           
 void resolveUpdate(int objectHandle, ReflectedAttributes13 attrs, double time)
           
 void returnOwnership(PublicVariable var)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectLookup

public ObjectLookup(ClassLookup lookup,
                    Logger logger)
             throws hla.rti13.java1.RTIexception
Creates an ObjectLookup with a ClassLookup configured for this federation.

Parameters:
lookup - the ClassLookup correctly initialised with handle information for this federation.
logger -
Throws:
hla.rti13.java1.RTIexception
Method Detail

registerPublicObject

public void registerPublicObject(PublicObject obj)
                          throws hla.rti13.java1.RTIexception,
                                 java.io.IOException
Throws:
hla.rti13.java1.RTIexception
java.io.IOException

discoverRemoteObject

public void discoverRemoteObject(int instanceHandle,
                                 int classHandle)
                          throws java.io.IOException,
                                 hla.rti13.java1.RTIinternalError,
                                 hla.rti13.java1.FederateInternalError
Throws:
java.io.IOException
hla.rti13.java1.RTIinternalError
hla.rti13.java1.FederateInternalError

getProxyList

public ProxyList getProxyList(java.lang.Class globalClass,
                              java.lang.Class localClass)
                       throws hla.rti13.java1.FederateInternalError,
                              hla.rti13.java1.RTIinternalError,
                              java.lang.InstantiationException,
                              java.lang.IllegalAccessException
Obtains a list of proxies of objects registered by other federates

Parameters:
globalClass - The Class that the LocalManager for this federate was configured with.
localClass - The Class of objects that we would like the ReflectedList to be populated with. This does not have to be the same as the globalClass argument, but in most cases it will be. sometimes it might be useful to create a subclass that behaves slightly differently but usually not.
Returns:
a ProxyList of RemoteObject instances whose population will dynamically change as objects of the given class are added and removed from this federation.
Throws:
BadClassException
java.io.IOException
hla.rti13.java1.FederateInternalError
hla.rti13.java1.RTIinternalError
java.lang.InstantiationException
java.lang.IllegalAccessException
See Also:
ReflectedList, RemoteObject

resolveUpdate

public void resolveUpdate(int objectHandle,
                          ReflectedAttributes13 attrs,
                          double time)
                   throws ObjectNotFoundException,
                          ObjectDeletedException,
                          java.io.IOException,
                          hla.rti13.java1.RTIinternalError,
                          hla.rti13.java1.FederateInternalError
Throws:
ObjectNotFoundException
ObjectDeletedException
java.io.IOException
hla.rti13.java1.RTIinternalError
hla.rti13.java1.FederateInternalError

internalUpdate

public void internalUpdate(PublicVariable var)
                    throws java.lang.IllegalStateException,
                           hla.rti13.java1.RTIexception,
                           java.io.IOException
Throws:
java.lang.IllegalStateException
hla.rti13.java1.RTIexception
java.io.IOException

loggingOn

public void loggingOn(boolean on)

cleanPublicObjects

public void cleanPublicObjects()
                        throws hla.rti13.java1.RTIexception
Throws:
hla.rti13.java1.RTIexception

localDelete

public void localDelete(PublicObject obj)
                 throws hla.rti13.java1.RTIexception,
                        ObjectNotFoundException
Throws:
hla.rti13.java1.RTIexception
ObjectNotFoundException

removeInstance

public void removeInstance(int objectHandle)

refreshObject

public void refreshObject(int handle)
                   throws hla.rti13.java1.RTIexception,
                          java.io.IOException,
                          ObjectDeletedException,
                          ObjectNotFoundException
Throws:
hla.rti13.java1.RTIexception
java.io.IOException
ObjectDeletedException
ObjectNotFoundException

checkOwnership

public boolean checkOwnership(PublicVariable var)
                       throws VariableException
Throws:
VariableException

requestOwnership

public void requestOwnership(PublicVariable var)
                      throws hla.rti13.java1.RTIexception
Throws:
hla.rti13.java1.RTIexception

returnOwnership

public void returnOwnership(PublicVariable var)
                     throws hla.rti13.java1.RTIexception
Throws:
hla.rti13.java1.RTIexception

resetOwnership

public void resetOwnership()
                    throws hla.rti13.java1.RTIexception
Throws:
hla.rti13.java1.RTIexception

notifyOwnership

public void notifyOwnership(int objectHandle,
                            hla.rti13.java1.AttributeHandleSet handles)
                     throws ObjectNotFoundException,
                            ObjectDeletedException
Throws:
ObjectNotFoundException
ObjectDeletedException

notifyOwnershipFailure

public void notifyOwnershipFailure(int objectHandle,
                                   hla.rti13.java1.AttributeHandleSet handles)
                            throws ObjectNotFoundException,
                                   ObjectDeletedException
Throws:
ObjectNotFoundException
ObjectDeletedException