com.opensymphony.oscache.plugins.clustersupport
Class JMSBroadcastingListener

java.lang.Object
  extended by com.opensymphony.oscache.plugins.clustersupport.AbstractBroadcastingListener
      extended by com.opensymphony.oscache.plugins.clustersupport.JMSBroadcastingListener
All Implemented Interfaces:
CacheEntryEventListener, CacheEventListener, LifecycleAware, EventListener

public class JMSBroadcastingListener
extends AbstractBroadcastingListener

A JMS based clustering implementation. This implementation is independent of the JMS provider and uses non-persistent messages on a publish subscribe protocol.

Author:
Romulus Pasca

Field Summary
 
Fields inherited from class com.opensymphony.oscache.plugins.clustersupport.AbstractBroadcastingListener
cache, CLUSTER_ORIGIN
 
Constructor Summary
JMSBroadcastingListener()
           
 
Method Summary
 void finialize()
          Called by the cache administrator class when a cache is destroyed.
protected  InitialContext getInitialContext()
           
 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
 

Constructor Detail

JMSBroadcastingListener

public JMSBroadcastingListener()
Method Detail

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:


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.

getInitialContext

protected InitialContext getInitialContext()
                                    throws NamingException
Returns:
creates a context for performing naming operations.
Throws:
NamingException - if a naming exception is encountered

OSCache Project Page