copyright The Portico Project 2008.

org.portico.lrc.handlers
Class REQ_SyncPointHandler

java.lang.Object
  extended by com.lbf.commons.messaging.AbstractMessageHandler
      extended by org.portico.lrc.handlers.LRCMessageHandler
          extended by org.portico.lrc.handlers.REQ_SyncPointHandler
All Implemented Interfaces:
com.lbf.commons.messaging.IMessageHandler

public class REQ_SyncPointHandler
extends LRCMessageHandler

Handler to process all sync point related requests. If hands processing for different requests off to private worker methods. See the javadoc for each method for more information.


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_SyncPointHandler()
           
 
Method Summary
 void processMessage(com.lbf.commons.messaging.MessageContext context)
          Depending on the type of the request (as determined by instanceof) it will hand it off to the appropriate private worker method.
private  void registerSynchronizationPoint(com.lbf.commons.messaging.MessageContext context)
          This method will validate that the request to register the sync point is valid before sending it on to the RTI for further processing.
private  void synchronizationPointAchieved(com.lbf.commons.messaging.MessageContext context)
          This method handles requests from a federate to signal to the federation that it has achieved a sync point.
 
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

REQ_SyncPointHandler

public REQ_SyncPointHandler()
Method Detail

processMessage

public void processMessage(com.lbf.commons.messaging.MessageContext context)
                    throws Exception
Depending on the type of the request (as determined by instanceof) it will hand it off to the appropriate private worker method. See the javadoc for those methods for more information.

Specified by:
processMessage in interface com.lbf.commons.messaging.IMessageHandler
Specified by:
processMessage in class LRCMessageHandler
Throws:
Exception

registerSynchronizationPoint

private void registerSynchronizationPoint(com.lbf.commons.messaging.MessageContext context)
                                   throws Exception
This method will validate that the request to register the sync point is valid before sending it on to the RTI for further processing. It will ensure that the federate is in a state where it can issue the request (for example, not in the middle of a save) and it will ensure that the requested label actually contains some contents (isn't null or an empty string). It will then hand the request off to the RTI. On response, it will queue a callback to inform the federate of the result of the request.

Throws:
Exception

synchronizationPointAchieved

private void synchronizationPointAchieved(com.lbf.commons.messaging.MessageContext context)
                                   throws Exception
This method handles requests from a federate to signal to the federation that it has achieved a sync point. The method will check that the federate is in a valid state to issue the request, and that the label corresponds to a sync point that has previously been announced. It will then note locally that the federate has achieved the sync point (in the LRCState) before sending the request to the RTI.

Throws:
Exception

copyright The Portico Project 2008.