public abstract class AbstractMessageInterceptor extends AbstractInterceptor<MessageEvent>
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 flowmetrics
Constructor and Description |
---|
AbstractMessageInterceptor() |
Modifier and Type | Method and Description |
---|---|
void |
init() |
protected boolean |
onUnhandledException(MessageEvent event,
Exception e)
Invoke on unhandled exceptions to define the default behavior of the error handling in the respective event types
|
void |
sendResponse(int code,
String content,
Message message,
Map<String,String> 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, Exception e)
AbstractInterceptor
onUnhandledException
in class AbstractInterceptor<MessageEvent>
event
- the event being handlede
- the exception causing this method to be calledpublic void init()
public void sendResponse(int code, String content, Message message, Map<String,String> 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 responseCopyright © 2010–2016 AdroitLogic. All rights reserved.