copyright The Portico Project 2008.

org.portico.impl.cpp13
Class ProxyRTIAmbassador

java.lang.Object
  extended by org.portico.impl.cpp13.ProxyRTIAmbassador

public class ProxyRTIAmbassador
extends Object

This class is the RTIambassador implementation called by the C++ interface. It is a thin wrapper over the existing HLA 1.3 RTIambassador, serving only to do any necessary deserialization of information as it comes across the wire.


Field Summary
private  ProxyFederateAmbassador fedamb
           
private  int id
           
private  org.apache.log4j.Logger logger
           
private  Default13RTIAmbassador rtiamb
           
 
Constructor Summary
ProxyRTIAmbassador(int id)
          Create a new RTIambassador that will be used by a federate on the C++ side of the bindings.
 
Method Summary
 void associateRegionForUpdates(hla.rti.Region region, int theObject, int[] theAttributes)
           
 void attributeOwnershipAcquisition(int theObject, int[] theAttributes, byte[] theTag)
           
 void attributeOwnershipAcquisitionIfAvailable(int theObject, int[] theAttributes)
           
 int[] attributeOwnershipReleaseResponse(int oHandle, int[] theAttributes)
           
 void cancelAttributeOwnershipAcquisition(int theObject, int[] theAttributes)
           
 void cancelNegotiatedAttributeOwnershipDivestiture(int theObject, int[] theAttributes)
           
 void changeAttributeOrderType(int theObject, int[] theAttributes, int theType)
           
 void changeAttributeTransportationType(int theObject, int[] theAttributes, int theType)
           
 void changeInteractionOrderType(int theClass, int theType)
           
 void changeInteractionTransportationType(int theClass, int theType)
           
private  HLA13SuppliedAttributes convertAttributes(int[] handles, byte[][] values)
          Converts the form that attribute values are sent over from C++ in into the form expected by the java side of the bindings.
private  HLA13AttributeHandleSet convertHandles(int[] handles)
          Converts the form that attribute handles are sent over from C++ in into the form expected by the java side of the bindings
private  HLA13SuppliedParameters convertParameters(int[] handles, byte[][] values)
          Converts the form that parameter values are sent over from C++ in into the form expected by the java side of the bindings.
 byte[] convertTag(byte[] given)
           
 void createFederationExecution(String executionName, String fed)
           
 hla.rti.Region createRegion(int space, int extents)
           
 void deleteObjectInstance(int objectHandle, byte[] tag)
           
 int deleteObjectInstance(int objectHandle, byte[] tag, double theTime)
           
 void deleteRegion(hla.rti.Region region)
           
 void destroyFederationExecution(String executionName)
           
 void disableAsynchronousDelivery()
           
 void disableAttributeRelevanceAdvisorySwitch()
           
 void disableAttributeScopeAdvisorySwitch()
           
 void disableClassRelevanceAdvisorySwitch()
           
 void disableInteractionRelevanceAdvisorySwitch()
           
 void disableTimeConstrained()
           
 void disableTimeRegulation()
           
 void enableAsynchronousDelivery()
           
 void enableAttributeRelevanceAdvisorySwitch()
           
 void enableAttributeScopeAdvisorySwitch()
           
 void enableClassRelevanceAdvisorySwitch()
           
 void enableInteractionRelevanceAdvisorySwitch()
           
 void enableTimeConstrained()
           
 void enableTimeRegulation(double theFederateTime, double theLookahead)
           
 void federateRestoreComplete()
           
 void federateRestoreNotComplete()
           
 void federateSaveBegun()
           
 void federateSaveComplete()
           
 void federateSaveNotComplete()
           
 void flushQueueRequest(double theTime)
           
 int getAttributeHandle(String theName, int whichClass)
           
 String getAttributeName(int theHandle, int whichClass)
           
 int getAttributeRoutingSpaceHandle(int theHandle, int whichClass)
           
 int getDimensionHandle(String theName, int whichSpace)
           
 String getDimensionName(int theHandle, int whichClass)
           
 int getInteractionClassHandle(String theName)
           
 String getInteractionClassName(int theHandle)
           
 int getInteractionRoutingSpaceHandle(int theHandle)
           
 int getObjectClass(int theObject)
           
 int getObjectClassHandle(String theName)
           
 String getObjectClassName(int theHandle)
           
 int getObjectInstanceHandle(String theName)
           
 String getObjectInstanceName(int theHandle)
           
 int getOrderingHandle(String theName)
           
 String getOrderingName(int theHandle)
           
 int getParameterHandle(String theName, int whichClass)
           
 String getParameterName(int theHandle, int whichClass)
           
 hla.rti.Region getRegion(int regionToken)
           
 int getRegionToken(hla.rti.Region region)
           
 int getRoutingSpaceHandle(String theName)
           
 String getRoutingSpaceName(int theHandle)
           
 int getTransportationHandle(String theName)
           
 String getTransportationName(int theHandle)
           
 boolean isAttributeOwnedByFederate(int theObject, int theAttribute)
           
 int joinFederationExecution(String federateType, String executionName)
           
 void kill()
           
 void localDeleteObjectInstance(int objectHandle)
           
 void modifyLookahead(double theLookahead)
           
 void negotiatedAttributeOwnershipDivestiture(int theObject, int[] theAttributes, byte[] theTag)
           
 void nextEventRequest(double theTime)
           
 void nextEventRequestAvailable(double theTime)
           
 void notifyOfRegionModification(hla.rti.Region region)
           
static boolean parseCppRid()
          This method is only to be called from the C++ side of the bindings.
 void publishInteractionClass(int theInteraction)
           
 void publishObjectClass(int theClass, int[] attributeHandles)
           
 void queryAttributeOwnership(int theObject, int theAttribute)
           
 double queryFederateTime()
           
 double queryLBTS()
           
 double queryLookahead()
           
 double queryMinNextEventTime()
           
private  String regionsToString(hla.rti.Region[] array)
          Converts an array of regions into a string form.
 void registerFederationSynchronizationPoint(String label, byte[] tag)
           
 void registerFederationSynchronizationPoint(String label, byte[] tag, int[] handles)
           
 int registerObjectInstance(int theClass)
           
 int registerObjectInstance(int theClass, String theObject)
           
 int registerObjectInstanceWithRegion(int theClass, int[] attributes, hla.rti.Region[] regions)
           
 int registerObjectInstanceWithRegion(int theClass, String theObject, int[] attributes, hla.rti.Region[] regions)
           
 void requestClassAttributeValueUpdate(int theClass, int[] theAttributes)
           
 void requestClassAttributeValueUpdateWithRegion(int theClass, int[] attributes, hla.rti.Region region)
           
 void requestFederationRestore(String label)
           
 void requestFederationSave(String label)
           
 void requestFederationSave(String label, double time)
           
 void requestObjectAttributeValueUpdate(int theObject, int[] attributes)
           
 void resignFederationExecution(int resignAction)
           
 void retract(int theHandle)
           
 void sendInteraction(int theInteraction, int[] handles, byte[][] values, byte[] tag)
           
 int sendInteraction(int iHan, int[] handles, byte[][] values, byte[] tag, double time)
           
 void sendInteractionWithRegion(int theInteraction, int[] handles, byte[][] values, byte[] tag, hla.rti.Region theRegion)
           
 int sendInteractionWithRegion(int theInteraction, int[] handles, byte[][] values, byte[] tag, hla.rti.Region theRegion, double time)
           
 void subscribeInteractionClass(int theClass)
           
 void subscribeInteractionClassPassively(int theClass)
           
 void subscribeInteractionClassPassivelyWithRegion(int theClass, hla.rti.Region theRegion)
           
 void subscribeInteractionClassWithRegion(int theClass, hla.rti.Region theRegion)
           
 void subscribeObjectClassAttributes(int theClass, int[] attributes)
           
 void subscribeObjectClassAttributesPassively(int theClass, int[] attributes)
           
 void subscribeObjectClassAttributesPassivelyWithRegion(int theClass, hla.rti.Region region, int[] attributes)
           
 void subscribeObjectClassAttributesWithRegion(int theClass, hla.rti.Region region, int[] atts)
           
 void synchronizationPointAchieved(String label)
           
 void tick()
           
 void tick(double min, double max)
           
 void timeAdvanceRequest(double theTime)
           
 void timeAdvanceRequestAvailable(double theTime)
           
 void unassociateRegionForUpdates(hla.rti.Region theRegion, int theObject)
           
 void unconditionalAttributeOwnershipDivestiture(int theObject, int[] attributes)
           
 void unpublishInteractionClass(int theInteraction)
           
 void unpublishObjectClass(int theClass)
           
 void unsubscribeInteractionClass(int theClass)
           
 void unsubscribeInteractionClassWithRegion(int theClass, hla.rti.Region theRegion)
           
 void unsubscribeObjectClass(int theClass)
           
 void unsubscribeObjectClassWithRegion(int theClass, hla.rti.Region theRegion)
           
 void updateAttributeValues(int theObject, int[] handles, byte[][] values, byte[] tag)
           
 int updateAttributeValues(int oHandle, int[] handles, byte[][] values, byte[] tag, double time)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rtiamb

private Default13RTIAmbassador rtiamb

fedamb

private ProxyFederateAmbassador fedamb

id

private int id

logger

private org.apache.log4j.Logger logger
Constructor Detail

ProxyRTIAmbassador

public ProxyRTIAmbassador(int id)
                   throws Exception
Create a new RTIambassador that will be used by a federate on the C++ side of the bindings.

Throws:
Exception
Method Detail

convertTag

public byte[] convertTag(byte[] given)

convertParameters

private HLA13SuppliedParameters convertParameters(int[] handles,
                                                  byte[][] values)
Converts the form that parameter values are sent over from C++ in into the form expected by the java side of the bindings.


convertAttributes

private HLA13SuppliedAttributes convertAttributes(int[] handles,
                                                  byte[][] values)
Converts the form that attribute values are sent over from C++ in into the form expected by the java side of the bindings.


convertHandles

private HLA13AttributeHandleSet convertHandles(int[] handles)
Converts the form that attribute handles are sent over from C++ in into the form expected by the java side of the bindings


regionsToString

private String regionsToString(hla.rti.Region[] array)
Converts an array of regions into a string form.


createFederationExecution

public void createFederationExecution(String executionName,
                                      String fed)

destroyFederationExecution

public void destroyFederationExecution(String executionName)

joinFederationExecution

public int joinFederationExecution(String federateType,
                                   String executionName)

resignFederationExecution

public void resignFederationExecution(int resignAction)

registerFederationSynchronizationPoint

public void registerFederationSynchronizationPoint(String label,
                                                   byte[] tag)

registerFederationSynchronizationPoint

public void registerFederationSynchronizationPoint(String label,
                                                   byte[] tag,
                                                   int[] handles)

synchronizationPointAchieved

public void synchronizationPointAchieved(String label)

requestFederationSave

public void requestFederationSave(String label,
                                  double time)

requestFederationSave

public void requestFederationSave(String label)

federateSaveBegun

public void federateSaveBegun()

federateSaveComplete

public void federateSaveComplete()

federateSaveNotComplete

public void federateSaveNotComplete()

requestFederationRestore

public void requestFederationRestore(String label)

federateRestoreComplete

public void federateRestoreComplete()

federateRestoreNotComplete

public void federateRestoreNotComplete()

publishObjectClass

public void publishObjectClass(int theClass,
                               int[] attributeHandles)

unpublishObjectClass

public void unpublishObjectClass(int theClass)

publishInteractionClass

public void publishInteractionClass(int theInteraction)

unpublishInteractionClass

public void unpublishInteractionClass(int theInteraction)

subscribeObjectClassAttributes

public void subscribeObjectClassAttributes(int theClass,
                                           int[] attributes)

subscribeObjectClassAttributesPassively

public void subscribeObjectClassAttributesPassively(int theClass,
                                                    int[] attributes)

unsubscribeObjectClass

public void unsubscribeObjectClass(int theClass)

subscribeInteractionClass

public void subscribeInteractionClass(int theClass)

subscribeInteractionClassPassively

public void subscribeInteractionClassPassively(int theClass)

unsubscribeInteractionClass

public void unsubscribeInteractionClass(int theClass)

registerObjectInstance

public int registerObjectInstance(int theClass)

registerObjectInstance

public int registerObjectInstance(int theClass,
                                  String theObject)

updateAttributeValues

public void updateAttributeValues(int theObject,
                                  int[] handles,
                                  byte[][] values,
                                  byte[] tag)

updateAttributeValues

public int updateAttributeValues(int oHandle,
                                 int[] handles,
                                 byte[][] values,
                                 byte[] tag,
                                 double time)

sendInteraction

public void sendInteraction(int theInteraction,
                            int[] handles,
                            byte[][] values,
                            byte[] tag)

sendInteraction

public int sendInteraction(int iHan,
                           int[] handles,
                           byte[][] values,
                           byte[] tag,
                           double time)

deleteObjectInstance

public void deleteObjectInstance(int objectHandle,
                                 byte[] tag)

deleteObjectInstance

public int deleteObjectInstance(int objectHandle,
                                byte[] tag,
                                double theTime)

localDeleteObjectInstance

public void localDeleteObjectInstance(int objectHandle)

changeAttributeTransportationType

public void changeAttributeTransportationType(int theObject,
                                              int[] theAttributes,
                                              int theType)

changeInteractionTransportationType

public void changeInteractionTransportationType(int theClass,
                                                int theType)

requestObjectAttributeValueUpdate

public void requestObjectAttributeValueUpdate(int theObject,
                                              int[] attributes)

requestClassAttributeValueUpdate

public void requestClassAttributeValueUpdate(int theClass,
                                             int[] theAttributes)

unconditionalAttributeOwnershipDivestiture

public void unconditionalAttributeOwnershipDivestiture(int theObject,
                                                       int[] attributes)

negotiatedAttributeOwnershipDivestiture

public void negotiatedAttributeOwnershipDivestiture(int theObject,
                                                    int[] theAttributes,
                                                    byte[] theTag)

attributeOwnershipAcquisition

public void attributeOwnershipAcquisition(int theObject,
                                          int[] theAttributes,
                                          byte[] theTag)

attributeOwnershipAcquisitionIfAvailable

public void attributeOwnershipAcquisitionIfAvailable(int theObject,
                                                     int[] theAttributes)

attributeOwnershipReleaseResponse

public int[] attributeOwnershipReleaseResponse(int oHandle,
                                               int[] theAttributes)

cancelNegotiatedAttributeOwnershipDivestiture

public void cancelNegotiatedAttributeOwnershipDivestiture(int theObject,
                                                          int[] theAttributes)

cancelAttributeOwnershipAcquisition

public void cancelAttributeOwnershipAcquisition(int theObject,
                                                int[] theAttributes)

queryAttributeOwnership

public void queryAttributeOwnership(int theObject,
                                    int theAttribute)

isAttributeOwnedByFederate

public boolean isAttributeOwnedByFederate(int theObject,
                                          int theAttribute)

enableTimeRegulation

public void enableTimeRegulation(double theFederateTime,
                                 double theLookahead)

disableTimeRegulation

public void disableTimeRegulation()

enableTimeConstrained

public void enableTimeConstrained()

disableTimeConstrained

public void disableTimeConstrained()

timeAdvanceRequest

public void timeAdvanceRequest(double theTime)

timeAdvanceRequestAvailable

public void timeAdvanceRequestAvailable(double theTime)

nextEventRequest

public void nextEventRequest(double theTime)

nextEventRequestAvailable

public void nextEventRequestAvailable(double theTime)

flushQueueRequest

public void flushQueueRequest(double theTime)

enableAsynchronousDelivery

public void enableAsynchronousDelivery()

disableAsynchronousDelivery

public void disableAsynchronousDelivery()

queryLBTS

public double queryLBTS()

queryFederateTime

public double queryFederateTime()

queryMinNextEventTime

public double queryMinNextEventTime()

modifyLookahead

public void modifyLookahead(double theLookahead)

queryLookahead

public double queryLookahead()

retract

public void retract(int theHandle)

changeAttributeOrderType

public void changeAttributeOrderType(int theObject,
                                     int[] theAttributes,
                                     int theType)

changeInteractionOrderType

public void changeInteractionOrderType(int theClass,
                                       int theType)

createRegion

public hla.rti.Region createRegion(int space,
                                   int extents)

notifyOfRegionModification

public void notifyOfRegionModification(hla.rti.Region region)

deleteRegion

public void deleteRegion(hla.rti.Region region)

registerObjectInstanceWithRegion

public int registerObjectInstanceWithRegion(int theClass,
                                            int[] attributes,
                                            hla.rti.Region[] regions)

registerObjectInstanceWithRegion

public int registerObjectInstanceWithRegion(int theClass,
                                            String theObject,
                                            int[] attributes,
                                            hla.rti.Region[] regions)

associateRegionForUpdates

public void associateRegionForUpdates(hla.rti.Region region,
                                      int theObject,
                                      int[] theAttributes)

unassociateRegionForUpdates

public void unassociateRegionForUpdates(hla.rti.Region theRegion,
                                        int theObject)

subscribeObjectClassAttributesWithRegion

public void subscribeObjectClassAttributesWithRegion(int theClass,
                                                     hla.rti.Region region,
                                                     int[] atts)

subscribeObjectClassAttributesPassivelyWithRegion

public void subscribeObjectClassAttributesPassivelyWithRegion(int theClass,
                                                              hla.rti.Region region,
                                                              int[] attributes)

unsubscribeObjectClassWithRegion

public void unsubscribeObjectClassWithRegion(int theClass,
                                             hla.rti.Region theRegion)

subscribeInteractionClassWithRegion

public void subscribeInteractionClassWithRegion(int theClass,
                                                hla.rti.Region theRegion)

subscribeInteractionClassPassivelyWithRegion

public void subscribeInteractionClassPassivelyWithRegion(int theClass,
                                                         hla.rti.Region theRegion)

unsubscribeInteractionClassWithRegion

public void unsubscribeInteractionClassWithRegion(int theClass,
                                                  hla.rti.Region theRegion)

sendInteractionWithRegion

public void sendInteractionWithRegion(int theInteraction,
                                      int[] handles,
                                      byte[][] values,
                                      byte[] tag,
                                      hla.rti.Region theRegion)

sendInteractionWithRegion

public int sendInteractionWithRegion(int theInteraction,
                                     int[] handles,
                                     byte[][] values,
                                     byte[] tag,
                                     hla.rti.Region theRegion,
                                     double time)

requestClassAttributeValueUpdateWithRegion

public void requestClassAttributeValueUpdateWithRegion(int theClass,
                                                       int[] attributes,
                                                       hla.rti.Region region)

getObjectClassHandle

public int getObjectClassHandle(String theName)

getObjectClassName

public String getObjectClassName(int theHandle)

getAttributeHandle

public int getAttributeHandle(String theName,
                              int whichClass)

getAttributeName

public String getAttributeName(int theHandle,
                               int whichClass)

getInteractionClassHandle

public int getInteractionClassHandle(String theName)

getInteractionClassName

public String getInteractionClassName(int theHandle)

getParameterHandle

public int getParameterHandle(String theName,
                              int whichClass)

getParameterName

public String getParameterName(int theHandle,
                               int whichClass)

getObjectInstanceHandle

public int getObjectInstanceHandle(String theName)

getObjectInstanceName

public String getObjectInstanceName(int theHandle)

getRoutingSpaceHandle

public int getRoutingSpaceHandle(String theName)

getRoutingSpaceName

public String getRoutingSpaceName(int theHandle)

getDimensionHandle

public int getDimensionHandle(String theName,
                              int whichSpace)

getDimensionName

public String getDimensionName(int theHandle,
                               int whichClass)

getAttributeRoutingSpaceHandle

public int getAttributeRoutingSpaceHandle(int theHandle,
                                          int whichClass)

getObjectClass

public int getObjectClass(int theObject)

getInteractionRoutingSpaceHandle

public int getInteractionRoutingSpaceHandle(int theHandle)

getTransportationHandle

public int getTransportationHandle(String theName)

getTransportationName

public String getTransportationName(int theHandle)

getOrderingHandle

public int getOrderingHandle(String theName)

getOrderingName

public String getOrderingName(int theHandle)

enableClassRelevanceAdvisorySwitch

public void enableClassRelevanceAdvisorySwitch()

disableClassRelevanceAdvisorySwitch

public void disableClassRelevanceAdvisorySwitch()

enableAttributeRelevanceAdvisorySwitch

public void enableAttributeRelevanceAdvisorySwitch()

disableAttributeRelevanceAdvisorySwitch

public void disableAttributeRelevanceAdvisorySwitch()

enableAttributeScopeAdvisorySwitch

public void enableAttributeScopeAdvisorySwitch()

disableAttributeScopeAdvisorySwitch

public void disableAttributeScopeAdvisorySwitch()

enableInteractionRelevanceAdvisorySwitch

public void enableInteractionRelevanceAdvisorySwitch()

disableInteractionRelevanceAdvisorySwitch

public void disableInteractionRelevanceAdvisorySwitch()

getRegion

public hla.rti.Region getRegion(int regionToken)

getRegionToken

public int getRegionToken(hla.rti.Region region)

tick

public void tick()

tick

public void tick(double min,
                 double max)

kill

public void kill()

parseCppRid

public static boolean parseCppRid()
This method is only to be called from the C++ side of the bindings.

It will search for the RID file and load its contents into the system properties. If the environment variable RTI_RID_FILE is set, it will look for the RID file in that location. If there is a value in that location, it will attempt to load that file. If the file can be found, it will be loaded as a properties file. If it can't be found, the method will try to load ./RTI.rid (where the current directory is the directory from which the program was launched. If that file can't be found, the method will just return.

Returns:
true if a file was loaded, false otherwise

copyright The Portico Project 2008.