public class AnnotationBasedEventListenerAdapter extends Object implements StoppableEventListener, ThreadAwareEventListener, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Constructor and Description |
---|
AnnotationBasedEventListenerAdapter()
Constructor for AnnotationBasedEventListenerAdapter.
|
AnnotationBasedEventListenerAdapter(Object annotatedListener,
EventSubscriptionService subscriptionService)
Constructor for AnnotationBasedEventListenerAdapter.
|
AnnotationBasedEventListenerAdapter(String name,
Object annotatedListener,
EventSubscriptionService subscriptionService)
Constructor for AnnotationBasedEventListenerAdapter.
|
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
afterPropertiesSet
|
void |
close()
stop
|
void |
destroy()
destroy
|
String |
getLogPrefix()
getLogPrefix
|
String |
getName()
getName
|
int |
getNumThreads() |
protected void |
handleException(IEvent event,
Throwable cause)
handleException
|
void |
onEvent(IEvent event)
Process a sent event.
|
protected void |
postprocessEvent(IEvent event)
postprocessEvent
|
protected void |
preprocessEvent(IEvent event)
preprocessEvent
|
protected void |
processEvent(IEvent event,
Method method)
processEvent
|
void |
setAnnotatedListener(Object annotatedListener)
setAnnotatedListener
|
void |
setEventSubscriptionService(EventSubscriptionService subscriptionService)
setEventSubscriptionService
|
void |
setLogPrefix(String logPrefix)
setLogPrefix
|
void |
setName(String name)
setName
|
public AnnotationBasedEventListenerAdapter(String name, Object annotatedListener, EventSubscriptionService subscriptionService)
Constructor for AnnotationBasedEventListenerAdapter.
name
- a String
object.annotatedListener
- a Object
object.subscriptionService
- a EventSubscriptionService
object.public AnnotationBasedEventListenerAdapter(Object annotatedListener, EventSubscriptionService subscriptionService)
Constructor for AnnotationBasedEventListenerAdapter.
annotatedListener
- a Object
object.subscriptionService
- a EventSubscriptionService
object.public AnnotationBasedEventListenerAdapter()
Constructor for AnnotationBasedEventListenerAdapter.
public String getName()
getName
getName
in interface EventListener
String
object.public String getLogPrefix()
getLogPrefix
public void setLogPrefix(String logPrefix)
setLogPrefix
logPrefix
- the logPrefix to setpublic void onEvent(IEvent event)
onEvent
in interface EventListener
event
- a IEvent
object.protected void postprocessEvent(IEvent event) throws IllegalAccessException, InvocationTargetException
postprocessEvent
event
- a IEvent
object.IllegalAccessException
- if any.InvocationTargetException
- if any.protected void processEvent(IEvent event, Method method) throws IllegalAccessException, InvocationTargetException
processEvent
event
- a IEvent
object.method
- a Method
object.IllegalAccessException
- if any.InvocationTargetException
- if any.protected void preprocessEvent(IEvent event) throws IllegalAccessException, InvocationTargetException
preprocessEvent
event
- a IEvent
object.IllegalAccessException
- if any.InvocationTargetException
- if any.public void setAnnotatedListener(Object annotatedListener)
setAnnotatedListener
annotatedListener
- a Object
object.public void afterPropertiesSet()
afterPropertiesSet
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
public int getNumThreads()
getNumThreads
in interface ThreadAwareEventListener
public void close()
stop
close
in interface Closeable
close
in interface AutoCloseable
close
in interface StoppableEventListener
public void destroy() throws Exception
destroy
destroy
in interface org.springframework.beans.factory.DisposableBean
Exception
- if any.public void setEventSubscriptionService(EventSubscriptionService subscriptionService)
setEventSubscriptionService
subscriptionService
- a EventSubscriptionService
object.Copyright © 2020. All rights reserved.