copyright The Portico Project 2008.

org.portico.core
Class BootstrapHandler

java.lang.Object
  extended by com.lbf.commons.messaging.AbstractMessageHandler
      extended by org.portico.core.BootstrapHandler
All Implemented Interfaces:
com.lbf.commons.messaging.IMessageHandler

public class BootstrapHandler
extends com.lbf.commons.messaging.AbstractMessageHandler

This class exists to handle the processing of the bootstrap messages (create, destory and join). All RTIConnection implementations should pass create,destroy,join messages to an instance of this class, rather than to the RTIExec directly (or any other entity).

All Bootstrap subclasses have access to this handler through the inherited method Bootstrap.getBootstrapHandler(). A given Bootstrap implementation is free to intercept these calls and wrap around them in order to perform any necessary pre- or post- logic (typically for the join() call), but they should make sure that all methods are passed here and not to the RTIExec.

NOTE: For join federation requests, the Bootstrap implementation should be sure to set the "connection" property of the RTI_JoinFederation request before passing it to this handler.


Field Summary
private  RTIExec execution
           
 
Fields inherited from class com.lbf.commons.messaging.AbstractMessageHandler
augmentable, name
 
Constructor Summary
BootstrapHandler(RTIExec execution)
           
 
Method Summary
private  void createFederation(com.lbf.commons.messaging.MessageContext context)
          Requests the creation of a federation directly on the RTIExec that was used to create this handler.
private  void destroyFederation(com.lbf.commons.messaging.MessageContext context)
          Requests the removal of a federation directly on the RTIExec that was used to create this handler.
private  void joinFederation(com.lbf.commons.messaging.MessageContext context)
          This method will first try to find the Federation that the request is asking to join.
 void processMessage(com.lbf.commons.messaging.MessageContext context)
          This method routes the request to the appropriate private helper method depending on what type of request it is.
 
Methods inherited from class com.lbf.commons.messaging.AbstractMessageHandler
getName, initialize, isAugmentable, setAugmentable, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

execution

private RTIExec execution
Constructor Detail

BootstrapHandler

public BootstrapHandler(RTIExec execution)
                 throws JException
Throws:
JException
Method Detail

processMessage

public void processMessage(com.lbf.commons.messaging.MessageContext context)
This method routes the request to the appropriate private helper method depending on what type of request it is. If it is not a create,destroy or join request, an error reponse is packaged into the context and processing will end.

Specified by:
processMessage in interface com.lbf.commons.messaging.IMessageHandler
Specified by:
processMessage in class com.lbf.commons.messaging.AbstractMessageHandler

createFederation

private void createFederation(com.lbf.commons.messaging.MessageContext context)
Requests the creation of a federation directly on the RTIExec that was used to create this handler. If an error occurs, an exception response is set on the context.


destroyFederation

private void destroyFederation(com.lbf.commons.messaging.MessageContext context)
Requests the removal of a federation directly on the RTIExec that was used to create this handler. If there is a problem, it is set on the context's response.


joinFederation

private void joinFederation(com.lbf.commons.messaging.MessageContext context)
This method will first try to find the Federation that the request is asking to join. It will when pass the request on to the Federation's request sink, where it will be processed further. If the federation cannot be found, an exception response of type JFederationExecutionDoesNotExist is packaged in the context and processing will end.


copyright The Portico Project 2008.