org.eodisp.hla.crc
Class FederationExecution

java.lang.Object
  extended by org.eodisp.hla.crc.FederationExecution

public class FederationExecution
extends java.lang.Object

Represents a federation execution on the CRC. Most methods in this class are declared package private. It is crucial that other classes in this package using these methods care for synchronization of returned instances from these methods, because they make the non-thread-safe ecore model available to the outside. The reason these methods are not private is because it makes testing easier (Testing classes reside in the same package and therefore have access to the package private methods).

Version:
$Id: FederationExecution.java 4125 2006-10-24 14:40:56Z ibirrer $
Author:
ibirrer

Constructor Summary
FederationExecution(java.lang.String name, byte[] fdd)
           
 
Method Summary
(package private)  void addFederationExecutionEventListener(FederationExecutionEventListener listener)
           
(package private)  void doAnnounceSynchronizationPointCallback(java.lang.String synchronizationPointLabel, java.util.Set<FederateHandle> callbackFederates, byte[] userSuppliedTag)
           
(package private)  void doFederatesSynchronizedCallback(java.lang.String syncPointName, java.util.Set<FederateHandle> synchronizedFederates, byte[] userSuppliedTag)
           
(package private)  Attribute getAttribute(ObjectClassHandle objectClassHandle, AttributeHandle attributeHandle)
          Returns the attribute bound to the given attribute handle.
(package private)  AttributeHandle getAttributeHandle(ObjectClassHandle objectClassHandle, java.lang.String theName)
          Implements HLA service 10.4 (See IEEE Std 1516.1-2000).
(package private)  AttributeHandle[] getAttributeHandles(java.util.Set<Attribute> attributes)
           
(package private)  java.lang.String getAttributeName(ObjectClassHandle whichClass, AttributeHandle theHandle)
          Implements HLA service 10.5 (See IEEE Std 1516.1-2000).
(package private)  java.util.Set<Attribute> getAttributes(ObjectClassHandle objectClassHandle, AttributeHandle[] attributeHandles)
           
(package private)  Federate getFederate(FederateHandle federateHandle)
          Returns the federate associated with the given handle.
(package private)  InteractionClass getInteractionClass(InteractionClassHandle interactionClassHandle)
          Returns the interaction class associated with the given handle.
(package private)  InteractionClassHandle getInteractionClassHandle(java.lang.String theName)
          Implements HLA service 10.6 (See IEEE Std 1516.1-2000).
(package private)  java.lang.String getInteractionClassName(InteractionClassHandle theHandle)
          Implements HLA service 10.7 (See IEEE Std 1516.1-2000).
(package private)  ObjectClassHandle getKnownObjectClassHandle(ObjectInstanceHandle objectInstanceHandle)
          Implements HLA service 10.16 (See IEEE Std 1516.1-2000).
 java.lang.String getName()
          Returns the name of this federation execution as it was initialized in Crc#createFederationExecution(String, URL)
(package private)  int getNrOfJoinedFederates()
           
(package private)  ObjectClass getObjectClass(ObjectClassHandle objectClassHandle)
          Returns the object class associated with the given handle.
(package private)  ObjectClassHandle getObjectClassHandle(java.lang.String theName)
          Implements HLA service 10.2 (See IEEE Std 1516.1-2000).
(package private)  java.lang.String getObjectClassName(ObjectClassHandle theHandle)
          Implements HLA service 10.3 (See IEEE Std 1516.1-2000).
(package private)  ObjectInstance getObjectInstance(ObjectInstanceHandle objectInstanceHandle)
           
(package private)  ObjectInstanceHandle getObjectInstanceHandle(java.lang.String theName)
          Implements HLA service 10.10 (See IEEE Std 1516.1-2000).
(package private)  java.lang.String getObjectInstanceName(ObjectInstanceHandle objectInstanceHandle)
          Implements HLA service 10.11 (See IEEE Std 1516.1-2000).
(package private)  Parameter getParameter(InteractionClassHandle interactionClassHandle, ParameterHandle parameterHandle)
           
(package private)  Parameter getParameter(ParameterHandle parameterHandle)
           
(package private)  ParameterHandle getParameterHandle(InteractionClassHandle interactionClassHandle, java.lang.String theName)
          Implements HLA service 10.8 (See IEEE Std 1516.1-2000).
(package private)  java.lang.String getParameterName(InteractionClassHandle interactionClassHandle, ParameterHandle parameterHandle)
          Implements HLA service 10.9 (See IEEE Std 1516.1-2000).
 FederationExecutionRemote getRemoteInterface()
          Returns the (always the same) remote proxy of.
(package private)  java.util.Map<LrcRemote,java.util.Set<FederateHandle>> getSubscriptions(InteractionClassHandle interactionClassHandle, FederateHandle federateHandle)
           
(package private)  java.util.Map<LrcRemote,java.util.Map<FederateHandle,AttributeHandle[]>> getSubscriptions(ObjectInstanceHandle objectInstanceHandle, AttributeHandle[] attributeHandles, FederateHandle askingFederateHandle)
           
(package private)  FederateHandle join(java.lang.String federateType, LrcHandle lrcHandle, MobileFederateServices serviceReferences)
          Implements HLA service 4.4 (See IEEE Std 1516.1-2000).
(package private)  void publishInteractionClass(InteractionClassHandle interactionClassHandle, FederateHandle federateHandle)
           
(package private)  void publishObjectClassAttributes(ObjectClassHandle objectClassHandle, AttributeHandle[] attributeHandles, FederateHandle federateHandle)
           
(package private)  void registerFederationSynchronizationPoint(java.lang.String synchronizationPointLabel, byte[] userSuppliedTag, FederateHandle askingFederate)
          Implements HLA service 4.6 (See IEEE Std 1516.1-2000).
(package private)  void registerFederationSynchronizationPoint(java.lang.String synchronizationPointLabel, byte[] userSuppliedTag, FederateHandle[] synchronizationSet, FederateHandle askingFederate)
          Implements HLA service 4.6 (See IEEE Std 1516.1-2000).
(package private)  ObjectInstanceHandle registerObjectInstance(ObjectClassHandle objectClassHandle, FederateHandle federateHandle)
           
(package private)  void removeFederationExecutionEventListener(FederationExecutionEventListener listener)
           
(package private)  void reset()
          Used for testing only
(package private)  void resign(ResignAction resignAction, FederateHandle federateHandle)
          Implements HLA service 4.5 (See IEEE Std 1516.1-2000).
(package private)  void subscribeInteractionClass(InteractionClassHandle interactionClassHandle, FederateHandle federateHandle)
           
(package private)  void subscribeObjectClassAttributes(ObjectClassHandle objectClassHandle, AttributeHandle[] attributeHandles, FederateHandle federateHandle)
           
(package private)  void synchronizationPointAchieved(java.lang.String synchronizationPointLabel, FederateHandle askingFederate)
          Implements HLA service 4.9 (See IEEE Std 1516.1-2000).
(package private)  void unexport()
           
(package private)  void unpublishObjectClass(ObjectClassHandle objectClassHandle, FederateHandle federateHandle)
           
 void unpublishObjectClassAttributes(ObjectClassHandle objectClassHandle, AttributeHandle[] attributeHandles, FederateHandle federateHandle)
           fallback hafd
(package private)  void unpusblishInteractionClass(InteractionClassHandle interactionClassHandle, FederateHandle federateHandle)
           
(package private)  void unsubscribeInteractionClass(InteractionClassHandle interactionClassHandle, FederateHandle federateHandle)
           
 void unsubscribeObjectClass(ObjectClassHandle objectClassHandle, FederateHandle federateHandle)
           
(package private)  void unsubscribeObjectClassAttributes(ObjectClassHandle objectClassHandle, AttributeHandle[] attributeHandles, FederateHandle federateHandle)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FederationExecution

FederationExecution(java.lang.String name,
                    byte[] fdd)
              throws ErrorReadingFDD
Parameters:
name - The name of the new federation execution
fdd - The Federation Object Model (FOM) Document Data
Throws:
CouldNotOpenFDD
ErrorReadingFDD
java.rmi.server.ExportException
Method Detail

unexport

void unexport()

addFederationExecutionEventListener

void addFederationExecutionEventListener(FederationExecutionEventListener listener)

removeFederationExecutionEventListener

void removeFederationExecutionEventListener(FederationExecutionEventListener listener)

getAttribute

Attribute getAttribute(ObjectClassHandle objectClassHandle,
                       AttributeHandle attributeHandle)
                 throws InvalidAttributeHandle,
                        ObjectClassNotDefined,
                        AttributeNotDefined
Returns the attribute bound to the given attribute handle. It is tested if the given attribute is available from the given object class.

Parameters:
objectClassHandle - the object class this attribute is defined in
attributeHandle - the attribute handle
Returns:
the attribute that is bound to the given attribute handle.
Throws:
InvalidAttributeHandle - If the given handle does not exist within this federation execution.
InvalidObjectClassHandle - If the given handle does not exist within this federation execution.
AttributeNotDefined - If the attribute specified with the attribute handle is not available within the specified object class.
ObjectClassNotDefined
See Also:
Attribute.isAvailableFrom(ObjectClass)

getAttributes

java.util.Set<Attribute> getAttributes(ObjectClassHandle objectClassHandle,
                                       AttributeHandle[] attributeHandles)
                                 throws InvalidAttributeHandle,
                                        ObjectClassNotDefined,
                                        AttributeNotDefined
Throws:
InvalidAttributeHandle
ObjectClassNotDefined
AttributeNotDefined

getAttributeHandles

AttributeHandle[] getAttributeHandles(java.util.Set<Attribute> attributes)

getObjectInstance

ObjectInstance getObjectInstance(ObjectInstanceHandle objectInstanceHandle)
                           throws ObjectInstanceNotKnown
Throws:
ObjectInstanceNotKnown

getParameter

Parameter getParameter(InteractionClassHandle interactionClassHandle,
                       ParameterHandle parameterHandle)
                 throws InvalidParameterHandle,
                        InteractionParameterNotDefined,
                        InteractionClassNotDefined
Throws:
InvalidParameterHandle
InteractionParameterNotDefined
InteractionClassNotDefined

getParameter

Parameter getParameter(ParameterHandle parameterHandle)
                 throws InvalidParameterHandle
Throws:
InvalidParameterHandle

getObjectClass

ObjectClass getObjectClass(ObjectClassHandle objectClassHandle)
                     throws ObjectClassNotDefined
Returns the object class associated with the given handle.

Parameters:
objectClassHandle - the handle of the object class to be returned.
Returns:
the object class of that is associated with the given handle.
Throws:
ObjectClassNotDefined - if the given handle is not associated with an object class

getInteractionClass

InteractionClass getInteractionClass(InteractionClassHandle interactionClassHandle)
                               throws InteractionClassNotDefined
Returns the interaction class associated with the given handle.

Parameters:
interactionClassHandle - the handle of the interaction class to be returned
Returns:
the interaction class that is associated with the given handle.
Throws:
InteractionClassNotDefined - if the given handle is not associated with an interaction class.

getFederate

Federate getFederate(FederateHandle federateHandle)
               throws FederateNotExecutionMember
Returns the federate associated with the given handle.

Parameters:
federateHandle - the handle of the federate to be returned.
Returns:
the federate that is associated with the given handle
Throws:
FederateNotExecutionMember - if the federate is not an execution member of this federation execution.

getName

public java.lang.String getName()
Returns the name of this federation execution as it was initialized in Crc#createFederationExecution(String, URL)

Returns:
the name of this federation execution.

join

FederateHandle join(java.lang.String federateType,
                    LrcHandle lrcHandle,
                    MobileFederateServices serviceReferences)
Implements HLA service 4.4 (See IEEE Std 1516.1-2000). Joins this federation execution.

Parameters:
federateType - unused
lrcHandle - reference to the remote federate that wants to join
serviceReferences - unused
Returns:
a new and unique federate handle
Throws:
java.lang.AssertionError - if the
implementation priority
1

resign

void resign(ResignAction resignAction,
            FederateHandle federateHandle)
      throws OwnershipAcquisitionPending,
             FederateOwnsAttributes,
             FederateNotExecutionMember
Implements HLA service 4.5 (See IEEE Std 1516.1-2000).

Throws:
OwnershipAcquisitionPending
FederateOwnsAttributes
FederateNotExecutionMember
implementation priority
1

registerFederationSynchronizationPoint

void registerFederationSynchronizationPoint(java.lang.String synchronizationPointLabel,
                                            byte[] userSuppliedTag,
                                            FederateHandle askingFederate)
                                      throws SaveInProgress,
                                             RestoreInProgress,
                                             FederateNotExecutionMember
Implements HLA service 4.6 (See IEEE Std 1516.1-2000).

Throws:
FederateNotExecutionMember
SaveInProgress
RestoreInProgress
implementation priority
1

registerFederationSynchronizationPoint

void registerFederationSynchronizationPoint(java.lang.String synchronizationPointLabel,
                                            byte[] userSuppliedTag,
                                            FederateHandle[] synchronizationSet,
                                            FederateHandle askingFederate)
                                      throws SaveInProgress,
                                             RestoreInProgress,
                                             FederateNotExecutionMember
Implements HLA service 4.6 (See IEEE Std 1516.1-2000).

Throws:
FederateNotExecutionMember
SaveInProgress
RestoreInProgress
implementation priority
1

doAnnounceSynchronizationPointCallback

void doAnnounceSynchronizationPointCallback(java.lang.String synchronizationPointLabel,
                                            java.util.Set<FederateHandle> callbackFederates,
                                            byte[] userSuppliedTag)

doFederatesSynchronizedCallback

void doFederatesSynchronizedCallback(java.lang.String syncPointName,
                                     java.util.Set<FederateHandle> synchronizedFederates,
                                     byte[] userSuppliedTag)

synchronizationPointAchieved

void synchronizationPointAchieved(java.lang.String synchronizationPointLabel,
                                  FederateHandle askingFederate)
                            throws SynchronizationPointLabelNotAnnounced,
                                   SaveInProgress,
                                   RestoreInProgress
Implements HLA service 4.9 (See IEEE Std 1516.1-2000).

Parameters:
askingFederate -
Throws:
SynchronizationPointLabelNotAnnounced
SaveInProgress
RestoreInProgress
implementation priority
1

getObjectClassHandle

ObjectClassHandle getObjectClassHandle(java.lang.String theName)
                                 throws NameNotFound
Implements HLA service 10.2 (See IEEE Std 1516.1-2000).

Throws:
NameNotFound
implementation priority
1

getObjectClassName

java.lang.String getObjectClassName(ObjectClassHandle theHandle)
                              throws ObjectClassNotDefined
Implements HLA service 10.3 (See IEEE Std 1516.1-2000).

Throws:
ObjectClassNotDefined
implementation priority
1

getAttributeHandle

AttributeHandle getAttributeHandle(ObjectClassHandle objectClassHandle,
                                   java.lang.String theName)
                             throws ObjectClassNotDefined,
                                    NameNotFound
Implements HLA service 10.4 (See IEEE Std 1516.1-2000).

Throws:
ObjectClassNotDefined
NameNotFound
implementation priority
1

getAttributeName

java.lang.String getAttributeName(ObjectClassHandle whichClass,
                                  AttributeHandle theHandle)
                            throws ObjectClassNotDefined,
                                   InvalidAttributeHandle,
                                   AttributeNotDefined
Implements HLA service 10.5 (See IEEE Std 1516.1-2000).

Throws:
ObjectClassNotDefined
InvalidAttributeHandle
AttributeNotDefined
implementation priority
1

getInteractionClassHandle

InteractionClassHandle getInteractionClassHandle(java.lang.String theName)
                                           throws NameNotFound
Implements HLA service 10.6 (See IEEE Std 1516.1-2000).

Throws:
NameNotFound
implementation priority
1

getInteractionClassName

java.lang.String getInteractionClassName(InteractionClassHandle theHandle)
                                   throws InteractionClassNotDefined
Implements HLA service 10.7 (See IEEE Std 1516.1-2000).

Throws:
InteractionClassNotDefined
implementation priority
1

getParameterHandle

ParameterHandle getParameterHandle(InteractionClassHandle interactionClassHandle,
                                   java.lang.String theName)
                             throws NameNotFound,
                                    InteractionClassNotDefined
Implements HLA service 10.8 (See IEEE Std 1516.1-2000).

Throws:
InteractionClassNotDefined
NameNotFound
implementation priority
1

getParameterName

java.lang.String getParameterName(InteractionClassHandle interactionClassHandle,
                                  ParameterHandle parameterHandle)
                            throws InvalidParameterHandle,
                                   InteractionParameterNotDefined,
                                   InteractionClassNotDefined
Implements HLA service 10.9 (See IEEE Std 1516.1-2000).

Throws:
InteractionClassNotDefined
InvalidParameterHandle
InteractionParameterNotDefined
implementation priority
1

publishObjectClassAttributes

void publishObjectClassAttributes(ObjectClassHandle objectClassHandle,
                                  AttributeHandle[] attributeHandles,
                                  FederateHandle federateHandle)
                            throws ObjectClassNotDefined,
                                   AttributeNotDefined,
                                   FederateNotExecutionMember,
                                   InvalidAttributeHandle
Throws:
ObjectClassNotDefined
AttributeNotDefined
FederateNotExecutionMember
InvalidAttributeHandle

unpublishObjectClassAttributes

public void unpublishObjectClassAttributes(ObjectClassHandle objectClassHandle,
                                           AttributeHandle[] attributeHandles,
                                           FederateHandle federateHandle)
                                    throws ObjectClassNotDefined,
                                           AttributeNotDefined,
                                           FederateNotExecutionMember,
                                           InvalidAttributeHandle
fallback hafd

Throws:
ObjectClassNotDefined
AttributeNotDefined
FederateNotExecutionMember
InvalidAttributeHandle

unpublishObjectClass

void unpublishObjectClass(ObjectClassHandle objectClassHandle,
                          FederateHandle federateHandle)
                    throws ObjectClassNotDefined,
                           FederateNotExecutionMember
Throws:
ObjectClassNotDefined
FederateNotExecutionMember

subscribeObjectClassAttributes

void subscribeObjectClassAttributes(ObjectClassHandle objectClassHandle,
                                    AttributeHandle[] attributeHandles,
                                    FederateHandle federateHandle)
                              throws ObjectClassNotDefined,
                                     AttributeNotDefined,
                                     FederateNotExecutionMember,
                                     InvalidAttributeHandle
Throws:
ObjectClassNotDefined
AttributeNotDefined
FederateNotExecutionMember
InvalidAttributeHandle

unsubscribeObjectClass

public void unsubscribeObjectClass(ObjectClassHandle objectClassHandle,
                                   FederateHandle federateHandle)
                            throws ObjectClassNotDefined,
                                   FederateNotExecutionMember
Throws:
ObjectClassNotDefined
FederateNotExecutionMember

unsubscribeObjectClassAttributes

void unsubscribeObjectClassAttributes(ObjectClassHandle objectClassHandle,
                                      AttributeHandle[] attributeHandles,
                                      FederateHandle federateHandle)
                                throws ObjectClassNotDefined,
                                       AttributeNotDefined,
                                       FederateNotExecutionMember,
                                       InvalidAttributeHandle
Throws:
ObjectClassNotDefined
AttributeNotDefined
FederateNotExecutionMember
InvalidAttributeHandle

publishInteractionClass

void publishInteractionClass(InteractionClassHandle interactionClassHandle,
                             FederateHandle federateHandle)
                       throws InteractionClassNotDefined,
                              FederateNotExecutionMember,
                              SaveInProgress,
                              RestoreInProgress
Throws:
InteractionClassNotDefined
FederateNotExecutionMember
SaveInProgress
RestoreInProgress

unpusblishInteractionClass

void unpusblishInteractionClass(InteractionClassHandle interactionClassHandle,
                                FederateHandle federateHandle)
                          throws FederateNotExecutionMember,
                                 InteractionClassNotDefined
Throws:
FederateNotExecutionMember
InteractionClassNotDefined

subscribeInteractionClass

void subscribeInteractionClass(InteractionClassHandle interactionClassHandle,
                               FederateHandle federateHandle)
                         throws InteractionClassNotDefined,
                                FederateNotExecutionMember
Throws:
InteractionClassNotDefined
FederateNotExecutionMember

unsubscribeInteractionClass

void unsubscribeInteractionClass(InteractionClassHandle interactionClassHandle,
                                 FederateHandle federateHandle)
                           throws InteractionClassNotDefined,
                                  FederateNotExecutionMember,
                                  SaveInProgress,
                                  RestoreInProgress
Throws:
InteractionClassNotDefined
FederateNotExecutionMember
SaveInProgress
RestoreInProgress

registerObjectInstance

ObjectInstanceHandle registerObjectInstance(ObjectClassHandle objectClassHandle,
                                            FederateHandle federateHandle)
                                      throws ObjectClassNotDefined,
                                             ObjectClassNotPublished,
                                             FederateNotExecutionMember
Throws:
ObjectClassNotDefined
ObjectClassNotPublished
FederateNotExecutionMember

getObjectInstanceHandle

ObjectInstanceHandle getObjectInstanceHandle(java.lang.String theName)
                                       throws ObjectInstanceNotKnown
Implements HLA service 10.10 (See IEEE Std 1516.1-2000).

Throws:
ObjectInstanceNotKnown
implementation priority
1

getObjectInstanceName

java.lang.String getObjectInstanceName(ObjectInstanceHandle objectInstanceHandle)
                                 throws ObjectInstanceNotKnown
Implements HLA service 10.11 (See IEEE Std 1516.1-2000).

Throws:
ObjectInstanceNotKnown
implementation priority
1

getSubscriptions

java.util.Map<LrcRemote,java.util.Map<FederateHandle,AttributeHandle[]>> getSubscriptions(ObjectInstanceHandle objectInstanceHandle,
                                                                                          AttributeHandle[] attributeHandles,
                                                                                          FederateHandle askingFederateHandle)
                                                                                    throws AttributeNotDefined,
                                                                                           AttributeNotOwned,
                                                                                           FederateNotExecutionMember,
                                                                                           InvalidAttributeHandle,
                                                                                           ObjectInstanceNotKnown
Throws:
AttributeNotDefined
AttributeNotOwned
FederateNotExecutionMember
InvalidAttributeHandle
ObjectInstanceNotKnown
See Also:
FederationExecutionRemote.getSubscriptions(ObjectInstanceHandle, AttributeHandle[], FederateHandle)

getSubscriptions

java.util.Map<LrcRemote,java.util.Set<FederateHandle>> getSubscriptions(InteractionClassHandle interactionClassHandle,
                                                                        FederateHandle federateHandle)
                                                                  throws InteractionClassNotDefined,
                                                                         InteractionClassNotPublished,
                                                                         FederateNotExecutionMember
Throws:
InteractionClassNotDefined
InteractionClassNotPublished
FederateNotExecutionMember

getKnownObjectClassHandle

ObjectClassHandle getKnownObjectClassHandle(ObjectInstanceHandle objectInstanceHandle)
                                      throws ObjectInstanceNotKnown
Implements HLA service 10.16 (See IEEE Std 1516.1-2000).

Throws:
ObjectInstanceNotKnown
implementation priority
1

getRemoteInterface

public FederationExecutionRemote getRemoteInterface()
Returns the (always the same) remote proxy of.

Returns:
the remote proxy through which this federation execution can be acessed from remote.

getNrOfJoinedFederates

int getNrOfJoinedFederates()

reset

void reset()
Used for testing only