Package org.apache.axis2.handlers
Class AbstractTemplatedHandler
- java.lang.Object
-
- org.apache.axis2.handlers.AbstractHandler
-
- org.apache.axis2.handlers.AbstractTemplatedHandler
-
- All Implemented Interfaces:
Handler
- Direct Known Subclasses:
AddressingInHandler
,AddressingOutHandler
,MustUnderstandChecker
public abstract class AbstractTemplatedHandler extends AbstractHandler
This abstract class differentiates the concern of the conditional check to see whether this particular message needs to be handled by the handler implementation and the actual invocation logic.- See Also:
AbstractHandler
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.axis2.engine.Handler
Handler.InvocationResponse
-
-
Field Summary
-
Fields inherited from class org.apache.axis2.handlers.AbstractHandler
handlerDesc
-
-
Constructor Summary
Constructors Constructor Description AbstractTemplatedHandler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Handler.InvocationResponse
doInvoke(MessageContext msgCtx)
This should implement the actual handler invocation logic.Handler.InvocationResponse
invoke(MessageContext msgContext)
Implements the separation of the conditional check and the actual logicabstract boolean
shouldInvoke(MessageContext msgCtx)
This method should implement the conditional check of the handler to decide whether this particular message needs to be handled by me-
Methods inherited from class org.apache.axis2.handlers.AbstractHandler
flowComplete, getHandlerDesc, getName, getParameter, init, toString
-
-
-
-
Method Detail
-
invoke
public final Handler.InvocationResponse invoke(MessageContext msgContext) throws AxisFault
Implements the separation of the conditional check and the actual logic- Parameters:
msgContext
- theMessageContext
to process with thisHandler
.- Returns:
- CONTINUE if the handler implementation says 'should not be invoked'
or the result of the
doInvoke(org.apache.axis2.context.MessageContext)
- Throws:
AxisFault
- if thedoInvoke(org.apache.axis2.context.MessageContext)
throws the same
-
shouldInvoke
public abstract boolean shouldInvoke(MessageContext msgCtx) throws AxisFault
This method should implement the conditional check of the handler to decide whether this particular message needs to be handled by me- Parameters:
msgCtx
- currentMessageContext
to be evaluated- Returns:
- boolean
true
, if this handler needs to be further invoked,
false
if this handler has nothing to do with this specific message and want the flow to be continued - Throws:
AxisFault
- in an error in evaluating the decision
-
doInvoke
public abstract Handler.InvocationResponse doInvoke(MessageContext msgCtx) throws AxisFault
This should implement the actual handler invocation logic.- Parameters:
msgCtx
- current message to be handled by this handler- Returns:
- flow completion decision, should be one of
Handler.InvocationResponse.CONTINUE
,Handler.InvocationResponse.ABORT
,Handler.InvocationResponse.SUSPEND
- Throws:
AxisFault
- in an error in invoking the handler
-
-