Save This Page
Home » JBoss-5.1.0 » 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, KernelControllerContextAware, ServiceMBean, MBeanRegistration, NotificationEmitter

HAPartition implementation based on a JGroups RpcDispatcher and a multiplexed JChannel.
Nested Class Summary:
public static class  ClusterPartition.NoHandlerForRPC  Returned when an RPC call arrives for a service that isn't registered. 
Field Summary
public static final  String DEFAULT_CACHE_CONFIG     
protected  boolean isStateSet    True if serviceState was initialized during start-up. 
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,   callMethodOnCluster,   callMethodOnCoordinatorNode,   callMethodOnCoordinatorNode,   callMethodOnNode,   createService,   destroyService,   fetchState,   getAllowSynchronousMembershipNotifications,   getBindIntoJndi,   getCacheConfigName,   getCacheHandler,   getChannelFactory,   getChannelStackName,   getClusterNode,   getClusterNodes,   getCurrentView,   getCurrentViewId,   getDeadMembers,   getDeadlockDetection,   getDistributedReplicantManager,   getDistributedReplicantManagerImpl,   getDistributedStateService,   getHAPartition,   getHaPartitionDependencyCreator,   getJGroupsVersion,   getMethodCallTimeout,   getNewMembers,   getNodeAddress,   getNodeName,   getPartitionName,   getStateTransferTimeout,   getThreadPool,   isCurrentNodeCoordinator,   logHistory,   notifyListeners,   objectFromByteBufferInternal,   objectFromByteBufferResponseInternal,   objectToByteBufferInternal,   objectToByteBufferResponseInternal,   processEvent,   registerMembershipListener,   registerRPCHandler,   registerRPCHandler,   setAllowSynchronousMembershipNotifications,   setBindIntoJndi,   setCacheHandler,   setDeadlockDetection,   setDistributedStateImpl,   setHaPartitionDependencyCreator,   setKernelControllerContext,   setMethodCallTimeout,   setNodeAddress,   setPartitionName,   setStateTransferTimeout,   setThreadPool,   showHistory,   showHistoryAsXML,   startService,   stopService,   subscribeToStateTransferEvents,   suspect,   translateAddresses,   unblock,   unregisterMembershipListener,   unregisterRPCHandler,   unsetKernelControllerContext,   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:
clone,   equals,   finalize,   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,
    ResponseFilter filter) throws Exception 
 public ArrayList callMethodOnCluster(String objName,
    String methodName,
    Object[] args,
    Class[] types,
    boolean excludeSelf,
    long methodTimeout,
    ResponseFilter filter) 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 HAPartitionCacheHandler getCacheHandler() 
 public ChannelFactory getChannelFactory() 
 public String getChannelStackName() 
 public ClusterNode getClusterNode() 
 public ClusterNode[] getClusterNodes() 
 public Vector<String> getCurrentView() 
 public long getCurrentViewId() 
 protected Vector<ClusterNode> getDeadMembers(Vector<ClusterNode> oldMembers,
    Vector<ClusterNode> 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() 
Deprecated! will - be removed in next major release

    Deprecated; always returns false.
 public DistributedReplicantManager getDistributedReplicantManager() 
 public DistributedReplicantManagerImpl getDistributedReplicantManagerImpl() 
 public DistributedState getDistributedStateService() 
 public HAPartition getHAPartition() 
 public synchronized HAPartitionDependencyCreator getHaPartitionDependencyCreator() 
 public String getJGroupsVersion() 
 public long getMethodCallTimeout() 
 protected Vector<ClusterNode> getNewMembers(Vector<ClusterNode> oldMembers,
    Vector<ClusterNode> 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<HAMembershipListener> theListeners,
    long viewID,
    Vector<ClusterNode> allMembers,
    Vector<ClusterNode> deadMembers,
    Vector<ClusterNode> newMembers,
    Vector<View> 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) 
    Sets whether this partition will synchronously notify any HAPartition.HAMembershipListener of membership changes using the calling thread from the underlying group communications layer (e.g. JGroups).
 public  void setBindIntoJndi(boolean bind) 
 public  void setCacheHandler(HAPartitionCacheHandler cacheHandler) 
 public  void setDeadlockDetection(boolean doit) 
Deprecated! will - be removed in next major release

    Deprecated; logs a WARN message if invoked.
 public  void setDistributedStateImpl(DistributedState distributedState) 
 public synchronized  void setHaPartitionDependencyCreator(HAPartitionDependencyCreator haPartitionDependencyCreator) 
 public  void setKernelControllerContext(KernelControllerContext controllerContext) throws Exception 
 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<ClusterNode> translateAddresses(Vector<Address> addresses) 
 public  void unblock() 
 public  void unregisterMembershipListener(HAMembershipListener listener) 
 public  void unregisterRPCHandler(String objName,
    Object subscriber) 
 public  void unsetKernelControllerContext(KernelControllerContext controllerContext) throws Exception 
 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.