public class DefaultEventListenerFactory extends Object implements EventListenerFactory, Ordered
EventListenerFactory
implementation that supports the
regular EventListener
annotation.
Used as "catch-all" implementation by default.
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
DefaultEventListenerFactory() |
Modifier and Type | Method and Description |
---|---|
ApplicationListener<?> |
createApplicationListener(String beanName,
Class<?> type,
Method method)
Create an
ApplicationListener for the specified method. |
int |
getOrder()
Get the order value of this object.
|
void |
setOrder(int order) |
boolean |
supportsMethod(Method method)
Specify if this factory supports the specified
Method . |
public int getOrder()
Ordered
Higher values are interpreted as lower priority. As a consequence,
the object with the lowest value has the highest priority (somewhat
analogous to Servlet load-on-startup
values).
Same order values will result in arbitrary sort positions for the affected objects.
getOrder
in interface Ordered
Ordered.HIGHEST_PRECEDENCE
,
Ordered.LOWEST_PRECEDENCE
public void setOrder(int order)
public boolean supportsMethod(Method method)
EventListenerFactory
Method
.supportsMethod
in interface EventListenerFactory
method
- an EventListener
annotated methodtrue
if this factory supports the specified methodpublic ApplicationListener<?> createApplicationListener(String beanName, Class<?> type, Method method)
EventListenerFactory
ApplicationListener
for the specified method.createApplicationListener
in interface EventListenerFactory
beanName
- the name of the beantype
- the target type of the instancemethod
- the EventListener
annotated method