org.portico.shared.msg
Class FED_CallbackMessage
java.lang.Object
com.lbf.commons.messaging.RequestMessage
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
Methods inherited from class com.lbf.commons.messaging.RequestMessage |
getIdentifier, toString |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
targetFederate
protected String targetFederate
timestamp
protected double timestamp
FED_CallbackMessage
protected FED_CallbackMessage()
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