|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.oscache.plugins.clustersupport.AbstractBroadcastingListener
com.opensymphony.oscache.plugins.clustersupport.JavaGroupsBroadcastingListener
public class JavaGroupsBroadcastingListener
A concrete implementation of the AbstractBroadcastingListener
based on
the JavaGroups library. This Class uses JavaGroups to broadcast cache flush
messages across a cluster.
One of the following properties should be configured in oscache.properties
for
this listener:
Field Summary |
---|
Fields inherited from class com.opensymphony.oscache.plugins.clustersupport.AbstractBroadcastingListener |
---|
cache, CLUSTER_ORIGIN |
Constructor Summary | |
---|---|
JavaGroupsBroadcastingListener()
|
Method Summary | |
---|---|
void |
finialize()
Shuts down the JavaGroups being managed by this listener. |
Serializable |
getCache()
We are not using the caching, so we just return something that identifies us. |
void |
handleNotification(Serializable serializable)
Handles incoming notification messages from JavaGroups. |
void |
initialize(Cache cache,
Config config)
Initializes the broadcasting listener by starting up a JavaGroups notification bus instance to handle incoming and outgoing messages. |
void |
memberJoined(org.jgroups.Address address)
A callback that is fired when a new member joins the cluster. |
void |
memberLeft(org.jgroups.Address address)
A callback that is fired when an existing member leaves the cluster. |
protected void |
sendNotification(ClusterNotification message)
Uses JavaGroups to broadcast the supplied notification message across the cluster. |
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 |
---|
public JavaGroupsBroadcastingListener()
Method Detail |
---|
public void initialize(Cache cache, Config config) throws InitializationException
initialize
in interface LifecycleAware
initialize
in class AbstractBroadcastingListener
config
- An OSCache configuration object.cache
- the cache instance that this listener is attached to.
InitializationException
- If this listener has
already been initialized.public void finialize() throws FinalizationException
finialize
in interface LifecycleAware
FinalizationException
protected void sendNotification(ClusterNotification message)
sendNotification
in class AbstractBroadcastingListener
message
- The cluster nofication message to broadcast.public void handleNotification(Serializable serializable)
handleNotification
in interface org.jgroups.blocks.NotificationBus.Consumer
serializable
- The incoming message object. This must be a ClusterNotification
.public Serializable getCache()
getCache
in interface org.jgroups.blocks.NotificationBus.Consumer
public void memberJoined(org.jgroups.Address address)
memberJoined
in interface org.jgroups.blocks.NotificationBus.Consumer
address
- The address of the member who just joined.public void memberLeft(org.jgroups.Address address)
memberLeft
in interface org.jgroups.blocks.NotificationBus.Consumer
address
- The address of the member who left.
|
OSCache Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |