MessageType
- the type of message being handled@Prototype public abstract class AbstractMessageHandler<MessageType> extends net.shibboleth.utilities.java.support.component.AbstractInitializableComponent implements MessageHandler<MessageType>
MessageHandler
.Constructor and Description |
---|
AbstractMessageHandler() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
doInvoke(MessageContext<MessageType> messageContext)
Performs the handler logic.
|
protected void |
doPostInvoke(MessageContext<MessageType> messageContext)
Called after execution, handlers may override this method to perform post-processing for a request.
|
protected void |
doPostInvoke(MessageContext<MessageType> messageContext,
Exception e)
Called after execution, handlers may override this method to perform post-processing for a request.
|
protected boolean |
doPreInvoke(MessageContext<MessageType> messageContext)
Called prior to execution, handlers may override this method to perform pre-processing for a request.
|
protected String |
getLogPrefix()
Return a prefix for logging messages for this component.
|
void |
invoke(MessageContext<MessageType> messageContext)
Invoke the handler on the specified message context.
|
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
public void invoke(@Nonnull MessageContext<MessageType> messageContext) throws MessageHandlerException
invoke
in interface MessageHandler<MessageType>
messageContext
- the message context on which to invoke the handlerMessageHandlerException
- if the there is an error invoking the handler on the message contextprotected boolean doPreInvoke(@Nonnull MessageContext<MessageType> messageContext) throws MessageHandlerException
If false is returned, execution will not proceed.
If returning successfully, the last step should be to return the result of the superclass version of this method.
messageContext
- the message context on which to invoke the handlerMessageHandlerException
- if there is a problem executing the handler pre-routineprotected abstract void doInvoke(@Nonnull MessageContext<MessageType> messageContext) throws MessageHandlerException
messageContext
- the message context on which to invoke the handlerMessageHandlerException
- if there is an error invoking the handler on the message contextprotected void doPostInvoke(@Nonnull MessageContext<MessageType> messageContext)
Handlers must not "fail" during this step. This method will not be called if doPreInvoke(org.opensaml.messaging.context.MessageContext<MessageType>)
fails, but is
called if an exception is raised by doInvoke(org.opensaml.messaging.context.MessageContext<MessageType>)
.
messageContext
- the message context on which the handler was invokedprotected void doPostInvoke(@Nonnull MessageContext<MessageType> messageContext, @Nonnull Exception e)
Handlers must not "fail" during this step. This method will not be called if doPreInvoke(org.opensaml.messaging.context.MessageContext<MessageType>)
fails, but is
called if an exception is raised by doInvoke(org.opensaml.messaging.context.MessageContext<MessageType>)
.
This version of the method will be called if an exception is raised during execution of the handler. The overall handler result will be to raise this error, so any errors inadvertently raised by this method will be logged and superseded.
The default implementation simply calls the error-less version of this method.
messageContext
- the message context on which the handler was invokede
- an exception raised by the doInvoke(org.opensaml.messaging.context.MessageContext<MessageType>)
methodCopyright © 2016. All rights reserved.