public class AnnotationBasedEventListenerAdapter extends Object implements StoppableEventListener, 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
|
protected void |
handleException(Event event,
Throwable cause)
handleException
|
void |
onEvent(Event event)
Process a sent event.
|
protected void |
postprocessEvent(Event event)
postprocessEvent
|
protected void |
preprocessEvent(Event event)
preprocessEvent
|
protected void |
processEvent(Event 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(Event event)
onEvent
in interface EventListener
event
- a Event
object.protected void postprocessEvent(Event event) throws IllegalAccessException, InvocationTargetException
postprocessEvent
event
- a Event
object.IllegalAccessException
- if any.InvocationTargetException
- if any.protected void processEvent(Event event, Method method) throws IllegalAccessException, InvocationTargetException
processEvent
event
- a Event
object.method
- a Method
object.IllegalAccessException
- if any.InvocationTargetException
- if any.protected void preprocessEvent(Event event) throws IllegalAccessException, InvocationTargetException
preprocessEvent
event
- a Event
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 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 © 2016. All rights reserved.