com.opensymphony.oscache.plugins.clustersupport
Class JMS10BroadcastingListener
java.lang.Object
com.opensymphony.oscache.plugins.clustersupport.AbstractBroadcastingListener
com.opensymphony.oscache.plugins.clustersupport.JMS10BroadcastingListener
- All Implemented Interfaces:
- CacheEntryEventListener, CacheEventListener, LifecycleAware, EventListener
public class JMS10BroadcastingListener
- extends AbstractBroadcastingListener
A JMS 1.0.x based clustering implementation. This implementation is independent of
the JMS provider and uses non-persistent messages on a publish subscribe protocol.
- Author:
- Chris Miller
Method Summary |
void |
finialize()
Called by the cache administrator class when a cache is destroyed. |
void |
initialize(Cache cache,
Config config)
Called by the cache administrator class when a cache is instantiated. |
protected void |
sendNotification(ClusterNotification message)
Called when a cluster notification message is to be broadcast. |
Methods inherited from class com.opensymphony.oscache.plugins.clustersupport.AbstractBroadcastingListener |
cacheEntryAdded, cacheEntryFlushed, cacheEntryRemoved, cacheEntryUpdated, cacheFlushed, cacheGroupAdded, cacheGroupEntryAdded, cacheGroupEntryRemoved, cacheGroupFlushed, cacheGroupRemoved, cacheGroupUpdated, cachePatternFlushed, handleClusterNotification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JMS10BroadcastingListener
public JMS10BroadcastingListener()
initialize
public void initialize(Cache cache,
Config config)
throws InitializationException
Called by the cache administrator class when a cache is instantiated.
The JMS broadcasting implementation requires the following configuration
properties to be specified in oscache.properties
:
- cache.cluster.jms.topic.factory - The JMS connection factory to use
- cache.cluster.jms.topic.name - The JMS topic name
- cache.cluster.jms.node.name - The name of this node in the cluster. This should
be unique for each node.
Please refer to the clustering documentation for further details on configuring
the JMS clustered caching.
- Specified by:
initialize
in interface LifecycleAware
- Overrides:
initialize
in class AbstractBroadcastingListener
- Parameters:
cache
- the cache instance that this listener is attached to.config
- The cache's configuration details. This allows the event handler
to initialize itself based on the cache settings, and also to receive additional
settings that were part of the cache configuration but that the cache
itself does not care about. If you are using cache.properties
for your configuration, simply add any additional properties that your event
handler requires and they will be passed through in this parameter.
- Throws:
InitializationException
- thrown when there was a
problem initializing the listener. The cache administrator will log this error and
disable the listener.
finialize
public void finialize()
throws FinalizationException
- Called by the cache administrator class when a cache is destroyed.
- Throws:
FinalizationException
- thrown when there was a problem finalizing the
listener. The cache administrator will catch and log this error.
sendNotification
protected void sendNotification(ClusterNotification message)
- Description copied from class:
AbstractBroadcastingListener
- Called when a cluster notification message is to be broadcast. Implementing
classes should use their underlying transport to broadcast the message across
the cluster.
- Specified by:
sendNotification
in class AbstractBroadcastingListener
- Parameters:
message
- The notification message to broadcast.