org.instrumentmiddleware.cima.extension.handler
Interface IParcelBodyHandler

All Known Implementing Classes:
AbstractSingleBodyHandler, BodyHandlerList, OperationHandler, OperationHandler.CommandOperationHandler, OperationHandler.GetCIMAOperationHandler, OperationHandler.GetPluginOperationHandler, OperationHandler.SetCIMAOperationHandler, OperationHandler.SetPluginOperationHandler

public interface IParcelBodyHandler

A handler for a particular body type implementation. A class implementing this interface declares if it can handle thus process a particular body type implementation. When a PLUGIN typed parcel is received by a plugin, this plugin asks the ExtensionManager to find a handler that can process the body enclosed in the parcel. The ExtensionManager uses IParcelBodyHandler canHandle method to find such handler among existing handlers. If an IParcelBodyHandler is found, processParcel method is called to handle the body.

Author:
Romain

Method Summary
 boolean canHandle(org.instrumentmiddleware.cima.parcel.BodyType body)
          Returns true if this handler can handle the given body type
 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.
 

Method Detail

processBody

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
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.

Parameters:
plugin - The PLUGIN typed parcel recipient.
body - The body enclosed within the PLUGIN typed parcel
session - the session this communication belongs to
response - 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

canHandle

boolean canHandle(org.instrumentmiddleware.cima.parcel.BodyType body)
Returns true if this handler can handle the given body type

Parameters:
body -
Returns:
true if this handler can handle the given body type


Copyright © 2008. All Rights Reserved.