org.portico.lrc.handlers
Class REQ_PublishInteractionHandler
java.lang.Object
com.lbf.commons.messaging.AbstractMessageHandler
org.portico.lrc.handlers.LRCMessageHandler
org.portico.lrc.handlers.REQ_PublishInteractionHandler
- All Implemented Interfaces:
- com.lbf.commons.messaging.IMessageHandler
public class REQ_PublishInteractionHandler
- extends LRCMessageHandler
This handler manages interaction publish/unpublish requests. It will make all the
appropriate checks before sending the request on to the RTI, and it will store the
relevant information once it has been returned from the RTI.
Before *ANY* request is processed, the processMessage()
method will check to make sure the federate is an execution member and that a save or restore
is not currently in progress.
Fields inherited from class com.lbf.commons.messaging.AbstractMessageHandler |
augmentable, name |
Method Summary |
void |
processMessage(com.lbf.commons.messaging.MessageContext context)
Processes an incoming message and depending on the type, delegates it to the appropriate
private handling method. |
private void |
publish(com.lbf.commons.messaging.MessageContext context)
Attempt to inform the RTI that the federate wishes to publish the given interaction class. |
private void |
unpublish(com.lbf.commons.messaging.MessageContext context)
Attempt to inform the RTI that the federate wishes to no longer publish the given interaction
class. |
private void |
validate(int classHandle)
This method will verify that the interaction class exists in the FOM. |
private void |
validatePublished(int classHandle)
This method validates that the given interaction class is published by this federate |
Methods inherited from class com.lbf.commons.messaging.AbstractMessageHandler |
getName, isAugmentable, setAugmentable, setName |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
REQ_PublishInteractionHandler
public REQ_PublishInteractionHandler()
processMessage
public void processMessage(com.lbf.commons.messaging.MessageContext context)
throws Exception
- Processes an incoming message and depending on the type, delegates it to the appropriate
private handling method.
- Specified by:
processMessage
in interface com.lbf.commons.messaging.IMessageHandler
- Specified by:
processMessage
in class LRCMessageHandler
- Throws:
Exception
publish
private void publish(com.lbf.commons.messaging.MessageContext context)
throws Exception
- Attempt to inform the RTI that the federate wishes to publish the given interaction class.
Once the interaction handle has been validated (to make sure it exists in the FOM), the
request is sent to the RTI. It a success response is received, the publication interest is
recorded in the
LRCInterestManager
.
- Throws:
Exception
unpublish
private void unpublish(com.lbf.commons.messaging.MessageContext context)
throws Exception
- Attempt to inform the RTI that the federate wishes to no longer publish the given interaction
class. Once the interaction handle has been validated (to make sure it exists in the FOM),
and the method has ensured that the interaction class is currently being published by the
federate, the request is sent to the RTI. It a success response is received, the publication
interest is removed from the
LRCInterestManager
.
- Throws:
Exception
validate
private void validate(int classHandle)
throws JInteractionClassNotDefined,
JRTIinternalError
- This method will verify that the interaction class exists in the FOM.
- Throws:
JInteractionClassNotDefined
- If the classHandle doesn't represent a class in the FOM
JRTIinternalError
- If there is a problem locating the FOM
validatePublished
private void validatePublished(int classHandle)
throws JInteractionClassNotPublished
- This method validates that the given interaction class is published by this federate
- Throws:
JObjectClassNotPublished
- If the object class is not currently published
JInteractionClassNotPublished