|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eodisp.wrapper.hla.ProxyAmbassador
public abstract class ProxyAmbassador
Provides a facade (Facade Pattern) to the HLA interfaces
RTIambassador and FederateAmbassador. The HLA interfaces can
still be accessed directly if needed (See
getFederateAmbassadorDelegator()).
| Nested Class Summary | |
|---|---|
(package private) class |
ProxyAmbassador.SyncPointRegistrationState
|
| Field Summary | |
|---|---|
protected hla.rti1516.RTIambassador |
rtiAmbassador
The run-time infrastructure ambassador. |
| Constructor Summary | |
|---|---|
ProxyAmbassador(hla.rti1516.RTIambassador rtiAmbassador)
Constructor. |
|
| Method Summary | |
|---|---|
void |
achieveSyncPointAndAwaitFederationSynchronization(java.lang.String syncPointLabel,
long timeout,
java.util.concurrent.TimeUnit unit)
Waits until the synchronization point is announced . |
void |
addObjectClassDiscoveryListener(ObjectClassDiscoveryListener objectClassDiscoveryListener)
Adds an element to the list of objects interested in discovered object instances |
boolean |
awaitSynchronizationPointAnnouncement(java.lang.String syncPointLabel,
long timeout,
java.util.concurrent.TimeUnit unit)
|
void |
defaultPublishSubscribe()
Makes all subscriptions and publications of object classes and interaction classes as defined in the SOM. |
FederateAmbassadorDelegator |
getFederateAmbassadorDelegator()
Returns the federate ambassador delegator that is used when joining a federation execution. |
hla.rti1516.FederateHandle |
getFederatHandle()
Returns the federate handle of this federate or null if
this federate has not joined a federation execution. |
java.util.Collection<ObjectClassInstance> |
getObjectClassInstances()
Returns an immutable collection containing the object class instances managed by this proxy ambassador. |
ObjectClassInstance |
getObjectInstance(hla.rti1516.ObjectInstanceHandle objectInstanceHandle)
Returns the managed object class instance with the specified handle. |
hla.rti1516.RTIambassador |
getRtiAmbassador()
|
protected abstract void |
initAfterJoin()
This method is called from the joinFederationExecution(String, String, MobileFederateServices)
method just after the federate has been joined. |
hla.rti1516.FederateHandle |
joinFederationExecution(java.lang.String federateType,
java.lang.String federationExecutionName,
hla.rti1516.MobileFederateServices serviceReferences)
Joins the given federation execution and calls initAfterJoin()
immediately after. |
hla.rti1516.FederateHandle |
joinFederationExecution(java.lang.String federateType,
java.lang.String federationExecutionName,
hla.rti1516.MobileFederateServices serviceReferences,
long timeout,
java.util.concurrent.TimeUnit unit)
Convenience method to join a federation execution. |
protected void |
notifyReceiveInteraction(hla.rti1516.InteractionClassHandle interactionClass,
hla.rti1516.ParameterHandleValueMap theParameters,
byte[] userSuppliedTag,
hla.rti1516.OrderType sentOrdering,
hla.rti1516.TransportationType theTransport)
|
abstract void |
publishInteractionClasses()
Publishes all supported interaction classes. |
abstract void |
publishObjectClassAttributes()
Publishes all supported object class attributes. |
void |
registerObjectClassInstance(hla.rti1516.ObjectInstanceHandle objectInstanceHandle,
ObjectClassInstance objectClassInstance)
|
void |
registerSynchronizationPoint(java.lang.String syncPointLabel,
byte[] userSuppliedTag,
hla.rti1516.FederateHandleSet synchronizationSet,
long timeout,
java.util.concurrent.TimeUnit unit)
Registers a synchronization point and returns if the registration was successful or not. |
void |
registerSynchronizationPoint(java.lang.String syncPointLabel,
byte[] userSuppliedTag,
long timeout,
java.util.concurrent.TimeUnit unit)
Registers a synchronization point and returns if the registration was successful or not. |
void |
removeObjectClassDiscoveryListener(ObjectClassDiscoveryListener objectClassDiscoveryListener)
Removes an element from the list of objects interested in discovered object instances |
void |
setDiscoveredObjectClassInstanceFactory(DiscoveredObjectClassInstanceFactory discoveredObjectClassInstanceFactory)
|
abstract void |
subscribeInteractionClasses()
Subscribes to all supported interaction classes. |
abstract void |
subscribeObjectClassAttributes()
Subscribe to all supported object class attributes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final hla.rti1516.RTIambassador rtiAmbassador
| Constructor Detail |
|---|
public ProxyAmbassador(hla.rti1516.RTIambassador rtiAmbassador)
pRTIAmbassador - the run-time infrastructure ambassadordiscoveredObjectClassInstanceFactory - The factory that creates the appropriate java instances for
each object class instance discovered.| Method Detail |
|---|
protected void notifyReceiveInteraction(hla.rti1516.InteractionClassHandle interactionClass,
hla.rti1516.ParameterHandleValueMap theParameters,
byte[] userSuppliedTag,
hla.rti1516.OrderType sentOrdering,
hla.rti1516.TransportationType theTransport)
throws hla.rti1516.InteractionClassNotRecognized,
hla.rti1516.InteractionParameterNotRecognized,
hla.rti1516.InteractionClassNotSubscribed,
hla.rti1516.FederateInternalError
hla.rti1516.InteractionClassNotRecognized
hla.rti1516.InteractionParameterNotRecognized
hla.rti1516.InteractionClassNotSubscribed
hla.rti1516.FederateInternalErrorpublic void setDiscoveredObjectClassInstanceFactory(DiscoveredObjectClassInstanceFactory discoveredObjectClassInstanceFactory)
public FederateAmbassadorDelegator getFederateAmbassadorDelegator()
FederateAmbassador instance to
the returned delegator with
FederateAmbassadorDelegator.registerDelegate(FederateAmbassador).
This can be done at any time. If you want to receive all callbacks, add
the delegate before you call
joinFederationExecution(String, String, MobileFederateServices).
public void addObjectClassDiscoveryListener(ObjectClassDiscoveryListener objectClassDiscoveryListener)
objectClassDiscoveryListener - the listener to addpublic void removeObjectClassDiscoveryListener(ObjectClassDiscoveryListener objectClassDiscoveryListener)
objectClassDiscoveryListener - the listener to remove
public final hla.rti1516.FederateHandle joinFederationExecution(java.lang.String federateType,
java.lang.String federationExecutionName,
hla.rti1516.MobileFederateServices serviceReferences)
throws hla.rti1516.RTIexception,
hla.rti1516.FederateAlreadyExecutionMember,
hla.rti1516.FederationExecutionDoesNotExist,
hla.rti1516.SaveInProgress,
hla.rti1516.RestoreInProgress,
hla.rti1516.RTIinternalError
initAfterJoin()
immediately after. Makes sure that callbacks from the RTI are processed
only after the initAfterJoin() method has returned.
Callbacks that come in during the initAfterJoin() are
queued; The FederateAmbassadorDelegator.startProcessing() on the
internal federate ambassador delegator (that is returned by
getFederateAmbassadorDelegator()) is called just after the
initAfterJoin() has returned.
federateType - a string describing the federate's role in the federationfederationExecutionName - the name of the federation to joinserviceReferences - the federate's mobile services
hla.rti1516.FederateAlreadyExecutionMember - if the federate is already a member of an execution
hla.rti1516.FederationExecutionDoesNotExist - if the federation execution does not exist
hla.rti1516.SaveInProgress - if a save operation is in progress
hla.rti1516.RestoreInProgress - if a restore operation is in progress
hla.rti1516.RTIinternalError - if an internal error occurred in the run-time
infrastructure
exceptions - thrown by initAfterJoin()
hla.rti1516.RTIexception
public final hla.rti1516.FederateHandle joinFederationExecution(java.lang.String federateType,
java.lang.String federationExecutionName,
hla.rti1516.MobileFederateServices serviceReferences,
long timeout,
java.util.concurrent.TimeUnit unit)
throws hla.rti1516.RTIexception,
hla.rti1516.FederateAlreadyExecutionMember,
hla.rti1516.FederationExecutionDoesNotExist,
hla.rti1516.SaveInProgress,
hla.rti1516.RestoreInProgress,
hla.rti1516.RTIinternalError
federateType - federationExecutionName - serviceReferences - timeout - unit -
hla.rti1516.RTIexception
hla.rti1516.FederateAlreadyExecutionMember
hla.rti1516.FederationExecutionDoesNotExist
hla.rti1516.SaveInProgress
hla.rti1516.RestoreInProgress
hla.rti1516.RTIinternalErrorpublic hla.rti1516.FederateHandle getFederatHandle()
null if
this federate has not joined a federation execution.
protected abstract void initAfterJoin()
throws hla.rti1516.RTIexception
joinFederationExecution(String, String, MobileFederateServices)
method just after the federate has been joined. It is made sure that no
callbacks from the RTI will be processed before this method has returned.
Therefore, this method is the a suitable place to initialize HLA handles
that need to be known when callbacks from the RTI are processed.
hla.rti1516.RTIexception
public void defaultPublishSubscribe()
throws hla.rti1516.InvalidInteractionClassHandle,
hla.rti1516.NameNotFound,
hla.rti1516.InteractionClassNotDefined,
hla.rti1516.FederateNotExecutionMember,
hla.rti1516.SaveInProgress,
hla.rti1516.RestoreInProgress,
hla.rti1516.RTIinternalError,
hla.rti1516.FederateServiceInvocationsAreBeingReportedViaMOM,
hla.rti1516.InvalidObjectClassHandle,
hla.rti1516.ObjectClassNotDefined,
hla.rti1516.AttributeNotDefined
hla.rti1516.InvalidInteractionClassHandle
hla.rti1516.NameNotFound
hla.rti1516.InteractionClassNotDefined
hla.rti1516.FederateNotExecutionMember
hla.rti1516.SaveInProgress
hla.rti1516.RestoreInProgress
hla.rti1516.RTIinternalError
hla.rti1516.FederateServiceInvocationsAreBeingReportedViaMOM
hla.rti1516.InvalidObjectClassHandle
hla.rti1516.ObjectClassNotDefined
hla.rti1516.AttributeNotDefined
public abstract void publishInteractionClasses()
throws hla.rti1516.InvalidInteractionClassHandle,
hla.rti1516.NameNotFound,
hla.rti1516.InteractionClassNotDefined,
hla.rti1516.FederateNotExecutionMember,
hla.rti1516.SaveInProgress,
hla.rti1516.RestoreInProgress,
hla.rti1516.RTIinternalError
hla.rti1516.InvalidInteractionClassHandle - if an interaction class handle is invalid
hla.rti1516.NameNotFound - if a name is not found
hla.rti1516.InteractionClassNotDefined - if an interaction class is undefined
hla.rti1516.FederateNotExecutionMember - if the federate is not an execution member
hla.rti1516.SaveInProgress - if a save operation is in progress
hla.rti1516.RestoreInProgress - if a restore operation is in progress
hla.rti1516.RTIinternalError - if an internal error occurs in the run-time infrastructure
public abstract void subscribeInteractionClasses()
throws hla.rti1516.InvalidInteractionClassHandle,
hla.rti1516.NameNotFound,
hla.rti1516.InteractionClassNotDefined,
hla.rti1516.FederateNotExecutionMember,
hla.rti1516.SaveInProgress,
hla.rti1516.RestoreInProgress,
hla.rti1516.FederateServiceInvocationsAreBeingReportedViaMOM,
hla.rti1516.RTIinternalError
hla.rti1516.InvalidInteractionClassHandle - if an interaction class handle is invalid
hla.rti1516.NameNotFound - if a name is not found
hla.rti1516.InteractionClassNotDefined - if an interaction class is undefined
hla.rti1516.FederateNotExecutionMember - if the federate is not an execution member
hla.rti1516.SaveInProgress - if a save operation is in progress
hla.rti1516.RestoreInProgress - if a restore operation is in progress
hla.rti1516.FederateServiceInvocationsAreBeingReportedViaMOM - if service invocations are being reported via MOM
hla.rti1516.RTIinternalError - if an internal error occurs in the run-time infrastructure
public abstract void publishObjectClassAttributes()
throws hla.rti1516.InvalidObjectClassHandle,
hla.rti1516.NameNotFound,
hla.rti1516.ObjectClassNotDefined,
hla.rti1516.AttributeNotDefined,
hla.rti1516.FederateNotExecutionMember,
hla.rti1516.SaveInProgress,
hla.rti1516.RestoreInProgress,
hla.rti1516.RTIinternalError
hla.rti1516.InvalidObjectClassHandle - if an object class handle is invalid
hla.rti1516.NameNotFound - if a name is not found
hla.rti1516.ObjectClassNotDefined - if an object class is undefined
hla.rti1516.AttributeNotDefined - if an attribute is undefined
hla.rti1516.FederateNotExecutionMember - if the federate is not an execution member
hla.rti1516.SaveInProgress - if a save operation is in progress
hla.rti1516.RestoreInProgress - if a restore operation is in progress
hla.rti1516.RTIinternalError - if an internal error occurs in the run-time infrastructure
public abstract void subscribeObjectClassAttributes()
throws hla.rti1516.InvalidObjectClassHandle,
hla.rti1516.NameNotFound,
hla.rti1516.ObjectClassNotDefined,
hla.rti1516.AttributeNotDefined,
hla.rti1516.FederateNotExecutionMember,
hla.rti1516.SaveInProgress,
hla.rti1516.RestoreInProgress,
hla.rti1516.RTIinternalError
hla.rti1516.InvalidObjectClassHandle - if an object class handle is invalid
hla.rti1516.NameNotFound - if a name is not found
hla.rti1516.ObjectClassNotDefined - if an object class is undefined
hla.rti1516.AttributeNotDefined - if an attribute is undefined
hla.rti1516.FederateNotExecutionMember - if the federate is not an execution member
hla.rti1516.SaveInProgress - if a save operation is in progress
hla.rti1516.RestoreInProgress - if a restore operation is in progress
hla.rti1516.RTIinternalError - if an internal error occurs in the run-time infrastructure
public void registerObjectClassInstance(hla.rti1516.ObjectInstanceHandle objectInstanceHandle,
ObjectClassInstance objectClassInstance)
public ObjectClassInstance getObjectInstance(hla.rti1516.ObjectInstanceHandle objectInstanceHandle)
objectInstanceHandle - the object instance handle corresponding to the desired object
class instance
null if no such object instance existspublic java.util.Collection<ObjectClassInstance> getObjectClassInstances()
public void registerSynchronizationPoint(java.lang.String syncPointLabel,
byte[] userSuppliedTag,
long timeout,
java.util.concurrent.TimeUnit unit)
throws hla.rti1516.FederateNotExecutionMember,
hla.rti1516.SaveInProgress,
hla.rti1516.RestoreInProgress,
hla.rti1516.RTIinternalError,
java.lang.InterruptedException,
SynchronizationPointRegistrationException
interrupted, or the specified waiting time
elapses.
syncPointLabel - the label of synchronization point to be registered, as
defined in the SOM/FOM.userSuppliedTag - user supplied tagtimeout - the maximum time to waitunit - the time unit of the timeout argument.
hla.rti1516.FederateNotExecutionMember
hla.rti1516.SaveInProgress
hla.rti1516.RestoreInProgress
hla.rti1516.RTIinternalError
java.util.concurrent.TimeoutException - the timeout was reached before the RTI acknowledged the
synchronization point registration. After this exception has
been thrown the registration may still have succeeded.
java.lang.InterruptedException
SynchronizationPointRegistrationException
public void registerSynchronizationPoint(java.lang.String syncPointLabel,
byte[] userSuppliedTag,
hla.rti1516.FederateHandleSet synchronizationSet,
long timeout,
java.util.concurrent.TimeUnit unit)
throws hla.rti1516.FederateNotExecutionMember,
hla.rti1516.SaveInProgress,
hla.rti1516.RestoreInProgress,
hla.rti1516.RTIinternalError,
SynchronizationPointRegistrationException,
java.lang.InterruptedException
interrupted, or the specified waiting time
elapses.
syncPointLabel - the label of synchronization point to be registered, as
defined in the SOM/FOM.userSuppliedTag - user supplied tagsynchronizationSet - the set of federates that take part in the synchronizationtimeout - the maximum time to waitunit - the time unit of the timeout argument.
hla.rti1516.FederateNotExecutionMember
hla.rti1516.SaveInProgress
hla.rti1516.RestoreInProgress
hla.rti1516.RTIinternalError
java.lang.IllegalStateException - if this federate is in the process of registering a
synchronization point with the same label. This exception is
generated locally, not from the RTI
java.lang.InterruptedException - if the thread has been interrupted
SynchronizationPointRegistrationException - if the synchronization failed because of one of the following
reasons:
public boolean awaitSynchronizationPointAnnouncement(java.lang.String syncPointLabel,
long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
java.lang.InterruptedException
public void achieveSyncPointAndAwaitFederationSynchronization(java.lang.String syncPointLabel,
long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
hla.rti1516.SynchronizationPointLabelNotAnnounced,
hla.rti1516.FederateNotExecutionMember,
hla.rti1516.SaveInProgress,
hla.rti1516.RestoreInProgress,
hla.rti1516.RTIinternalError,
FederationSynchronizationException
syncPointLabel.
syncPointLabel - timeout - unit -
java.lang.InterruptedException
hla.rti1516.RTIinternalError
hla.rti1516.RestoreInProgress
hla.rti1516.SaveInProgress
hla.rti1516.FederateNotExecutionMember
hla.rti1516.SynchronizationPointLabelNotAnnounced
FederationSynchronizationExceptionpublic hla.rti1516.RTIambassador getRtiAmbassador()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||