|
||||||||||
| 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 | |
|---|---|
private org.jgroups.blocks.NotificationBus |
bus
|
private static String |
BUS_NAME
|
private static String |
CHANNEL_PROPERTIES
|
private static String |
DEFAULT_CHANNEL_PROPERTIES_POST
The second half of the default channel properties. |
private static String |
DEFAULT_CHANNEL_PROPERTIES_PRE
The first half of the default channel properties. |
private static String |
DEFAULT_MULTICAST_IP
|
private static Log |
log
|
private static String |
MULTICAST_IP_PROPERTY
|
| 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 |
| Field Detail |
|---|
private static final Log log
private static final String BUS_NAME
private static final String CHANNEL_PROPERTIES
private static final String MULTICAST_IP_PROPERTY
private static final String DEFAULT_CHANNEL_PROPERTIES_PRE
UDP(mcast_addr=*.*.*.*;mcast_port=45566;ip_ttl=32;\ mcast_send_buf_size=150000;mcast_recv_buf_size=80000):\ PING(timeout=2000;num_initial_members=3):\ MERGE2(min_interval=5000;max_interval=10000):\ FD_SOCK:VERIFY_SUSPECT(timeout=1500):\ pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800;max_xmit_size=8192):\ UNICAST(timeout=300,600,1200,2400):\ pbcast.STABLE(desired_avg_gossip=20000):\ FRAG(frag_size=8096;down_thread=false;up_thread=false):\ pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true)Where
*.*.*.* is the specified multicast IP, which defaults to 231.12.21.132.
private static final String DEFAULT_CHANNEL_PROPERTIES_POST
UDP(mcast_addr=*.*.*.*;mcast_port=45566;ip_ttl=32;\ mcast_send_buf_size=150000;mcast_recv_buf_size=80000):\ PING(timeout=2000;num_initial_members=3):\ MERGE2(min_interval=5000;max_interval=10000):\ FD_SOCK:VERIFY_SUSPECT(timeout=1500):\ pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800;max_xmit_size=8192):\ UNICAST(timeout=300,600,1200,2400):\ pbcast.STABLE(desired_avg_gossip=20000):\ FRAG(frag_size=8096;down_thread=false;up_thread=false):\ pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true)Where
*.*.*.* is the specified multicast IP, which defaults to 231.12.21.132.
private static final String DEFAULT_MULTICAST_IP
private org.jgroups.blocks.NotificationBus bus
| Constructor Detail |
|---|
public JavaGroupsBroadcastingListener()
| Method Detail |
|---|
public void initialize(Cache cache,
Config config)
throws InitializationException
initialize in interface LifecycleAwareinitialize in class AbstractBroadcastingListenerconfig - 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 LifecycleAwareFinalizationExceptionprotected void sendNotification(ClusterNotification message)
sendNotification in class AbstractBroadcastingListenermessage - The cluster nofication message to broadcast.public void handleNotification(Serializable serializable)
handleNotification in interface org.jgroups.blocks.NotificationBus.Consumerserializable - The incoming message object. This must be a ClusterNotification.public Serializable getCache()
getCache in interface org.jgroups.blocks.NotificationBus.Consumerpublic void memberJoined(org.jgroups.Address address)
memberJoined in interface org.jgroups.blocks.NotificationBus.Consumeraddress - The address of the member who just joined.public void memberLeft(org.jgroups.Address address)
memberLeft in interface org.jgroups.blocks.NotificationBus.Consumeraddress - The address of the member who left.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||