|
||||||||||
| PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jgroups.blocks.RpcDispatcher
org.jboss.ha.framework.server.HAPartitionImpl
This class is an abstraction class for a JGroups RPCDispatch and JChannel. It is a default implementation of HAPartition for the JGroups framework
| Nested Class Summary |
| Nested classes inherited from class org.jboss.ha.framework.interfaces.HAPartition (src) |
HAPartition.AsynchHAMembershipExtendedListener (src) , HAPartition.AsynchHAMembershipListener (src) , HAPartition.HAMembershipExtendedListener (src) , HAPartition.HAMembershipListener (src) , HAPartition.HAPartitionStateTransfer (src) |
| Field Summary | |
protected java.util.ArrayList |
asynchListeners
The asynch HAMembershipListener and HAMembershipExtendedListeners |
protected java.lang.Thread |
asynchNotifyThread
The Thread used to send membership change notifications asynchronously |
protected LinkedQueue |
asynchViewChanges
The LinkedQueue |
protected JChannel |
channel
The JGroups partition channel |
protected Logger (src) |
clusterLifeCycleLog
|
protected long |
currentViewId
The current cluster view id |
protected DistributedStateImpl (src) |
dsManager
The cluster state manager |
java.util.Vector |
history
|
protected java.util.Vector |
jgmembers
|
protected java.util.Vector |
jgotherMembers
|
protected java.util.ArrayList |
listeners
The HAMembershipListener and HAMembershipExtendedListeners |
protected org.jgroups.stack.IpAddress |
localJGAddress
the local JG IP Address |
protected Logger (src) |
log
The cluster instance log category |
protected ClusterNode (src) |
me
me as a ClusterNode |
protected java.util.Vector |
members
The current cluster partition members |
protected java.lang.String |
nodeName
The cluster transport protocol address string |
protected java.util.Vector |
otherMembers
The partition members other than this node |
protected java.lang.String |
partitionName
The JChannel name |
protected DistributedReplicantManagerImpl (src) |
replicantManager
The cluster replicant manager |
protected java.util.HashMap |
rpcHandlers
|
protected MBeanServer (src) |
server
The JMX MBeanServer to use for registrations |
protected long |
state_transfer_timeout
Number of ms to wait for state |
protected java.util.HashMap |
stateHandlers
|
protected long |
timeout
The timeout for cluster RPC calls |
| Constructor Summary | |
HAPartitionImpl(java.lang.String partitionName,
org.jgroups.JChannel channel,
boolean deadlock_detection)
|
|
HAPartitionImpl(java.lang.String partitionName,
org.jgroups.JChannel channel,
boolean deadlock_detection,
MBeanServer (src) server)
|
|
| Method Summary | |
protected void |
bind(java.lang.String jndiName,
java.lang.Object who,
java.lang.Class classType,
javax.naming.Context ctx)
Helper method that binds the partition in the JNDI tree. |
void |
block()
|
void |
callAsynchMethodOnCluster(java.lang.String objName,
java.lang.String methodName,
java.lang.Object[] args,
boolean excludeSelf)
Deprecated. Use callAsynchMethodOnCluster(String, String, Object[], Class[], boolean) instead |
void |
callAsynchMethodOnCluster(java.lang.String objName,
java.lang.String methodName,
java.lang.Object[] args,
java.lang.Class[] types,
boolean excludeSelf)
This function is an abstraction of RpcDispatcher for asynchronous messages |
java.util.ArrayList |
callMethodOnCluster(java.lang.String objName,
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 objName,
java.lang.String methodName,
java.lang.Object[] args,
java.lang.Class[] types,
boolean excludeSelf)
This function is an abstraction of RpcDispatcher. |
java.util.ArrayList |
callMethodOnCluster(java.lang.String objName,
java.lang.String methodName,
java.lang.Object[] args,
java.lang.Class[] types,
boolean excludeSelf,
long methodTimeout)
|
void |
closePartition()
|
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. |
protected java.util.Vector |
getDeadMembers(java.util.Vector oldMembers,
java.util.Vector newMembers)
Helper method that returns a vector of dead members from two input vectors: new and old vectors of two views. |
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. |
long |
getMethodCallTimeout()
|
protected java.util.Vector |
getNewMembers(java.util.Vector oldMembers,
java.util.Vector allMembers)
Helper method that returns a vector of new members from two input vectors: new and old vectors of two views. |
java.lang.String |
getNodeName()
Return the name of the current name in the current partition. |
java.lang.String |
getPartitionName()
The name of the partition. |
byte[] |
getState()
|
long |
getStateTransferTimeout()
|
java.lang.Object |
handle(Message req)
Message contains MethodCall. |
void |
init()
|
boolean |
isCurrentNodeCoordinator()
|
void |
logHistory(java.lang.String message)
|
protected void |
notifyListeners(java.util.ArrayList theListeners,
long viewID,
java.util.Vector allMembers,
java.util.Vector deadMembers,
java.util.Vector newMembers,
java.util.Vector originatingGroups)
|
static java.lang.Object |
objectFromByteBuffer(byte[] buffer)
Creates an object from a byte buffer |
static byte[] |
objectToByteBuffer(java.lang.Object obj)
Serializes an object into a byte buffer. |
void |
receive(org.jgroups.Message msg)
|
void |
registerMembershipListener(HAPartition.HAMembershipListener (src) listener)
Subscribes to receive HAMembershipListener events. |
void |
registerRPCHandler(java.lang.String objName,
java.lang.Object subscriber)
The partition receives RPC calls from other nodes in the cluster and demultiplex them, according to a service name, to a particular service. |
void |
setMethodCallTimeout(long timeout)
|
void |
setState(byte[] obj)
|
void |
setStateTransferTimeout(long state_transfer_timeout)
|
void |
startPartition()
|
void |
subscribeToStateTransferEvents(java.lang.String objectName,
HAPartition.HAPartitionStateTransfer (src) subscriber)
Register a service that will participate in state transfer protocol and receive callbacks |
void |
suspect(org.jgroups.Address suspected_mbr)
|
protected java.util.Vector |
translateAddresses(java.util.Vector jgAddresses)
|
void |
unregisterMembershipListener(HAPartition.HAMembershipListener (src) listener)
Unsubscribes from receiving HAMembershipListener events. |
void |
unregisterRPCHandler(java.lang.String objName,
java.lang.Object subscriber)
Unregister the service from the partition |
void |
unsubscribeFromStateTransferEvents(java.lang.String objectName,
HAPartition.HAPartitionStateTransfer (src) subscriber)
Unregister a service from state transfer callbacks. |
protected void |
verifyNodeIsUnique(java.util.Vector javaGroupIpAddresses)
|
void |
viewAccepted(View newView)
Notification of a cluster view change. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.HashMap rpcHandlers
protected java.util.HashMap stateHandlers
protected java.util.ArrayList listeners
protected java.util.ArrayList asynchListeners
protected LinkedQueue asynchViewChanges
protected java.lang.Thread asynchNotifyThread
protected java.util.Vector members
protected java.util.Vector jgmembers
public java.util.Vector history
protected java.util.Vector otherMembers
protected java.util.Vector jgotherMembers
protected java.lang.String partitionName
protected org.jgroups.stack.IpAddress localJGAddress
protected java.lang.String nodeName
protected ClusterNode (src) me
protected long timeout
protected JChannel channel
protected DistributedReplicantManagerImpl (src) replicantManager
protected DistributedStateImpl (src) dsManager
protected Logger (src) log
protected Logger (src) clusterLifeCycleLog
protected long currentViewId
protected MBeanServer (src) server
protected long state_transfer_timeout
| Constructor Detail |
public HAPartitionImpl(java.lang.String partitionName,
org.jgroups.JChannel channel,
boolean deadlock_detection,
MBeanServer (src) server)
throws java.lang.Exception
public HAPartitionImpl(java.lang.String partitionName,
org.jgroups.JChannel channel,
boolean deadlock_detection)
throws java.lang.Exception
| Method Detail |
public static java.lang.Object objectFromByteBuffer(byte[] buffer)
throws java.lang.Exception
java.lang.Exception
public static byte[] objectToByteBuffer(java.lang.Object obj)
throws java.lang.Exception
java.lang.Exceptionpublic long getStateTransferTimeout()
public void setStateTransferTimeout(long state_transfer_timeout)
public long getMethodCallTimeout()
public void setMethodCallTimeout(long timeout)
public void init()
throws java.lang.Exception
java.lang.Exception
public void startPartition()
throws java.lang.Exception
java.lang.Exception
public void closePartition()
throws java.lang.Exception
java.lang.Exceptionpublic byte[] getState()
public void setState(byte[] obj)
public void receive(org.jgroups.Message msg)
public void suspect(org.jgroups.Address suspected_mbr)
public void block()
public void viewAccepted(View newView)
newView - public java.lang.String getNodeName()
HAPartition (src)
getNodeName in interface HAPartition (src) public java.lang.String getPartitionName()
HAPartition (src)
getPartitionName in interface HAPartition (src) public DistributedReplicantManager (src) getDistributedReplicantManager()
HAPartition (src)
getDistributedReplicantManager in interface HAPartition (src) public DistributedState (src) getDistributedStateService()
HAPartition (src)
getDistributedStateService in interface HAPartition (src) public long getCurrentViewId()
HAPartition (src)
getCurrentViewId in interface HAPartition (src) public java.util.Vector getCurrentView()
HAPartition (src)
getCurrentView in interface HAPartition (src) public ClusterNode (src) [] getClusterNodes()
HAPartition (src)
getClusterNodes in interface HAPartition (src) public boolean isCurrentNodeCoordinator()
public void registerRPCHandler(java.lang.String objName,
java.lang.Object subscriber)
HAPartition (src)
registerRPCHandler in interface HAPartition (src) objName - Name of the subscribing service (demultiplexing key)subscriber - object to be called when receiving a RPC for its key.
public void unregisterRPCHandler(java.lang.String objName,
java.lang.Object subscriber)
HAPartition (src)
unregisterRPCHandler in interface HAPartition (src) objName - Name of the service key (on which the demultiplexing occurs)subscriber - The target object that unsubscribes
public java.util.ArrayList callMethodOnCluster(java.lang.String objName,
java.lang.String methodName,
java.lang.Object[] args,
boolean excludeSelf)
throws java.lang.Exception
callMethodOnCluster(String,String,Object[],Class[], boolean) instead
callMethodOnCluster in interface HAPartition (src) objName - methodName - args - excludeSelf -
java.lang.Exception
public java.util.ArrayList callMethodOnCluster(java.lang.String objName,
java.lang.String methodName,
java.lang.Object[] args,
java.lang.Class[] types,
boolean excludeSelf)
throws java.lang.Exception
callMethodOnCluster in interface HAPartition (src) objName - Name of the target service name on which calls are de-multiplexedmethodName - name of the Java method to be called on remote servicesargs - array of Java Object representing the set of parameters to be
given to the remote methodtypes - The types of the parametersexcludeSelf - indicates if the RPC must also be made on the current
node of the partition or only on remote nodes
java.lang.Exception - Throws if a communication exception occurs
public java.util.ArrayList callMethodOnCluster(java.lang.String objName,
java.lang.String methodName,
java.lang.Object[] args,
java.lang.Class[] types,
boolean excludeSelf,
long methodTimeout)
throws java.lang.Exception
java.lang.Exception
public void callAsynchMethodOnCluster(java.lang.String objName,
java.lang.String methodName,
java.lang.Object[] args,
boolean excludeSelf)
throws java.lang.Exception
callAsynchMethodOnCluster(String, String, Object[], Class[], boolean) instead
callAsynchMethodOnCluster in interface HAPartition (src) objName - methodName - args - excludeSelf -
java.lang.Exception
public void callAsynchMethodOnCluster(java.lang.String objName,
java.lang.String methodName,
java.lang.Object[] args,
java.lang.Class[] types,
boolean excludeSelf)
throws java.lang.Exception
callAsynchMethodOnCluster in interface HAPartition (src) objName - Name of the target service name on which calls are de-multiplexedmethodName - name of the Java method to be called on remote servicesargs - array of Java Object representing the set of parameters to be
given to the remote methodtypes - The types of the parametersexcludeSelf - indicates if the RPC must also be made on the current
node of the partition or only on remote nodes
java.lang.Exception - Throws if a communication exception occurs
public void subscribeToStateTransferEvents(java.lang.String objectName,
HAPartition.HAPartitionStateTransfer (src) subscriber)
HAPartition (src)
subscribeToStateTransferEvents in interface HAPartition (src) objectName - 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
public void unsubscribeFromStateTransferEvents(java.lang.String objectName,
HAPartition.HAPartitionStateTransfer (src) subscriber)
HAPartition (src)
unsubscribeFromStateTransferEvents in interface HAPartition (src) objectName - Name of the service that participates in the state transfer protocolsubscriber - Service implementing the state transfer callback methodspublic void registerMembershipListener(HAPartition.HAMembershipListener (src) listener)
HAPartition (src) HAPartition.HAMembershipListener (src) events.
registerMembershipListener in interface HAPartition (src) listener - The membership listener objectpublic void unregisterMembershipListener(HAPartition.HAMembershipListener (src) listener)
HAPartition (src) HAPartition.HAMembershipListener (src) events.
unregisterMembershipListener in interface HAPartition (src) listener - The listener wishing to unsubscribepublic java.lang.Object handle(Message req)
req - The org.jgroups. representation of the method invocation
protected void verifyNodeIsUnique(java.util.Vector javaGroupIpAddresses)
throws java.lang.Exception
java.lang.Exception
protected void bind(java.lang.String jndiName,
java.lang.Object who,
java.lang.Class classType,
javax.naming.Context ctx)
throws java.lang.Exception
jndiName - Name under which the object must be boundwho - Object to bind in JNDIclassType - Class type under which should appear the bound objectctx - Naming context under which we bind the object
java.lang.Exception - Thrown if a naming exception occurs during binding
protected java.util.Vector getDeadMembers(java.util.Vector oldMembers,
java.util.Vector newMembers)
oldMembers - Vector of old membersnewMembers - Vector of new members
protected java.util.Vector getNewMembers(java.util.Vector oldMembers,
java.util.Vector allMembers)
oldMembers - Vector of old membersallMembers - Vector of new members
protected void notifyListeners(java.util.ArrayList theListeners,
long viewID,
java.util.Vector allMembers,
java.util.Vector deadMembers,
java.util.Vector newMembers,
java.util.Vector originatingGroups)
protected java.util.Vector translateAddresses(java.util.Vector jgAddresses)
public void logHistory(java.lang.String message)
|
||||||||||
| PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||