|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.util.JBossNotificationBroadcasterSupport (src) org.jboss.system.ServiceMBeanSupport (src) org.jboss.ha.jmx.HAServiceMBeanSupport
Management Bean for an HA-Service. Provides a convenient common base for cluster symmetric MBeans. This class is also a user transparent extension of the standard NotificationBroadcasterSupport to a clustered environment. Listeners register with their local broadcaster. Invoking sendNotification() on any broadcaster, will notify all listeners in the same cluster partition. TODO: The performance can be further optimized by avoiding broadcast messages when remote listener nodes are not interested (e.g. have no local subscribers) or by iterating locally over filters or remote listeners.
Field Summary |
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src) |
log, server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.system.ServiceMBean (src) |
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
HAServiceMBeanSupport()
|
Method Summary | |
void |
_receiveRemoteNotification(Notification (src) notification)
Invoked by remote broadcasters. |
protected void |
callAsyncMethodOnPartition(java.lang.String methodName,
java.lang.Object[] args,
java.lang.Class[] types)
|
void |
callMethodOnPartition(java.lang.String methodName,
java.lang.Object[] args)
Convenience method for broadcasting a call to all members of a partition. |
void |
callMethodOnPartition(java.lang.String methodName,
java.lang.Object[] args,
java.lang.Class[] types)
|
protected HAPartition (src) |
findHAPartitionWithName(java.lang.String name)
|
java.io.Serializable |
getDistributedState(java.lang.String key)
Convenience method for sharing state across a cluster partition. |
HAPartition (src) |
getPartition()
|
java.lang.String |
getPartitionName()
Name of the underlying partition that determine the cluster to use. |
java.lang.String |
getServiceHAName()
Override this method only if you need to provide a custom partition wide unique service name. |
protected boolean |
isDRMMasterReplica()
|
void |
partitionTopologyChanged(java.util.List newReplicants,
int newReplicantsViewId)
|
protected void |
registerDRMListener()
|
protected void |
registerRPCHandler()
|
void |
sendNotification(Notification (src) notification)
Broadcast the notification to the remote listener nodes (if any) and then invoke super.sendNotification() to notify local listeners. |
protected void |
sendNotificationRemote(Notification (src) notification)
Broadcast a notifcation remotely to the partition participants |
protected void |
sendNotificationToLocalListeners(Notification (src) notification)
|
void |
setDistributedState(java.lang.String key,
java.io.Serializable value)
Convenience method for sharing state across a cluster partition. |
void |
setPartitionName(java.lang.String newPartitionName)
Set the name of the underlying partition that determine the cluster to use. |
protected void |
setupPartition()
|
protected void |
startService()
Implementors of this method should not code the singleton logic here. |
protected void |
stopService()
Attention: Always call this method when you overwrite it in a subclass |
protected void |
unregisterDRMListener()
|
protected void |
unregisterRPCHandler()
|
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src) |
create, createService, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src) |
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.system.ServiceMBean (src) |
getName, getState, getStateString, jbossInternalLifecycle |
Methods inherited from interface org.jboss.system.Service (src) |
create, destroy, start, stop |
Methods inherited from interface javax.management.NotificationBroadcaster (src) |
addNotificationListener, getNotificationInfo, removeNotificationListener |
Constructor Detail |
public HAServiceMBeanSupport()
Method Detail |
public java.lang.String getPartitionName()
HAServiceMBean (src)
getPartitionName
in interface HAServiceMBean (src)
public void setPartitionName(java.lang.String newPartitionName)
HAServiceMBean (src)
setPartitionName
in interface HAServiceMBean (src)
public void setDistributedState(java.lang.String key, java.io.Serializable value) throws java.lang.Exception
setDistributedState
in interface HAServiceMBean (src)
key
- key for the distributed objectvalue
- the distributed object
java.lang.Exception
public java.io.Serializable getDistributedState(java.lang.String key)
getDistributedState
in interface HAServiceMBean (src)
key
- key for the distributed object
protected void startService() throws java.lang.Exception
Implementors of this method should not code the singleton logic here. The MBean lifecycle create/start/stop are separate from the singleton logic. Singleton logic should originate in becomeMaster().
Attention: Always call this method when you overwrite it in a subclass because it elects the master singleton node.
startService
in class ServiceMBeanSupport (src)
java.lang.Exception
protected void stopService() throws java.lang.Exception
Attention: Always call this method when you overwrite it in a subclass
stopService
in class ServiceMBeanSupport (src)
java.lang.Exception
protected void setupPartition() throws java.lang.Exception
java.lang.Exception
protected void registerRPCHandler()
protected void unregisterRPCHandler()
protected void registerDRMListener() throws java.lang.Exception
java.lang.Exception
protected void unregisterDRMListener() throws java.lang.Exception
java.lang.Exception
public void partitionTopologyChanged(java.util.List newReplicants, int newReplicantsViewId)
protected boolean isDRMMasterReplica()
public HAPartition (src) getPartition()
public void callMethodOnPartition(java.lang.String methodName, java.lang.Object[] args) throws java.lang.Exception
callMethodOnPartition(String, Object[], Class[])
instead
HAServiceMBean (src)
callMethodOnPartition
in interface HAServiceMBean (src)
methodName
- args
-
java.lang.Exception
public void callMethodOnPartition(java.lang.String methodName, java.lang.Object[] args, java.lang.Class[] types) throws java.lang.Exception
java.lang.Exception
public void sendNotification(Notification (src) notification)
sendNotification
in interface HAServiceMBean (src)
sendNotification
in class JBossNotificationBroadcasterSupport (src)
notification
- sent out to local listeners and other nodes. It should be serializable.
It is recommended that the source of the notification is an ObjectName of an MBean that
is is available on all nodes where the broadcaster MBean is registered.NotificationBroadcasterSupport.sendNotification(Notification)
protected void sendNotificationToLocalListeners(Notification (src) notification)
protected void callAsyncMethodOnPartition(java.lang.String methodName, java.lang.Object[] args, java.lang.Class[] types) throws java.lang.Exception
java.lang.Exception
protected void sendNotificationRemote(Notification (src) notification) throws java.lang.Exception
notification
-
java.lang.Exception
public void _receiveRemoteNotification(Notification (src) notification)
public java.lang.String getServiceHAName()
protected HAPartition (src) findHAPartitionWithName(java.lang.String name) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |