|
From: Kopylenko, D. <dko...@ac...> - 2003-08-25 19:15:35
|
Hello everybody,
Now there is an EventPublicationInterceptor which could publish any
ApplicationEvent to all the ApplicationListeners registered with
ApplicationContext. It could be used like this:
<bean id="referenceDataChangedEventPublicationInterceptor"
class="org.springframework.context.interceptor.EventPublicationInterceptor">
<property name="applicationEventClassName">
<value>com.mycompany.referencedata.ReferenceDataChangedEvent</value></proper
ty>
</bean>
<bean id="addSomeRefDataMethodPointcut"
class="org.springframework.aop.framework.RegexpMethodPointcut">
<property name="pattern"><value>.*addRefData</value></property>
<property name="interceptor"><ref
bean="referenceDataChangedEventPublicationInterceptor"/></property>
</bean>
<bean id="myBusinessService"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property
name="proxyInterfaces"><value>com.mycompany.MyBusinessService</value></prope
rty>
<property
name="interceptorNames"><value>addSomeRefDataMethodPointcut,myBusinessServic
eTarget</value></property>
</bean>
Please note that the applicationEventClassName property of the
EventPublicationInterceptor must be of type
org.springframework.context.ApplicationEvent
Regards,
Dmitriy.
|