Package org.springframework.context.event

# Class DefaultEventListenerFactory

java.lang.Object
org.springframework.context.event.DefaultEventListenerFactory

All Implemented Interfaces:
  `EventListenerFactory`, `org.springframework.core.Ordered`

public class DefaultEventListenerFactory extends Object implements EventListenerFactory, org.springframework.core.Ordered
Default `EventListenerFactory` implementation that supports the regular `EventListener` annotation.

Used as "catch-all" implementation by default.

Since:
  4.2
Author:
  Stephane Nicoll
See Also:
  - `ApplicationListenerMethodAdapter`

## Field Summary

### Fields inherited from interface org.springframework.core.Ordered

`HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

## Constructor Summary

Constructors
Constructor
Description
`DefaultEventListenerFactory()`

## Method Summary

Modifier and Type
Method
Description
`ApplicationListener<?>`
`createApplicationListener(String beanName, Class<?> type, Method method)`
Create an `ApplicationListener` for the specified method.
`int`
`getOrder()`
`void`
`setOrder(int order)`
`boolean`
`supportsMethod(Method method)`
Specify if this factory supports the specified `Method`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DefaultEventListenerFactory

public DefaultEventListenerFactory()

## Method Details

### setOrder

public void setOrder(int order)

### getOrder

public int getOrder()

Specified by:
  `getOrder` in interface `org.springframework.core.Ordered`

### supportsMethod

public boolean supportsMethod(Method method)
Description copied from interface: `EventListenerFactory`
Specify if this factory supports the specified `Method`.

Specified by:
  `supportsMethod` in interface `EventListenerFactory`
Parameters:
  `method` - an `EventListener` annotated method
Returns:
  `true` if this factory supports the specified method

### createApplicationListener

public ApplicationListener<?> createApplicationListener(String beanName, Class<?> type, Method method)
Description copied from interface: `EventListenerFactory`
Create an `ApplicationListener` for the specified method.

Specified by:
  `createApplicationListener` in interface `EventListenerFactory`
Parameters:
  `beanName` - the name of the bean
  `type` - the target type of the instance
  `method` - the `EventListener` annotated method
Returns:
  an application listener, suitable to invoke the specified method