com.sourceforge.jpatterns.patterns.bhv.chain
Interface IChainHandler


public interface IChainHandler

This class is served as handler of the messages by types and by my implementations of IChainMessage specified. It could also see not only the implementation of the message but also its type and composition of the inout params. It allows to provide output params (in that view IChainMessage is Data Trasnfer Object). todo: method for checking the permissions on the changing inputs/outputs todo: method answering the questions: forward/include/ next chain ??? todo: method saying if it rewriting output/ does this extend the input. todo: !!! we could chain the handlers using appropriate parents' handlers of this type of message or could chain the handlers of this chain item todo: IHandlersChain running all the hadnlers of this chain item for appropriate type of message and then passing the control above. dfvgsdg $Author:: zmicer $


Method Summary
 boolean doesMessageFit(IChainMessage message)
          Answers the question if the specified message fits this handler (could be handled by it).
 boolean doesMessageFit(String message)
          Answers the question if the specified message fits this handler (could be handled by it).
 String getType()
           
 void handleMessage(IChainMessage message, IHierarchyItem chainItem)
          Handle the message.
 void handleMessage(String message)
          Handle the message.
 void handleMessage(String message, IHierarchyItem chainItem)
          Handle the message.
 

Method Detail

getType

String getType()
Returns:
the type of the chain handler. This type is useful when we need to divide some instances of the same implementation on the groups. Could be null if this info is not valuable at the context of the implementation of the handler.

doesMessageFit

boolean doesMessageFit(String message)
Answers the question if the specified message fits this handler (could be handled by it). The specifics of this info is specified at the configuration of system (it is implementation specific info).

Parameters:
message - for which we need to answer the question above. Can not be null (otherwise IllegalArgumentException would appear).
Returns:
true if message could handle the message and false otherwise.

doesMessageFit

boolean doesMessageFit(IChainMessage message)
Answers the question if the specified message fits this handler (could be handled by it). The specifics of this info is specified at the configuration of system (it is implementation specific info).

Parameters:
message - for which we need to answer the question above. Can not be null (otherwise IllegalArgumentException would appear).
Returns:
true if message could handle the message and false otherwise.

handleMessage

void handleMessage(String message)
                   throws UnsupportedOperationException
Handle the message. t todo: think of the return type - status etc?? todo: think if this method operating with string is usefull??? where it could be used???

Parameters:
message - which we need to handle. Can not be null (otherwise IllegalArgumentException would appear).
Throws:
UnsupportedOperationException - in the case it can not handle the message (not permissions/illegal type of message etc.)

handleMessage

void handleMessage(String message,
                   IHierarchyItem chainItem)
                   throws UnsupportedOperationException
Handle the message. The chain item is specified too to allow handler to perform chaining the handlers ot to call chain methods of the above chain items etc. todo: see IHandlersChain todo: think of the return type - status etc?? todo: think if this method operating with string is usefull??? where it could be used???

Parameters:
message - which we need to handle. Can not be null (otherwise IllegalArgumentException would appear).
chainItem - the current chain item calling this
Throws:
UnsupportedOperationException - in the case it can not handle the message (not permissions/illegal type of message etc.)

handleMessage

void handleMessage(IChainMessage message,
                   IHierarchyItem chainItem)
                   throws UnsupportedOperationException
Handle the message. The chain item is specified too to allow handler to perform chaining the handlers ot to call chain methods of the above chain items etc. todo: see IHandlersChain

Parameters:
message - which we need to handle. Can not be null (otherwise IllegalArgumentException would appear).
Throws:
UnsupportedOperationException - in the case it can not handle the message (not permissions/illegal type of message etc.)


Copyright © 2007 jzmicer.team. All Rights Reserved.