com.epam.fixengine.session.messagehandler
Class HandlerChain

java.lang.Object
  extended by com.epam.fixengine.session.messagehandler.AbstractSessionMessageHandler
      extended by com.epam.fixengine.session.messagehandler.HandlerChain
All Implemented Interfaces:
FIXMessageListener, SessionMessageHandler

public final class HandlerChain
extends AbstractSessionMessageHandler

The HandlerChain provides the chain of responsibility pattern.


Field Summary
protected  CompositeMessageHandler compositeListener
           
protected  List<SessionMessageHandler> messageHandlers
           
protected  List<PostProcessMessageHandler> postProcessMessageHandlers
           
protected  List<PreProcessMessageHandler> preProcessMessageHandlers
           
protected  RawFIXUtil.RawTags rawTags
           
 
Fields inherited from class com.epam.fixengine.session.messagehandler.AbstractSessionMessageHandler
log, logIsTraceEnabled
 
Constructor Summary
HandlerChain()
          Creates the HandlerChain with composite message handler.
 
Method Summary
 void addGlobalMessageHandler(AbstractGlobalMessageHandler globalMessageHandler)
          Adds the global message handler.
 void addGlobalPostProcessMessageHandler(AbstractGlobalPostProcessSessionMessageHandler globalMessageHandler)
          Adds the global message handler.
 void addGlobalPreProcessMessageHandler(PreProcessMessageHandler globalMessageHandler)
           
 void addSessionMessageHandler(String msgType, SessionMessageHandler messageHandler)
          Adds the specific message handle.
protected  void finalize()
           
 boolean isNeedPreProcess()
           
 void onMessage(MsgBuf message)
           
 void onNewMessage(FIXFieldList message)
          This method is invoked every time when FIX Engine receives application message.
 void onPostProcessMessage(MsgBuf message)
           
 void onSessionStateChange(SessionState sessionState)
           
 void setFIXSession(ExtendedFIXSession fixSession)
          Sets the extended fix session.
 void setUserListener(FIXSessionListener listener)
          Sets the user message compositeListener.
 
Methods inherited from class com.epam.fixengine.session.messagehandler.AbstractSessionMessageHandler
getFIXSession, logErrorToSession, logWarnToSession
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

compositeListener

protected CompositeMessageHandler compositeListener

messageHandlers

protected List<SessionMessageHandler> messageHandlers

preProcessMessageHandlers

protected List<PreProcessMessageHandler> preProcessMessageHandlers

postProcessMessageHandlers

protected List<PostProcessMessageHandler> postProcessMessageHandlers

rawTags

protected RawFIXUtil.RawTags rawTags
Constructor Detail

HandlerChain

public HandlerChain()
Creates the HandlerChain with composite message handler.

Method Detail

setFIXSession

public void setFIXSession(ExtendedFIXSession fixSession)
Description copied from interface: SessionMessageHandler
Sets the extended fix session.

Specified by:
setFIXSession in interface SessionMessageHandler
Overrides:
setFIXSession in class AbstractSessionMessageHandler
Parameters:
fixSession - the extended fix session
See Also:
AbstractSessionMessageHandler.setFIXSession(com.epam.fixengine.session.ExtendedFIXSession)

addSessionMessageHandler

public void addSessionMessageHandler(String msgType,
                                     SessionMessageHandler messageHandler)
Adds the specific message handle.

Parameters:
msgType - the message type
messageHandler - - the message handler

addGlobalMessageHandler

public void addGlobalMessageHandler(AbstractGlobalMessageHandler globalMessageHandler)
Adds the global message handler. The handler adds to the end of handlers list.

Parameters:
globalMessageHandler - the global message handler

addGlobalPostProcessMessageHandler

public void addGlobalPostProcessMessageHandler(AbstractGlobalPostProcessSessionMessageHandler globalMessageHandler)
Adds the global message handler. The handler adds to the stert of handlers list.

Parameters:
globalMessageHandler - the global message handler

addGlobalPreProcessMessageHandler

public void addGlobalPreProcessMessageHandler(PreProcessMessageHandler globalMessageHandler)

onNewMessage

public void onNewMessage(FIXFieldList message)
Description copied from interface: FIXMessageListener
This method is invoked every time when FIX Engine receives application message.

Parameters:
message - the incoming message
See Also:
FIXMessageListener.onNewMessage(com.epam.fix.message.FIXFieldList)

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

onMessage

public void onMessage(MsgBuf message)

onPostProcessMessage

public void onPostProcessMessage(MsgBuf message)

onSessionStateChange

public void onSessionStateChange(SessionState sessionState)
See Also:
FIXSessionListener.onSessionStateChange(com.epam.fixengine.SessionState)

setUserListener

public void setUserListener(FIXSessionListener listener)
Sets the user message compositeListener.

Parameters:
listener - the session compositeListener

isNeedPreProcess

public boolean isNeedPreProcess()


Copyright © 2000-2014 EPAM Systems. All Rights Reserved.