|
copyright The Portico Project 2008. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lbf.commons.messaging.AbstractMessageHandler
org.portico.lrc.handlers.LRCMessageHandler
org.portico.lrc.handlers.REQ_PublishObjectHandler
public class REQ_PublishObjectHandler
This handler manages object attribute 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, theprocessMessage()
method will check to make sure the federate is an execution member and that a save or restore
is not currently in progress.
Field Summary |
---|
Fields inherited from class org.portico.lrc.handlers.LRCMessageHandler |
---|
interests, logger, lrc, regions, repository, state |
Fields inherited from class com.lbf.commons.messaging.AbstractMessageHandler |
---|
augmentable, name |
Constructor Summary | |
---|---|
REQ_PublishObjectHandler()
|
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)
Validates an object class publication request. |
private void |
unpublish(com.lbf.commons.messaging.MessageContext context)
This method handles requests to stop publishing a specific object class. |
private void |
unpublishImplicit(com.lbf.commons.messaging.MessageContext context,
int classHandle,
String targetFederate)
This method converts what was an object class publication request with 0-attributes into an object class unpublication request. |
private void |
validate(int classHandle,
Set<Integer> attributes)
This method will verify that the object class exists in the FOM, and that each of the attribute handles represents an attribute that exists for the object class. |
private void |
validatePublished(int classHandle)
This method validates that the given object class is published by this federate |
Methods inherited from class org.portico.lrc.handlers.LRCMessageHandler |
---|
error, error, getConnection, getFOM, initialize, sendMessage, success, success, success |
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 |
Constructor Detail |
---|
public REQ_PublishObjectHandler()
Method Detail |
---|
public void processMessage(com.lbf.commons.messaging.MessageContext context) throws Exception
processMessage
in interface com.lbf.commons.messaging.IMessageHandler
processMessage
in class LRCMessageHandler
Exception
private void publish(com.lbf.commons.messaging.MessageContext context) throws Exception
#unsubscribeOCImplicit(MessageContext, int, String)
is called. As required by the spec, the privilegeToDelete
attribute handle is
added to any non-empty set (and thus it is implicitly published).
Following all this, it will send the publication request on to the RTI and if it is
successful, it will record the information in the LRCInterestManager
Exception
private void unpublishImplicit(com.lbf.commons.messaging.MessageContext context, int classHandle, String targetFederate) throws Exception
#unpublishOC(MessageContext)
method.
Exception
private void unpublish(com.lbf.commons.messaging.MessageContext context) throws Exception
LRCInterestManager
.
Some unpublication requests can specify the attribute they wish to unpublish. If that is the
case with the handled request, this method will also first validate that each of the
attribute handles exists in the FOM before sending the request to the RTI.
Exception
private void validate(int classHandle, Set<Integer> attributes) throws JObjectClassNotDefined, JAttributeNotDefined, JRTIinternalError
JObjectClassNotDefined
- If the classHandle doesn't represent a class in the FOM
JAttributeNotDefined
- If an attribute handle doesn't represent an attribute in
the defined object class
JRTIinternalError
- If there is a problem locating the FOMprivate void validatePublished(int classHandle) throws JObjectClassNotPublished
JObjectClassNotPublished
- If the object class is not currently published
|
copyright The Portico Project 2008. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |