|
spring-context | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.context.event.SourceFilteringListener
public class SourceFilteringListener
ApplicationListener decorator that filters
events from a specified event source, invoking its delegate listener for
matching ApplicationEvent objects only.
Can also be used as base class, overriding the onApplicationEventInternal(org.springframework.context.ApplicationEvent)
method instead of specifying a delegate listener.
| Field Summary |
|---|
| Fields inherited from interface org.springframework.core.Ordered |
|---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
| Constructor Summary | |
|---|---|
protected |
SourceFilteringListener(java.lang.Object source)
Create a SourceFilteringListener for the given event source, expecting subclasses to override the onApplicationEventInternal(org.springframework.context.ApplicationEvent)
method (instead of specifying a delegate listener). |
|
SourceFilteringListener(java.lang.Object source,
ApplicationListener delegate)
Create a SourceFilteringListener for the given event source. |
| Method Summary | |
|---|---|
int |
getOrder()
|
void |
onApplicationEvent(ApplicationEvent event)
Handle an application event. |
protected void |
onApplicationEventInternal(ApplicationEvent event)
Actually process the event, after having filtered according to the desired event source already. |
boolean |
supportsEventType(java.lang.Class<? extends ApplicationEvent> eventType)
Determine whether this listener actually supports the given event type. |
boolean |
supportsSourceType(java.lang.Class<?> sourceType)
Determine whether this listener actually supports the given source type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SourceFilteringListener(java.lang.Object source,
ApplicationListener delegate)
source - the event source that this listener filters for,
only processing events from this sourcedelegate - the delegate listener to invoke with event
from the specified sourceprotected SourceFilteringListener(java.lang.Object source)
onApplicationEventInternal(org.springframework.context.ApplicationEvent)
method (instead of specifying a delegate listener).
source - the event source that this listener filters for,
only processing events from this source| Method Detail |
|---|
public void onApplicationEvent(ApplicationEvent event)
ApplicationListener
onApplicationEvent in interface ApplicationListener<ApplicationEvent>event - the event to respond topublic boolean supportsEventType(java.lang.Class<? extends ApplicationEvent> eventType)
SmartApplicationListener
supportsEventType in interface SmartApplicationListenerpublic boolean supportsSourceType(java.lang.Class<?> sourceType)
SmartApplicationListener
supportsSourceType in interface SmartApplicationListenerpublic int getOrder()
getOrder in interface org.springframework.core.Orderedprotected void onApplicationEventInternal(ApplicationEvent event)
The default implementation invokes the specified delegate, if any.
event - the event to process (matching the specified source)
|
spring-context | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||