org.springframework.context.event
Class EventPublicationInterceptor

java.lang.Object
  extended byorg.springframework.context.event.EventPublicationInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, ApplicationContextAware, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public class EventPublicationInterceptor
extends java.lang.Object
implements org.aopalliance.intercept.MethodInterceptor, ApplicationContextAware

Interceptor that knows how to publish ApplicationEvents to all ApplicationListeners registered with an ApplicationContext.

Version:
$Id: EventPublicationInterceptor.java,v 1.4 2004/04/01 15:09:31 jhoeller Exp $
Author:
Dmitriy Kopylenko
See Also:
ApplicationEvent, ApplicationListener

Constructor Summary
EventPublicationInterceptor()
           
 
Method Summary
 java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
           
 void setApplicationContext(ApplicationContext applicationContext)
          Set the ApplicationContext that this object runs in.
 void setApplicationEventClass(java.lang.Class applicationEventClass)
          Set the application event class to publish.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventPublicationInterceptor

public EventPublicationInterceptor()
Method Detail

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
Description copied from interface: ApplicationContextAware
Set the ApplicationContext that this object runs in. Normally this call will be used to initialize the object.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ResourceLoaderAware's setResourceLoader.

Specified by:
setApplicationContext in interface ApplicationContextAware
Parameters:
applicationContext - ApplicationContext object to be used by this object
See Also:
BeanInitializationException

setApplicationEventClass

public void setApplicationEventClass(java.lang.Class applicationEventClass)
Set the application event class to publish.

The event class must have a constructor with a single Object argument for the event source. The interceptor will pass in the invoked object.


invoke

public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
                        throws java.lang.Throwable
Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Throws:
java.lang.Throwable


Copyright (C) 2003-2004 The Spring Framework Project.