public abstract class AbstractMessageInterceptor extends AbstractInterceptor
AbstractInterceptor.intercept(org.adroitlogic.ultraesb.api.interceptor.Event)
method returns false the engine will
discard the message and will not either be further intercepted nor processed.
The available annotations are;
OnRequest
- on a request received event in the message flowOnResponse
- on a response received event in the message flowBeforeSequence
- before starting the processing of a sequence in the message flowAfterSequence
- after finishing the processing of a sequence in the message flowBeforeEndpoint
- before starting the processing of an endpoint in the message flowAfterEndpoint
- after finishing the processing of an endpoint in the message flowConstructor and Description |
---|
AbstractMessageInterceptor() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
onUnhandledException(MessageEvent event,
java.lang.Exception e)
Invoke on unhandled exceptions to define the default behavior of the error handling in the respective event types
|
void |
sendResponse(int code,
java.lang.String content,
Message message,
java.util.Map headers)
Sends the response back to the client and it is expected to drop the message and hence the interceptor logic
should return false if this method is invoked by the interceptor.
|
intercept, interceptWithMetricsAndErrorHandling, setErrorHandler, setMetricsReporter
protected boolean onUnhandledException(MessageEvent event, java.lang.Exception e)
AbstractInterceptor
onUnhandledException
in class AbstractInterceptor
event
- the event being handlede
- the exception causing this method to be calledpublic void sendResponse(int code, java.lang.String content, Message message, java.util.Map headers)
code
- status code of the response, in the case of HTTP the HTTP_SC, for example 500, 404, 200, 401 etc..content
- the message body contentmessage
- current message received by the interceptor in the MessageEvent
headers
- the transport level headers to be attached to the response