org.jboss.ha.framework.interfaces
Interface HAPartition

All Known Implementing Classes:
HAPartitionImpl (src)

public interface HAPartition


Nested Class Summary
static interface HAPartition.AsynchHAMembershipExtendedListener (src)
          A tagging interface for HAMembershipExtendedListener callbacks that will be performed in a thread seperate from the JG protocl handler thread.
static interface HAPartition.AsynchHAMembershipListener (src)
          A tagging interface for HAMembershipListener callbacks that will be performed in a thread seperate from the JG protocl handler thread.
static interface HAPartition.HAMembershipExtendedListener (src)
           
static interface HAPartition.HAMembershipListener (src)
          When a new node joins the cluster or an existing node leaves the cluster (or simply dies), membership events are raised.
static interface HAPartition.HAPartitionStateTransfer (src)
          State management is higly important for clustered services.
 
Method Summary
 void callAsynchMethodOnCluster(java.lang.String serviceName, java.lang.String methodName, java.lang.Object[] args, boolean excludeSelf)
          Deprecated. Use callAsynchMethodOnCluster(String, String, Object[], Class[], boolean) instead
 void callAsynchMethodOnCluster(java.lang.String serviceName, java.lang.String methodName, java.lang.Object[] args, java.lang.Class[] types, boolean excludeSelf)
          Invoke a asynchronous RPC call on all nodes of the partition/cluster.
 java.util.ArrayList callMethodOnCluster(java.lang.String serviceName, java.lang.String methodName, java.lang.Object[] args, boolean excludeSelf)
          Deprecated. Use callMethodOnCluster(String, String, Object[], Class[], boolean) instead
 java.util.ArrayList callMethodOnCluster(java.lang.String serviceName, java.lang.String methodName, java.lang.Object[] args, java.lang.Class[] types, boolean excludeSelf)
          Invoke a synchronous RPC call on all nodes of the partition/cluster
 ClusterNode (src) [] getClusterNodes()
          Return the member nodes that built the current view i.e.
 java.util.Vector getCurrentView()
          Return the list of member nodes that built the current view i.e.
 long getCurrentViewId()
          Each time the partition topology changes, a new view is computed.
 DistributedReplicantManager (src) getDistributedReplicantManager()
          Accessor to the DRM that is linked to this partition.
 DistributedState (src) getDistributedStateService()
          Accessor the the DistributedState (DS) that is linked to this partition.
 java.lang.String getNodeName()
          Return the name of the current name in the current partition.
 java.lang.String getPartitionName()
          The name of the partition.
 void registerMembershipListener(HAPartition.HAMembershipListener (src)  listener)
          Subscribes to receive HAPartition.HAMembershipListener (src) events.
 void registerRPCHandler(java.lang.String serviceName, java.lang.Object handler)
          The partition receives RPC calls from other nodes in the cluster and demultiplex them, according to a service name, to a particular service.
 void subscribeToStateTransferEvents(java.lang.String serviceName, HAPartition.HAPartitionStateTransfer (src)  subscriber)
          Register a service that will participate in state transfer protocol and receive callbacks
 void unregisterMembershipListener(HAPartition.HAMembershipListener (src)  listener)
          Unsubscribes from receiving HAPartition.HAMembershipListener (src) events.
 void unregisterRPCHandler(java.lang.String serviceName, java.lang.Object subscriber)
          Unregister the service from the partition
 void unsubscribeFromStateTransferEvents(java.lang.String serviceName, HAPartition.HAPartitionStateTransfer (src)  subscriber)
          Unregister a service from state transfer callbacks.
 

Method Detail

getNodeName

public java.lang.String getNodeName()
Return the name of the current name in the current partition. The name is dynamically determined by the partition.

Returns:
The partition name

getPartitionName

public java.lang.String getPartitionName()
The name of the partition. Either set when creating the partition (MBEAN definition) or uses the default name

Returns:
Name of the current partition

getDistributedReplicantManager

public DistributedReplicantManager (src)  getDistributedReplicantManager()
Accessor to the DRM that is linked to this partition.

Returns:
the DRM linked to this partition

getDistributedStateService

public DistributedState (src)  getDistributedStateService()
Accessor the the DistributedState (DS) that is linked to this partition.

Returns:
the DistributedState service

registerRPCHandler

public void registerRPCHandler(java.lang.String serviceName,
                               java.lang.Object handler)
The partition receives RPC calls from other nodes in the cluster and demultiplex them, according to a service name, to a particular service. Consequently, each service must first subscribe with a particular service name in the partition. The subscriber does not need to implement any specific interface: the call is handled dynamically through reflection.

Parameters:
serviceName - Name of the subscribing service (demultiplexing key)
handler - object to be called when receiving a RPC for its key.

unregisterRPCHandler

public void unregisterRPCHandler(java.lang.String serviceName,
                                 java.lang.Object subscriber)
Unregister the service from the partition

Parameters:
serviceName - Name of the service key (on which the demultiplexing occurs)
subscriber - The target object that unsubscribes

callMethodOnCluster

public java.util.ArrayList callMethodOnCluster(java.lang.String serviceName,
                                               java.lang.String methodName,
                                               java.lang.Object[] args,
                                               java.lang.Class[] types,
                                               boolean excludeSelf)
                                        throws java.lang.Exception
Invoke a synchronous RPC call on all nodes of the partition/cluster

Parameters:
serviceName - Name of the target service name on which calls are de-multiplexed
methodName - name of the Java method to be called on remote services
args - array of Java Object representing the set of parameters to be given to the remote method
types - The types of the parameters
excludeSelf - indicates if the RPC must also be made on the current node of the partition or only on remote nodes
Returns:
an array of answers from remote nodes
Throws:
java.lang.Exception - Throws if a communication exception occurs

callMethodOnCluster

public java.util.ArrayList callMethodOnCluster(java.lang.String serviceName,
                                               java.lang.String methodName,
                                               java.lang.Object[] args,
                                               boolean excludeSelf)
                                        throws java.lang.Exception
Deprecated. Use callMethodOnCluster(String, String, Object[], Class[], boolean) instead

Parameters:
serviceName -
methodName -
args -
excludeSelf -
Returns:
Throws:
java.lang.Exception

callAsynchMethodOnCluster

public void callAsynchMethodOnCluster(java.lang.String serviceName,
                                      java.lang.String methodName,
                                      java.lang.Object[] args,
                                      java.lang.Class[] types,
                                      boolean excludeSelf)
                               throws java.lang.Exception
Invoke a asynchronous RPC call on all nodes of the partition/cluster. The call will return immediately and will not wait that the nodes answer. Thus no answer is available.

Parameters:
serviceName - Name of the target service name on which calls are de-multiplexed
methodName - name of the Java method to be called on remote services
args - array of Java Object representing the set of parameters to be given to the remote method
types - The types of the parameters
excludeSelf - indicates if the RPC must also be made on the current node of the partition or only on remote nodes
Throws:
java.lang.Exception - Throws if a communication exception occurs

callAsynchMethodOnCluster

public void callAsynchMethodOnCluster(java.lang.String serviceName,
                                      java.lang.String methodName,
                                      java.lang.Object[] args,
                                      boolean excludeSelf)
                               throws java.lang.Exception
Deprecated. Use callAsynchMethodOnCluster(String, String, Object[], Class[], boolean) instead

Parameters:
serviceName -
methodName -
args -
excludeSelf -
Throws:
java.lang.Exception

subscribeToStateTransferEvents

public void subscribeToStateTransferEvents(java.lang.String serviceName,
                                           HAPartition.HAPartitionStateTransfer (src)  subscriber)
Register a service that will participate in state transfer protocol and receive callbacks

Parameters:
serviceName - Name of the service that subscribes for state stransfer events. This name must be identical for all identical services in the cluster.
subscriber - Object implementing HAPartition.HAPartitionStateTransfer (src) and providing or receiving state transfer callbacks

unsubscribeFromStateTransferEvents

public void unsubscribeFromStateTransferEvents(java.lang.String serviceName,
                                               HAPartition.HAPartitionStateTransfer (src)  subscriber)
Unregister a service from state transfer callbacks.

Parameters:
serviceName - Name of the service that participates in the state transfer protocol
subscriber - Service implementing the state transfer callback methods

registerMembershipListener

public void registerMembershipListener(HAPartition.HAMembershipListener (src)  listener)
Subscribes to receive HAPartition.HAMembershipListener (src) events.

Parameters:
listener - The membership listener object

unregisterMembershipListener

public void unregisterMembershipListener(HAPartition.HAMembershipListener (src)  listener)
Unsubscribes from receiving HAPartition.HAMembershipListener (src) events.

Parameters:
listener - The listener wishing to unsubscribe

getCurrentViewId

public long getCurrentViewId()
Each time the partition topology changes, a new view is computed. A view is a list of members, the first member being the coordinator of the view. Each view also has a distinct identifier.

Returns:
The identifier of the current view

getCurrentView

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

Returns:
An array of Strings containing the node names

getClusterNodes

public ClusterNode (src) [] getClusterNodes()
Return the member nodes that built the current view i.e. the current partition.

Returns:
An array of ClusterNode containing the node names