@Deprecated public class MuleEventMulticaster extends Object implements org.springframework.context.event.ApplicationEventMulticaster, org.springframework.context.ApplicationContextAware, MuleContextAware, Callable, Initialisable
MuleEventMulticaster is an implementation of a Spring
ApplicationEventMulticaster. This implementation allows Mule event to be sent and
received through the Spring ApplicationContext. This allows any Spring bean to
receive and send events from any transport that Mule supports such as Jms, Http,
Tcp, Pop3, Smtp, File, etc. All a bean needs to do to receive and send events is
to implement MuleEventListener. Beans can also have subscriptions to certain
events by implementing MuleSubscriptionEventListener, where the bean can provide a
list of endpoints on which to receive events i.e.
<bean id="myListener" class="com.foo.MyListener">
<property name="subscriptions">
<list>
<value>jms://customer.support</value>
<value>pop3://support:123456@mail.mycompany.com</value>
</list>
</property>
</bean>
Endpoints are specified as a Mule Url which is used to register a listener
for the subscription In the previous version of the MuleEventMulticaster it was
possible to specify wildcard endpoints. This is still possible but you need to
tell the multicaster which specific endpoints to listen on and then your
subscription listeners can use wildcards. To register the specific endpoints on
the MuleEvent Multicaster you use the subscriptions property.
<bean id="applicationEventMulticaster" class="org.mule.module.spring.events.MuleEventMulticaster">
<property name="subscriptions">
<list>
<value>jms://orders.queue</value>
<value>jms://another.orders.queue</value>
</list>
</property>
</bean>
<bean id="myListener" class="com.foo.MyListener">
<property name="subscriptions">
<list>
<value>jms://*.orders.*.</value>
</list>
</property>
</bean>
MuleEventListener,
MuleSubscriptionEventListener,
Deprecated from 3.6.0.| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.context.ApplicationContext |
applicationContext
Deprecated.
The Spring application context
|
protected boolean |
asynchronous
Deprecated.
Determines whether events will be processed asynchronously
|
protected ExecutorService |
asyncPool
Deprecated.
An ExecutorService for handling asynchronous events
|
static String |
EVENT_MULTICASTER_DESCRIPTOR_NAME
Deprecated.
|
protected ExceptionListener |
exceptionListener
Deprecated.
Used to store parsed endpoints
|
protected Set |
listeners
Deprecated.
The set of listeners for this Multicaster
|
protected static org.apache.commons.logging.Log |
logger
Deprecated.
logger used by this class
|
protected MuleContext |
muleContext
Deprecated.
|
protected Service |
service
Deprecated.
The mule instance component for the Multicaster
|
protected Class<? extends Filter> |
subscriptionFilter
Deprecated.
The filter used to match subscriptions
|
protected String[] |
subscriptions
Deprecated.
A list of endpoints the eventMulticaster will receive events on Note that if
this eventMulticaster has a Mule Descriptor associated with it, these
endpoints are ignored and the ones on the Mule Descriptor are used.
|
PHASE_NAME| Constructor and Description |
|---|
MuleEventMulticaster()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addApplicationListener(org.springframework.context.ApplicationListener listener)
Deprecated.
Adds a listener to the the Multicaster.
|
void |
addApplicationListenerBean(String s)
Deprecated.
|
protected ObjectFilter |
createFilter(String pattern)
Deprecated.
|
protected void |
dispatchEvent(MuleApplicationEvent applicationEvent)
Deprecated.
Will dispatch an application event through Mule
|
protected Service |
getDefaultService()
Deprecated.
|
Class<? extends Filter> |
getSubscriptionFilter()
Deprecated.
the type of filter used to filter subscriptions
|
String[] |
getSubscriptions()
Deprecated.
A list of endpoints the eventMulticaster will receive events on Note that if
this eventMulticaster has a Mule Descriptor associated with it, these
endpoints are ignored and the ones on the Mule Descriptor are used.
|
void |
initialise()
Deprecated.
|
boolean |
isAsynchronous()
Deprecated.
Determines whether events will be processed asynchronously
|
void |
multicastEvent(org.springframework.context.ApplicationEvent e)
Deprecated.
Method is used to dispatch events to listeners registered with the
EventManager or dispatches events to Mule depending on the type and state of
the event received.
|
Object |
onCall(MuleEventContext context)
Deprecated.
This is the callback method used by Mule to give Mule events to this
Multicaster
|
protected void |
registerMulticasterComponent()
Deprecated.
|
void |
removeAllListeners()
Deprecated.
Removes all the listeners from the multicaster
|
void |
removeApplicationListener(org.springframework.context.ApplicationListener listener)
Deprecated.
Removes a listener from the multicaster
|
void |
removeApplicationListenerBean(String s)
Deprecated.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Deprecated.
Set the current Spring application context
|
void |
setAsynchronous(boolean asynchronous)
Deprecated.
Determines whether events will be processed asynchronously
|
protected void |
setExceptionListener(ExceptionListener listener)
Deprecated.
|
void |
setMuleContext(MuleContext context)
Deprecated.
|
void |
setSubscriptionFilter(Class<? extends Filter> subscriptionFilter)
Deprecated.
sets the type of filter used to filter subscriptions
|
void |
setSubscriptions(String[] subscriptions)
Deprecated.
A list of endpoints the eventMulticaster will receive events on Note that if
this eventMulticaster has a Mule Descriptor associated with it, these
endpoints are ignored and the ones on the Mule Descriptor are used.
|
protected void |
setSubscriptionsOnService(Service service)
Deprecated.
|
public static final String EVENT_MULTICASTER_DESCRIPTOR_NAME
protected static final org.apache.commons.logging.Log logger
protected final Set listeners
protected boolean asynchronous
protected ExecutorService asyncPool
protected String[] subscriptions
protected org.springframework.context.ApplicationContext applicationContext
protected Service service
protected Class<? extends Filter> subscriptionFilter
protected ExceptionListener exceptionListener
protected MuleContext muleContext
public void setMuleContext(MuleContext context)
setMuleContext in interface MuleContextAwarepublic void initialise()
throws InitialisationException
initialise in interface InitialisableInitialisationExceptionpublic void addApplicationListener(org.springframework.context.ApplicationListener listener)
AsynchronousMessageListener is used to wrap the listener. This
listener will be initialised with a threadpool. The configuration for the
threadpool can be set on this multicaster or inherited from the MuleManager
configuration, which is good for most cases.addApplicationListener in interface org.springframework.context.event.ApplicationEventMulticasterlistener - the ApplicationListener to register with this MulticasterAsynchronousEventListener,
ThreadingProfilepublic void removeApplicationListener(org.springframework.context.ApplicationListener listener)
removeApplicationListener in interface org.springframework.context.event.ApplicationEventMulticasterlistener - the listener to removepublic void addApplicationListenerBean(String s)
addApplicationListenerBean in interface org.springframework.context.event.ApplicationEventMulticasterpublic void removeApplicationListenerBean(String s)
removeApplicationListenerBean in interface org.springframework.context.event.ApplicationEventMulticasterpublic void removeAllListeners()
removeAllListeners in interface org.springframework.context.event.ApplicationEventMulticasterpublic void multicastEvent(org.springframework.context.ApplicationEvent e)
multicastEvent in interface org.springframework.context.event.ApplicationEventMulticastere - the application event received by the contextpublic boolean isAsynchronous()
public void setAsynchronous(boolean asynchronous)
asynchronous - true if asynchronouspublic Object onCall(MuleEventContext context) throws TransformerException, MalformedEndpointException
onCall in interface Callablecontext - the context received by MuleTransformerExceptionMalformedEndpointExceptionprotected void dispatchEvent(MuleApplicationEvent applicationEvent) throws ApplicationEventException
applicationEvent - the Spring event to be dispatchedApplicationEventException - if the event cannot be dispatched i.e. if
the underlying transport throws an exceptionpublic void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareapplicationContext - application contextorg.springframework.beans.BeansExceptionprotected void registerMulticasterComponent()
throws MuleException
MuleExceptionprotected void setSubscriptionsOnService(Service service) throws MuleException
MuleExceptionprotected Service getDefaultService() throws MuleException
MuleExceptionprotected ObjectFilter createFilter(String pattern)
public Class<? extends Filter> getSubscriptionFilter()
WildcardFilterpublic void setSubscriptionFilter(Class<? extends Filter> subscriptionFilter)
subscriptionFilter - the class of the filter to use.public String[] getSubscriptions()
public void setSubscriptions(String[] subscriptions)
subscriptions - a list of endpoints to listen onprotected void setExceptionListener(ExceptionListener listener)
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.