Save This Page
Home » jboss-5.0.0.CR1-src » org.jboss.ha.framework » server » [javadoc | source]
org.jboss.ha.framework.server
public class: ClusterPartition [javadoc | source]
java.lang.Object
   org.jboss.mx.util.JBossNotificationBroadcasterSupport
      org.jboss.system.ServiceMBeanSupport
         org.jboss.ha.framework.server.ClusterPartition

All Implemented Interfaces:
    HAPartition, org.jgroups.ExtendedMembershipListener, AsynchEventProcessor, ClusterPartitionMBean, org.jboss.kernel.spi.dependency.KernelControllerContextAware, ServiceMBean, MBeanRegistration, NotificationEmitter

HAPartition implementation based on a JGroups RpcDispatcher and a multiplexed JChannel.
Field Summary
public static final  String DEFAULT_CACHE_CONFIG     
protected  Map rpcHandlers     
protected  Map stateHandlers     
protected  boolean allowSyncListeners    Do we send any membership change notifications synchronously? 
protected  ArrayList synchListeners    The HAMembershipListener and HAMembershipExtendedListeners 
protected  ArrayList asynchListeners    The asynch HAMembershipListener and HAMembershipExtendedListeners 
protected  AsynchEventHandler asynchHandler    The handler used to send membership change notifications asynchronously 
protected  Vector members    The current cluster partition members 
protected  Vector jgmembers     
protected  Map clmap     
public  Vector history     
protected  Vector otherMembers    The partition members other than this node 
protected  Vector jgotherMembers     
protected  Address localJGAddress    the local JG IP Address 
protected  String nodeName    The cluster transport protocol address string 
protected  ClusterNode me    me as a ClusterNode 
protected  Channel channel    The JGroups partition channel 
protected  DistributedReplicantManagerImpl replicantManager    The cluster replicant manager 
protected  DistributedStateImpl distributedState    The DistributedState service we manage 
protected  Logger log    The cluster instance log category 
protected  Logger clusterLifeCycleLog     
protected  long currentViewId    The current cluster view id 
protected  boolean bindIntoJndi    Whether to bind the partition into JNDI 
protected  boolean isStateSet    True if serviceState was initialized during start-up. 
protected  Exception setStateException    An exception occuring upon fetch serviceState. 
protected  Exception connectException    An exception occuring during channel connect 
Fields inherited from org.jboss.system.ServiceMBeanSupport:
SERVICE_CONTROLLER_SIG,  log,  server,  serviceName
Constructor:
 public ClusterPartition() 
Method from org.jboss.ha.framework.server.ClusterPartition Summary:
bind,   block,   callAsyncMethodOnNode,   callAsynchMethodOnCluster,   callMethodOnCluster,   callMethodOnCluster,   callMethodOnCoordinatorNode,   callMethodOnCoordinatorNode,   callMethodOnNode,   createService,   destroyService,   fetchState,   getAllowSynchronousMembershipNotifications,   getBindIntoJndi,   getCacheConfigName,   getCacheManager,   getChannelFactory,   getChannelStackName,   getClusterNode,   getClusterNodes,   getClusteredCache,   getCurrentView,   getCurrentViewId,   getDeadMembers,   getDeadlockDetection,   getDistributedReplicantManager,   getDistributedStateService,   getHAPartition,   getJGroupsVersion,   getMethodCallTimeout,   getNewMembers,   getNodeAddress,   getNodeName,   getPartitionName,   getStateTransferTimeout,   getThreadPool,   isCurrentNodeCoordinator,   logHistory,   notifyListeners,   objectFromByteBufferInternal,   objectFromByteBufferResponseInternal,   objectToByteBufferInternal,   objectToByteBufferResponseInternal,   processEvent,   registerMembershipListener,   registerRPCHandler,   registerRPCHandler,   setAllowSynchronousMembershipNotifications,   setBindIntoJndi,   setCacheConfigName,   setCacheManager,   setDeadlockDetection,   setDistributedReplicantManagerImpl,   setDistributedStateImpl,   setMethodCallTimeout,   setNodeAddress,   setPartitionName,   setStateTransferTimeout,   setThreadPool,   showHistory,   showHistoryAsXML,   startService,   stopService,   subscribeToStateTransferEvents,   suspect,   translateAddresses,   unblock,   unregisterMembershipListener,   unregisterRPCHandler,   unsubscribeFromStateTransferEvents,   verifyNodeIsUnique,   viewAccepted
Methods from org.jboss.system.ServiceMBeanSupport:
create,   createService,   destroy,   destroyService,   getDeploymentInfo,   getLog,   getName,   getNextNotificationSequenceNumber,   getObjectName,   getServer,   getServiceName,   getState,   getStateString,   jbossInternalCreate,   jbossInternalDescription,   jbossInternalDestroy,   jbossInternalLifecycle,   jbossInternalStart,   jbossInternalStop,   pojoChange,   pojoCreate,   pojoDestroy,   pojoStart,   pojoStop,   postDeregister,   postRegister,   preDeregister,   preRegister,   setKernelControllerContext,   start,   startService,   stop,   stopService,   unsetKernelControllerContext
Methods from org.jboss.mx.util.JBossNotificationBroadcasterSupport:
addNotificationListener,   getNotificationInfo,   handleNotification,   nextNotificationSequenceNumber,   removeNotificationListener,   removeNotificationListener,   sendNotification
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jboss.ha.framework.server.ClusterPartition Detail:
 protected  void bind(String jndiName,
    Object who,
    Class classType,
    Context ctx) throws Exception 
    Helper method that binds the partition in the JNDI tree.
 public  void block() 
 public  void callAsyncMethodOnNode(String serviceName,
    String methodName,
    Object[] args,
    Class[] types,
    long methodTimeout,
    ClusterNode targetNode) throws Throwable 
    Calls method on target node only.
 public  void callAsynchMethodOnCluster(String objName,
    String methodName,
    Object[] args,
    Class[] types,
    boolean excludeSelf) throws Exception 
    This function is an abstraction of RpcDispatcher for asynchronous messages
 public ArrayList callMethodOnCluster(String objName,
    String methodName,
    Object[] args,
    Class[] types,
    boolean excludeSelf) throws Exception 
    This function is an abstraction of RpcDispatcher.
 public ArrayList callMethodOnCluster(String objName,
    String methodName,
    Object[] args,
    Class[] types,
    boolean excludeSelf,
    long methodTimeout) throws Exception 
 public ArrayList callMethodOnCoordinatorNode(String objName,
    String methodName,
    Object[] args,
    Class[] types,
    boolean excludeSelf) throws Exception 
    Calls method on Cluster coordinator node only. The cluster coordinator node is the first node to join the cluster. and is replaced
 public ArrayList callMethodOnCoordinatorNode(String objName,
    String methodName,
    Object[] args,
    Class[] types,
    boolean excludeSelf,
    long methodTimeout) throws Exception 
    Calls method on Cluster coordinator node only. The cluster coordinator node is the first node to join the cluster. and is replaced
 public Object callMethodOnNode(String serviceName,
    String methodName,
    Object[] args,
    Class[] types,
    long methodTimeout,
    ClusterNode targetNode) throws Throwable 
    Calls method synchrounously on target node only.
 protected  void createService() throws Exception 
 protected  void destroyService() throws Exception 
 protected  void fetchState() throws Exception 
 public boolean getAllowSynchronousMembershipNotifications() 
 public boolean getBindIntoJndi() 
 public String getCacheConfigName() 
 public CacheManager getCacheManager() 
 public ChannelFactory getChannelFactory() 
 public String getChannelStackName() 
 public ClusterNode getClusterNode() 
 public ClusterNode[] getClusterNodes() 
 public Cache getClusteredCache() 
 public Vector getCurrentView() 
 public long getCurrentViewId() 
 protected Vector getDeadMembers(Vector oldMembers,
    Vector newMembers) 
    Helper method that returns a vector of dead members from two input vectors: new and old vectors of two views. Dead members are old - new members.
 public boolean getDeadlockDetection() 
 public DistributedReplicantManager getDistributedReplicantManager() 
 public DistributedState getDistributedStateService() 
 public HAPartition getHAPartition() 
 public String getJGroupsVersion() 
 public long getMethodCallTimeout() 
 protected Vector getNewMembers(Vector oldMembers,
    Vector allMembers) 
    Helper method that returns a vector of new members from two input vectors: new and old vectors of two views.
 public InetAddress getNodeAddress() 
 public String getNodeName() 
 public String getPartitionName() 
 public long getStateTransferTimeout() 
 public ThreadPool getThreadPool() 
 public boolean isCurrentNodeCoordinator() 
 public  void logHistory(String message) 
 protected  void notifyListeners(ArrayList theListeners,
    long viewID,
    Vector allMembers,
    Vector deadMembers,
    Vector newMembers,
    Vector originatingGroups) 
 protected Object objectFromByteBufferInternal(byte[] buffer) throws Exception 
    Creates an object from a byte buffer
 protected Object objectFromByteBufferResponseInternal(byte[] buffer) throws Exception 
    Creates a response object from a byte buffer - optimized for response marshalling
 protected byte[] objectToByteBufferInternal(Object obj) throws Exception 
    Serializes an object into a byte buffer. The object has to implement interface Serializable or Externalizable
 protected byte[] objectToByteBufferResponseInternal(Object obj) throws Exception 
    Serializes a response object into a byte buffer, optimized for response marshalling. The object has to implement interface Serializable or Externalizable
 public  void processEvent(Object event) 
 public  void registerMembershipListener(HAMembershipListener listener) 
 public  void registerRPCHandler(String objName,
    Object subscriber) 
 public  void registerRPCHandler(String objName,
    Object subscriber,
    ClassLoader classloader) 
 public  void setAllowSynchronousMembershipNotifications(boolean allowSync) 
 public  void setBindIntoJndi(boolean bind) 
 public  void setCacheConfigName(String cacheConfigName) 
 public  void setCacheManager(CacheManager cacheManager) 
 public  void setDeadlockDetection(boolean doit) 
 public  void setDistributedReplicantManagerImpl(DistributedReplicantManagerImpl drm) 
 public  void setDistributedStateImpl(DistributedStateImpl distributedState) 
 public  void setMethodCallTimeout(long timeout) 
 public  void setNodeAddress(InetAddress address) 
 public  void setPartitionName(String newName) 
 public  void setStateTransferTimeout(long timeout) 
 public  void setThreadPool(ThreadPool threadPool) 
 public String showHistory() 
 public String showHistoryAsXML() 
 protected  void startService() throws Exception 
 protected  void stopService() throws Exception 
 public  void subscribeToStateTransferEvents(String objectName,
    HAPartitionStateTransfer subscriber) 
 public  void suspect(Address suspected_mbr) 
 protected Vector translateAddresses(Vector addresses) 
 public  void unblock() 
 public  void unregisterMembershipListener(HAMembershipListener listener) 
 public  void unregisterRPCHandler(String objName,
    Object subscriber) 
 public  void unsubscribeFromStateTransferEvents(String objectName,
    HAPartitionStateTransfer subscriber) 
 protected  void verifyNodeIsUnique() throws IllegalStateException 
 public  void viewAccepted(View newView) 
    Notification of a cluster view change. This is done from the JG protocol handlder thread and we must be careful to not unduly block this thread. Because of this there are two types of listeners, synchronous and asynchronous. The synchronous listeners are messaged with the view change event using the calling thread while the asynchronous listeners are messaged using a seperate thread.