FileDocCategorySizeDatePackage
HAPartition.javaAPI DocJBoss 4.2.114924Fri Jul 13 20:52:38 BST 2007org.jboss.ha.framework.interfaces

HAPartition

public interface HAPartition
author
Bill Burke.
author
Sacha Labourey.
version
$Revision: 57188 $

Revisions:

28.07.2002 - Sacha Labourey:

  • Added network-partition merge callback for listeners

Fields Summary
Constructors Summary
Methods Summary
public voidcallAsynchMethodOnCluster(java.lang.String serviceName, java.lang.String methodName, java.lang.Object[] args, boolean excludeSelf)

param
serviceName
param
methodName
param
args
param
excludeSelf
throws
Exception
deprecated
Use {@link #callAsynchMethodOnCluster(String, String, Object[], Class[], boolean)} instead

public voidcallAsynchMethodOnCluster(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. The call will return immediately and will not wait that the nodes answer. Thus no answer is available.

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

public java.util.ArrayListcallMethodOnCluster(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

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

public java.util.ArrayListcallMethodOnCluster(java.lang.String serviceName, java.lang.String methodName, java.lang.Object[] args, boolean excludeSelf)

param
serviceName
param
methodName
param
args
param
excludeSelf
return
throws
Exception
deprecated
Use {@link #callMethodOnCluster(String, String, Object[], Class[], boolean)} instead

public java.util.ArrayListcallMethodOnCoordinatorNode(java.lang.String serviceName, java.lang.String methodName, java.lang.Object[] args, java.lang.Class[] types, boolean excludeSelf)
Calls method on Cluster coordinator node only. The cluster coordinator node is the first node to join the cluster or the first node in the current cluster view.

param
serviceName Name of the target service name on which calls are de-multiplexed
param
methodName name of the Java method to be called on remote services
param
args array of Java Object representing the set of parameters to be given to the remote method
param
types The types of the parameters node of the partition or only on remote nodes
param
excludeSelf indicates if the RPC will be made on the current node even if the current node is the coordinator
throws
Exception Throws if a communication exception occurs
return
an array of answers from remote nodes

public booleangetAllowSynchronousMembershipNotifications()
Returns whether this partition will synchronously notify any HAMembershipListeners of membership changes using the calling thread from the underlying ClusterPartition.

return
true if registered listeners that don't implement AsynchHAMembershipExtendedListener or AsynchHAMembershipListener will be notified synchronously of membership changes; false if those listeners will be notified asynchronously. Default is false.

public ClusterNodegetClusterNode()
Return member node for the current cluster node.

return
ClusterNode containing the current node name

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

return
An array of ClusterNode listing the current members of the partitionn. This array will be in the same order in all nodes in the cluster that have received the current view.

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

return
An array of Strings containing the node names

public longgetCurrentViewId()
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.

return
The identifier of the current view

public DistributedReplicantManagergetDistributedReplicantManager()
Accessor to the DRM that is linked to this partition.

return
the DRM linked to this partition

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

return
the DistributedState service

public java.lang.StringgetNodeName()
Return the name of this node in the current partition. The name is dynamically determined by the partition. The name will be the String returned by getClusterNode().getName().

return
The node name
see
#getClusterNode()

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

return
Name of the current partition

public voidregisterMembershipListener(org.jboss.ha.framework.interfaces.HAPartition$HAMembershipListener listener)
Subscribes to receive {@link HAMembershipListener} events.

param
listener The membership listener object

public voidregisterRPCHandler(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.

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

public voidsetAllowSynchronousMembershipNotifications(boolean allowSync)
Sets whether this partition will synchronously notify any HAMembershipListeners of membership changes using the calling thread from the underlying ClusterPartition.

param
allowSync true if registered listeners that don't implement AsynchHAMembershipExtendedListener or AsynchHAMembershipListener should be notified synchronously of membership changes; false if those listeners can be notified asynchronously. Default is false.

public voidsubscribeToStateTransferEvents(java.lang.String serviceName, org.jboss.ha.framework.interfaces.HAPartition$HAPartitionStateTransfer subscriber)
Register a service that will participate in state transfer protocol and receive callbacks

param
serviceName Name of the service that subscribes for state stransfer events. This name must be identical for all identical services in the cluster.
param
subscriber Object implementing {@link HAPartitionStateTransfer} and providing or receiving state transfer callbacks

public voidunregisterMembershipListener(org.jboss.ha.framework.interfaces.HAPartition$HAMembershipListener listener)
Unsubscribes from receiving {@link HAMembershipListener} events.

param
listener The listener wishing to unsubscribe

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

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

public voidunsubscribeFromStateTransferEvents(java.lang.String serviceName, org.jboss.ha.framework.interfaces.HAPartition$HAPartitionStateTransfer subscriber)
Unregister a service from state transfer callbacks.

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