public abstract class AbstractInterceptor<T extends Event> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected InterceptorMetricsReporter |
metrics |
| Constructor and Description |
|---|
AbstractInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract boolean |
intercept(T event)
Intercepts messages, server lifecycle and artifact lifecycle at the point defined by the interceptor annotations
|
boolean |
interceptWithMetricsAndErrorHandling(T event)
Internal method that is used by the ESB to invoke the interceptor, which in-turn will call the
#intercept(T) method providing error handling capabilities to the intercept method invocation
exceptions |
protected abstract boolean |
onUnhandledException(T event,
Exception e)
Invoke on unhandled exceptions to define the default behavior of the error handling in the respective event types
|
void |
setErrorHandler(InterceptorErrorHandler<T> errorHandler)
Sets the error handler for the interceptor
|
void |
setMetricsReporter(InterceptorMetricsReporter metricsReporter)
Sets the metrics reporter for the interceptor
|
protected InterceptorMetricsReporter metrics
protected abstract boolean intercept(T event)
event - the event describing the state for the interceptionprotected abstract boolean onUnhandledException(T event, Exception e)
event - the event being handlede - the exception causing this method to be calledpublic boolean interceptWithMetricsAndErrorHandling(T event)
#intercept(T) method providing error handling capabilities to the intercept method invocation
exceptionsevent - the event which is interceptedpublic void setErrorHandler(InterceptorErrorHandler<T> errorHandler)
errorHandler - the error handler for handling interception errorspublic void setMetricsReporter(InterceptorMetricsReporter metricsReporter)
metricsReporter - the metrics reporting implementation to be usedCopyright © 2010–2016 AdroitLogic. All rights reserved.