copyright The Portico Project 2008.

org.portico.shared.msg
Class FED_CallbackMessage

java.lang.Object
  extended by com.lbf.commons.messaging.RequestMessage
      extended by org.portico.shared.msg.FED_CallbackMessage
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EXT_TerminateLRC, FED_AdvanceGranted, FED_ConstrainedEnabled, FED_DiscoverObject, FED_ProvideUpdate, FED_ReceiveInteraction, FED_ReflectAttributes, FED_RegulationEnabled, FED_RemoveObject, FED_Synchronized, FED_SyncPointAnnounced, FED_SyncPointRegResult

public abstract class FED_CallbackMessage
extends com.lbf.commons.messaging.RequestMessage

This class should be the parent of all request messages that are sent as federate ambassador callback methods. As with RTI_RequestMessage this type contains a string representing the name of the federate it is intended for.

IMPLEMENTATION NOTE: Although this class *doesn't* implement java.io.Externalizable , it does provide implementations of the required methods so that subclasses can call them if they want to (thus removing the need to handle the parent class data). It also implements private writeObject and readObject methods for faster serialization where a child class is not Externalizable.

See Also:
Serialized Form

Field Summary
private static long serialVersionUID
           
protected  String targetFederate
           
protected  double timestamp
           
 
Constructor Summary
protected FED_CallbackMessage()
           
 
Method Summary
 String getTargetFederate()
           
 double getTimestamp()
          This method will return the current timestamp value for this message.
 boolean isAdvanceGrant()
           
 boolean isPriority()
          Priority messages signal to the LRC that they should be processed right away (asynchronously).
 boolean isSpecDefinedMessage()
          Is this callback type a "message" as defined in the HLA specification.
 boolean isTimestamped()
          This method will return true if the current timestamp is not equal to PorticoConstants.NULL_TIME.
 void readExternal(ObjectInput input)
           
private  void readObject(ObjectInputStream ois)
           
 void setTargetFederate(String targetFederate)
           
 void setTimestamp(double timestamp)
           
 void writeExternal(ObjectOutput output)
           
private  void writeObject(ObjectOutputStream oos)
           
 
Methods inherited from class com.lbf.commons.messaging.RequestMessage
getIdentifier, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

targetFederate

protected String targetFederate

timestamp

protected double timestamp
Constructor Detail

FED_CallbackMessage

protected FED_CallbackMessage()
Method Detail

getTargetFederate

public String getTargetFederate()

setTargetFederate

public void setTargetFederate(String targetFederate)

isTimestamped

public boolean isTimestamped()
This method will return true if the current timestamp is not equal to PorticoConstants.NULL_TIME. If it is equal to that value, the message is not meant to be timestamped (thus, false will be returned).


getTimestamp

public double getTimestamp()
This method will return the current timestamp value for this message. By default it will return PorticoConstants.NULL_TIME. If you want a message to no longer have a timestamp, you should call setTimestamp(PorticoConstants.NULL_TIME).


setTimestamp

public void setTimestamp(double timestamp)

isPriority

public boolean isPriority()
Priority messages signal to the LRC that they should be processed right away (asynchronously). These may be HLA-related calls or they may be internal processing calls. Either way, the default of this method is to return false. If a message requires priority status, it should override this method and return true.


isAdvanceGrant

public boolean isAdvanceGrant()

isSpecDefinedMessage

public boolean isSpecDefinedMessage()
Is this callback type a "message" as defined in the HLA specification. The specification defines "messages" as follows:
 3.1.51 message: A change of object instance attribute value, an interaction, or a deletion
                 of an existing object instance, often associated with a particular point on
                 the High Level Architecture (HLA) time axis, as denoted by the associated
                 timestamp.
 

Returns:
Defaults to return false. Should be overridden to return true in any message type that requires it

writeObject

private void writeObject(ObjectOutputStream oos)
                  throws IOException
Throws:
IOException

readObject

private void readObject(ObjectInputStream ois)
                 throws IOException,
                        ClassNotFoundException
Throws:
IOException
ClassNotFoundException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Overrides:
readExternal in class com.lbf.commons.messaging.RequestMessage
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Overrides:
writeExternal in class com.lbf.commons.messaging.RequestMessage
Throws:
IOException

copyright The Portico Project 2008.