public class DefaultEventListenerFactory extends java.lang.Object implements EventListenerFactory, Ordered
EventListenerFactory
implementation that supports the
regular EventListener
annotation.
Used as "catch-all" implementation by default.
Modifier and Type | Field and Description |
---|---|
private int |
order |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
DefaultEventListenerFactory() |
Modifier and Type | Method and Description |
---|---|
ApplicationListener<?> |
createApplicationListener(java.lang.String beanName,
java.lang.Class<?> type,
java.lang.reflect.Method method)
Create an
ApplicationListener for the specified method. |
int |
getOrder()
Return the order value of this object, with a
higher value meaning greater in terms of sorting.
|
void |
setOrder(int order) |
boolean |
supportsMethod(java.lang.reflect.Method method)
Specify if this factory supports the specified
Method . |
public int getOrder()
Ordered
Normally starting with 0, with Integer.MAX_VALUE
indicating the greatest value. Same order values will result
in arbitrary positions for the affected objects.
Higher values can be interpreted as lower priority. As a consequence, the object with the lowest value has highest priority (somewhat analogous to Servlet "load-on-startup" values).
public void setOrder(int order)
public boolean supportsMethod(java.lang.reflect.Method method)
EventListenerFactory
Method
.supportsMethod
in interface EventListenerFactory
method
- an EventListener
annotated methodtrue
if this factory supports the specified methodpublic ApplicationListener<?> createApplicationListener(java.lang.String beanName, java.lang.Class<?> type, java.lang.reflect.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