org.eodisp.hla.crc
Class CrcRemoteImpl

java.lang.Object
  extended by org.eodisp.hla.crc.CrcRemoteImpl
All Implemented Interfaces:
java.rmi.Remote, CrcRemote

public class CrcRemoteImpl
extends java.lang.Object
implements CrcRemote

Implements the remote interface of the Central RTI Component (CRC). Delegates to Crc. Methods are not synchronized because this class does not change its state. Methods in Crc are synchronized though.

Version:
$Id:$
Author:
ibirrer

Field Summary
(package private) static org.apache.log4j.Logger logger
          Log4J logger for this class
 
Fields inherited from interface org.eodisp.hla.common.crc.CrcRemote
REGISTRY_NAME
 
Constructor Summary
CrcRemoteImpl(Crc crc)
           
 
Method Summary
 FederationExecutionRemote createFederationExecution(java.lang.String federationExecutionName, byte[] fdd)
          Implements HLA service 4.2 (See IEEE Std 1516.1-2000).
 void destroyFederationExecution(java.lang.String federationExecutionName)
          Implements HLA service 4.3 (See IEEE Std 1516.1-2000).
 FederationExecutionRemote getFederationExecution(java.lang.String federationExecutionName)
          Returns the federation execution with the given name.
 FederateHandle joinFederationExecution(java.lang.String federationExecutionName, java.lang.String federateType, LrcHandle lrcHandle, MobileFederateServices serviceReferences)
          Implements HLA service 4.4 (See IEEE Std 1516.1-2000).
 LrcHandle registerLrc(LrcRemote lrcRemote)
          TODO
 void reset()
          Resets the CRC.
 void shutdownAndExit()
          Calls shutdown on the CrcApplication and then exits the JVM.
 void unregisterLrc(LrcHandle lrcHandle)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger
Log4J logger for this class

Constructor Detail

CrcRemoteImpl

public CrcRemoteImpl(Crc crc)
Parameters:
crc - the Crc to which this remote implementation class delegats to.
Method Detail

createFederationExecution

public FederationExecutionRemote createFederationExecution(java.lang.String federationExecutionName,
                                                           byte[] fdd)
                                                    throws FederationExecutionAlreadyExists,
                                                           ErrorReadingFDD
Implements HLA service 4.2 (See IEEE Std 1516.1-2000). Creates a new federation execution.

Specified by:
createFederationExecution in interface CrcRemote
Parameters:
federationExecutionName - the name of the federation execution
fdd - the federation object model (FOM) as an XML file encoded in UTF-8
Returns:
the newly created federation execution
Throws:
FederationExecutionAlreadyExists - if a federation execution with the same name has been created before
ErrorReadingFDD - if fdd could not be read. This is the case if the given fdd is not a valid XML file or does not conform to the HLA XMl Schema.

destroyFederationExecution

public void destroyFederationExecution(java.lang.String federationExecutionName)
                                throws FederatesCurrentlyJoined,
                                       FederationExecutionDoesNotExist
Implements HLA service 4.3 (See IEEE Std 1516.1-2000). Destroys this federation execution.

Specified by:
destroyFederationExecution in interface CrcRemote
Throws:
FederatesCurrentlyJoined - if there are still federates joined to this federation execution
FederationExecutionDoesNotExist - if no federation execution exists with the given name

joinFederationExecution

public FederateHandle joinFederationExecution(java.lang.String federationExecutionName,
                                              java.lang.String federateType,
                                              LrcHandle lrcHandle,
                                              MobileFederateServices serviceReferences)
                                       throws FederationExecutionDoesNotExist
Description copied from interface: CrcRemote
Implements HLA service 4.4 (See IEEE Std 1516.1-2000).

Specified by:
joinFederationExecution in interface CrcRemote
federateType - the type of the federate that want to join this federation execution
lrcHandle - a reference to the LRC which runs the federated that wants tho join
serviceReferences - unused
Returns:
a federation execution wide unique handle for the joined federate.
Throws:
FederationExecutionDoesNotExist

getFederationExecution

public FederationExecutionRemote getFederationExecution(java.lang.String federationExecutionName)
                                                 throws java.rmi.server.ExportException
Returns the federation execution with the given name.

Specified by:
getFederationExecution in interface CrcRemote
Parameters:
federationExecutionName - the name of the federation execution to be received
Returns:
the federation execution with the given name or null if no federation execution exists with the given name.
Throws:
java.rmi.server.ExportException

registerLrc

public LrcHandle registerLrc(LrcRemote lrcRemote)
TODO

Specified by:
registerLrc in interface CrcRemote
Returns:

unregisterLrc

public void unregisterLrc(LrcHandle lrcHandle)

Specified by:
unregisterLrc in interface CrcRemote

reset

public void reset()
Resets the CRC. This means that after this method returned the CRC is in a state as if no federate ever called any method on the CRC. Used for testing purposes only.

Specified by:
reset in interface CrcRemote

shutdownAndExit

public void shutdownAndExit()
Calls shutdown on the CrcApplication and then exits the JVM. Does not block

Specified by:
shutdownAndExit in interface CrcRemote