org.apache.cocoon.caching.impl
Class JMSEventMessageListener
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.components.jms.AbstractMessageListener
org.apache.cocoon.caching.impl.JMSEventMessageListener
- All Implemented Interfaces:
- MessageListener, Disposable, Initializable, LogEnabled, Parameterizable, Serviceable, ThreadSafe, JMSConnectionEventListener
public class JMSEventMessageListener
- extends AbstractMessageListener
- implements ThreadSafe
JMS listener will notify an EventAware component
of external events. This could be used for example to do external cache invalidation.
Besides those inherited from
AbstractMessageListener
parameters are:
| parameter |
required |
default |
description |
| eventcache-role |
no |
org.apache.cocoon.caching.Cache/EventAware |
The role name to lookup the event cache from the service manager. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JMSEventMessageListener
public JMSEventMessageListener()
parameterize
public void parameterize(Parameters parameters)
throws ParameterException
- Specified by:
parameterize in interface Parameterizable- Overrides:
parameterize in class AbstractMessageListener
- Throws:
ParameterException
initialize
public void initialize()
throws Exception
- Description copied from class:
AbstractMessageListener
- Registers this MessageListener as a TopicSubscriber to the configured Topic.
- Specified by:
initialize in interface Initializable- Overrides:
initialize in class AbstractMessageListener
- Throws:
Exception
dispose
public void dispose()
- Specified by:
dispose in interface Disposable- Overrides:
dispose in class AbstractMessageListener
onMessage
public void onMessage(Message message)
- Notifies the event cache of events occurred.
- Specified by:
onMessage in interface MessageListener
eventsFromMessage
protected Event[] eventsFromMessage(Message message)
- Convert the message contents to (a series of) cache event. The default implementation
assumes that the message contains the trigger name, a '|', and a table name.
It extracts the tablename and creates a NamedEvent with it.
Override this method to provide a custom message to event mapping.
- Parameters:
message - the JMS message.
- Returns:
- the cache event.
Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.