public class

GenericApplicationListenerAdapter

extends Object
implements SmartApplicationListener
java.lang.Object
   ↳ org.springframework.context.event.GenericApplicationListenerAdapter

Class Overview

SmartApplicationListener adapter that determines supported event types through introspecting the generically declared type of the target listener.

Summary

[Expand]
Inherited Constants
From interface org.springframework.core.Ordered
Public Constructors
GenericApplicationListenerAdapter(ApplicationListener delegate)
Create a new GenericApplicationListener for the given delegate.
Public Methods
int getOrder()
Return the order value of this object, with a higher value meaning greater in terms of sorting.
void onApplicationEvent(ApplicationEvent event)
boolean supportsEventType(Class<? extends ApplicationEvent> eventType)
Determine whether this listener actually supports the given event type.
boolean supportsSourceType(Class<?> sourceType)
Determine whether this listener actually supports the given source type.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.context.ApplicationListener
From interface org.springframework.context.event.SmartApplicationListener
From interface org.springframework.core.Ordered

Public Constructors

public GenericApplicationListenerAdapter (ApplicationListener delegate)

Create a new GenericApplicationListener for the given delegate.

Parameters
delegate the delegate listener to be invoked

Public Methods

public int getOrder ()

Return the order value of this object, with a higher value meaning greater in terms of sorting.

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).

Returns
  • the order value

public void onApplicationEvent (ApplicationEvent event)

public boolean supportsEventType (Class<? extends ApplicationEvent> eventType)

Determine whether this listener actually supports the given event type.

public boolean supportsSourceType (Class<?> sourceType)

Determine whether this listener actually supports the given source type.