org.instrumentmiddleware.cima.extension.handler.impl
Class BodyHandlerList
java.lang.Object
org.instrumentmiddleware.cima.extension.handler.impl.BodyHandlerList
- All Implemented Interfaces:
- IParcelBodyHandler
- Direct Known Subclasses:
- OperationHandler
public class BodyHandlerList
- extends java.lang.Object
- implements IParcelBodyHandler
An implementation of IParcelBodyHandler interface.
This handler contains a list of IParcelBodyHandler handlers. Thus this handler delegates all method
calls to the handlers in the list. In particular, this handler can handle a given body type, only if
there is a handler in its list that can do so, and processing of the body type is delegated to such handler.
- Author:
- Romain
|
Method Summary |
void |
addHandler(IParcelBodyHandler handler)
|
boolean |
canHandle(org.instrumentmiddleware.cima.parcel.BodyType body)
Returns true if this handler can handle the given body type |
protected IParcelBodyHandler |
getHandler(org.instrumentmiddleware.cima.parcel.BodyType body)
|
org.instrumentmiddleware.cima.parcel.ResponseType |
processBody(IPlugin plugin,
org.instrumentmiddleware.cima.parcel.BodyType body,
java.util.Calendar creationTime,
ISession session,
org.instrumentmiddleware.cima.parcel.ResponseType response)
Process the given body. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
handlerList
protected java.util.ArrayList<IParcelBodyHandler> handlerList
BodyHandlerList
public BodyHandlerList()
canHandle
public boolean canHandle(org.instrumentmiddleware.cima.parcel.BodyType body)
- Description copied from interface:
IParcelBodyHandler
- Returns true if this handler can handle the given body type
- Specified by:
canHandle in interface IParcelBodyHandler
- Returns:
- true if this handler can handle the given body type
processBody
public org.instrumentmiddleware.cima.parcel.ResponseType processBody(IPlugin plugin,
org.instrumentmiddleware.cima.parcel.BodyType body,
java.util.Calendar creationTime,
ISession session,
org.instrumentmiddleware.cima.parcel.ResponseType response)
throws PluginException
- Description copied from interface:
IParcelBodyHandler
- Process the given body. The parcel returned is the result of the given body's processing.
This method is called only if this handler has declared it can handle the given body type.
- Specified by:
processBody in interface IParcelBodyHandler
- Parameters:
plugin - The PLUGIN typed parcel recipient.body - The body enclosed within the PLUGIN typed parcelsession - the session this communication belongs toresponse - the partly built response containing top level elements
- Returns:
- a Parcel containing the result of the enclosed body's processing
- Throws:
PluginException - if something goes wong when processing the parcel
addHandler
public void addHandler(IParcelBodyHandler handler)
getHandler
protected IParcelBodyHandler getHandler(org.instrumentmiddleware.cima.parcel.BodyType body)
Copyright © 2008. All Rights Reserved.