org.jboss.ha.framework.server
Class ClusterPartition

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.system.ServiceMBeanSupport (src) 
          extended byorg.jboss.ha.framework.server.ClusterPartition
All Implemented Interfaces:
ClusterPartitionMBean (src) , MBeanRegistration (src) , NotificationBroadcaster (src) , NotificationEmitter (src) , Service (src) , ServiceMBean (src)

public class ClusterPartition
extends ServiceMBeanSupport (src)
implements ClusterPartitionMBean (src)

Management Bean for Cluster HAPartitions. It will start a JGroups channel and initialize the ReplicantManager and DistributedStateService.


Field Summary
protected  org.jgroups.JChannel channel
           
protected  boolean deadlock_detection
           
protected  Debugger debugger
           
protected  java.lang.String jgProps
           
protected  long method_call_timeout
           
protected  java.net.InetAddress nodeAddress
           
protected  java.lang.String nodeName
           
protected  HAPartitionImpl (src) partition
           
protected  java.lang.String partitionName
           
protected  long state_transfer_timeout
          Number of milliseconds to wait until state has been transferred.
protected  boolean use_debugger
           
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src)
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.ha.framework.server.ClusterPartitionMBean (src)
OBJECT_NAME
 
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
ClusterPartition()
           
 
Method Summary
protected  void createService()
          Sub-classes should override this method to provide custum 'create' logic.
protected  java.lang.String generateUniqueNodeName()
           
 java.util.Vector getCurrentView()
          Return the list of member nodes that built from the current view
 boolean getDeadlockDetection()
          Determine if deadlock detection is enabled
 HAPartition (src) getHAPartition()
          Access to the underlying HAPartition without going through JNDI
 java.lang.String getJGroupsVersion()
          The version of JGroups this is running on
 long getMethodCallTimeout()
          Max time (in ms) to wait for synchronous group method calls (HAPartition.callMethodOnCluster(String, String, Object[], Class[], boolean))
 java.lang.String getName()
          Use the short class name as the default for the service name.
 java.net.InetAddress getNodeAddress()
          The node address used to generate the node name
 java.lang.String getNodeName()
          Uniquely identifies this node.
protected  ObjectName (src) getObjectName(MBeanServer (src)  server, ObjectName (src)  name)
          Sub-classes should override this method if they only need to set their object name during MBean pre-registration.
 java.lang.String getPartitionName()
          Name of the partition being built.
 java.lang.String getPartitionProperties()
          Get JGroups property string a la JDBC see JGroups web site for more information
 long getStateTransferTimeout()
           
 void setDeadlockDetection(boolean doit)
           
 void setMethodCallTimeout(long timeout)
           
 void setNodeAddress(java.net.InetAddress address)
           
 void setNodeName(java.lang.String node)
           
 void setPartitionConfig(org.w3c.dom.Element config)
          Convert a list of elements to the JG property string
 void setPartitionName(java.lang.String newName)
           
 void setPartitionProperties(java.lang.String newProps)
           
 void setStateTransferTimeout(long timeout)
           
 java.lang.String showHistory()
           
 java.lang.String showHistoryAsXML()
           
 void startChannelDebugger()
           
 void startChannelDebugger(boolean accumulative)
           
protected  void startService()
          Sub-classes should override this method to provide custum 'start' logic.
 void stopChannelDebugger()
           
protected  void stopService()
          Sub-classes should override this method to provide custum 'stop' logic.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src)
create, destroy, destroyService, getLog, getNextNotificationSequenceNumber, 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, sendNotification
 
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)
getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service (src)
create, destroy, start, stop
 

Field Detail

partitionName

protected java.lang.String partitionName

jgProps

protected java.lang.String jgProps

partition

protected HAPartitionImpl (src)  partition

deadlock_detection

protected boolean deadlock_detection

channel

protected org.jgroups.JChannel channel

debugger

protected Debugger debugger

use_debugger

protected boolean use_debugger

nodeName

protected java.lang.String nodeName

nodeAddress

protected java.net.InetAddress nodeAddress

state_transfer_timeout

protected long state_transfer_timeout
Number of milliseconds to wait until state has been transferred. Increase this value for large states 0 = wait forever


method_call_timeout

protected long method_call_timeout
Constructor Detail

ClusterPartition

public ClusterPartition()
Method Detail

getPartitionName

public java.lang.String getPartitionName()
Description copied from interface: ClusterPartitionMBean (src)
Name of the partition being built. All nodes/services belonging to a partition with the same name are clustered together.

Specified by:
getPartitionName in interface ClusterPartitionMBean (src)

setPartitionName

public void setPartitionName(java.lang.String newName)
Specified by:
setPartitionName in interface ClusterPartitionMBean (src)

getPartitionProperties

public java.lang.String getPartitionProperties()
Description copied from interface: ClusterPartitionMBean (src)
Get JGroups property string a la JDBC see JGroups web site for more information

Specified by:
getPartitionProperties in interface ClusterPartitionMBean (src)

setPartitionProperties

public void setPartitionProperties(java.lang.String newProps)
Specified by:
setPartitionProperties in interface ClusterPartitionMBean (src)

setPartitionConfig

public void setPartitionConfig(org.w3c.dom.Element config)
Convert a list of elements to the JG property string

Specified by:
setPartitionConfig in interface ClusterPartitionMBean (src)

getNodeName

public java.lang.String getNodeName()
Uniquely identifies this node. MUST be unique accros the whole cluster! Cannot be changed once the partition has been started

Specified by:
getNodeName in interface ClusterPartitionMBean (src)

setNodeName

public void setNodeName(java.lang.String node)
                 throws java.lang.Exception
Specified by:
setNodeName in interface ClusterPartitionMBean (src)
Throws:
java.lang.Exception

getNodeAddress

public java.net.InetAddress getNodeAddress()
Description copied from interface: ClusterPartitionMBean (src)
The node address used to generate the node name

Specified by:
getNodeAddress in interface ClusterPartitionMBean (src)

setNodeAddress

public void setNodeAddress(java.net.InetAddress address)
Specified by:
setNodeAddress in interface ClusterPartitionMBean (src)

getJGroupsVersion

public java.lang.String getJGroupsVersion()
Description copied from interface: ClusterPartitionMBean (src)
The version of JGroups this is running on

Specified by:
getJGroupsVersion in interface ClusterPartitionMBean (src)

getStateTransferTimeout

public long getStateTransferTimeout()
Specified by:
getStateTransferTimeout in interface ClusterPartitionMBean (src)

setStateTransferTimeout

public void setStateTransferTimeout(long timeout)
Specified by:
setStateTransferTimeout in interface ClusterPartitionMBean (src)

getMethodCallTimeout

public long getMethodCallTimeout()
Description copied from interface: ClusterPartitionMBean (src)
Max time (in ms) to wait for synchronous group method calls (HAPartition.callMethodOnCluster(String, String, Object[], Class[], boolean))

Specified by:
getMethodCallTimeout in interface ClusterPartitionMBean (src)

setMethodCallTimeout

public void setMethodCallTimeout(long timeout)
Specified by:
setMethodCallTimeout in interface ClusterPartitionMBean (src)

getDeadlockDetection

public boolean getDeadlockDetection()
Description copied from interface: ClusterPartitionMBean (src)
Determine if deadlock detection is enabled

Specified by:
getDeadlockDetection in interface ClusterPartitionMBean (src)

setDeadlockDetection

public void setDeadlockDetection(boolean doit)
Specified by:
setDeadlockDetection in interface ClusterPartitionMBean (src)

getObjectName

protected ObjectName (src)  getObjectName(MBeanServer (src)  server,
                                   ObjectName (src)  name)
                            throws MalformedObjectNameException (src) 
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method if they only need to set their object name during MBean pre-registration.

Overrides:
getObjectName in class ServiceMBeanSupport (src)
Throws:
MalformedObjectNameException (src)

getHAPartition

public HAPartition (src)  getHAPartition()
Description copied from interface: ClusterPartitionMBean (src)
Access to the underlying HAPartition without going through JNDI

Specified by:
getHAPartition in interface ClusterPartitionMBean (src)
Returns:
the HAPartition for the cluster service

getCurrentView

public java.util.Vector getCurrentView()
Return the list of member nodes that built from the current view

Specified by:
getCurrentView in interface ClusterPartitionMBean (src)
Returns:
A Vector Strings representing the host:port values of the nodes

getName

public java.lang.String getName()
Description copied from class: ServiceMBeanSupport (src)
Use the short class name as the default for the service name.

Specified by:
getName in interface ServiceMBean (src)
Overrides:
getName in class ServiceMBeanSupport (src)

createService

protected void createService()
                      throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'create' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
createService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

startService

protected void startService()
                     throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'start' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
startService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

stopService

protected void stopService()
                    throws java.lang.Exception
Description copied from class: ServiceMBeanSupport (src)
Sub-classes should override this method to provide custum 'stop' logic.

This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

Overrides:
stopService in class ServiceMBeanSupport (src)
Throws:
java.lang.Exception

generateUniqueNodeName

protected java.lang.String generateUniqueNodeName()
                                           throws java.lang.Exception
Throws:
java.lang.Exception

showHistory

public java.lang.String showHistory()
Specified by:
showHistory in interface ClusterPartitionMBean (src)

showHistoryAsXML

public java.lang.String showHistoryAsXML()
Specified by:
showHistoryAsXML in interface ClusterPartitionMBean (src)

startChannelDebugger

public void startChannelDebugger()
Specified by:
startChannelDebugger in interface ClusterPartitionMBean (src)

startChannelDebugger

public void startChannelDebugger(boolean accumulative)
Specified by:
startChannelDebugger in interface ClusterPartitionMBean (src)

stopChannelDebugger

public void stopChannelDebugger()
Specified by:
stopChannelDebugger in interface ClusterPartitionMBean (src)