| org.jboss.ha.framework.server.HAPartitionImpl
HAPartitionImpl | public class HAPartitionImpl extends org.jgroups.blocks.RpcDispatcher implements org.jgroups.MessageListener,org.jgroups.MembershipListener,HAPartition,AsynchEventHandler.AsynchEventProcessor(Code) | | This class is an abstraction class for a JGroups RPCDispatch and JChannel.
It is a default implementation of HAPartition for the
JGroups framework
author: Sacha Labourey. author: Bill Burke. author: Scott.Stark@jboss.org version: $Revision: 62255 $ |
Method Summary | |
protected void | bind(String jndiName, Object who, Class classType, Context ctx) Helper method that binds the partition in the JNDI tree. | public void | block() | public void | callAsynchMethodOnCluster(String objName, String methodName, Object[] args, boolean excludeSelf) | public void | callAsynchMethodOnCluster(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf) | public ArrayList | callMethodOnCluster(String objName, String methodName, Object[] args, boolean excludeSelf) | public ArrayList | callMethodOnCluster(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf) This function is an abstraction of RpcDispatcher. | public ArrayList | callMethodOnCluster(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf, long methodTimeout) | public ArrayList | callMethodOnCoordinatorNode(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf) Calls method on Cluster coordinator node only. | public ArrayList | callMethodOnCoordinatorNode(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf, long methodTimeout) Calls method on Cluster coordinator node only. | public void | closePartition() | public void | destroyPartition() | protected void | fetchState() | public boolean | getAllowSynchronousMembershipNotifications() | public boolean | getBindIntoJndi() | public ClusterNode | getClusterNode() | public ClusterNode[] | getClusterNodes() | 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. | public DistributedReplicantManager | getDistributedReplicantManager() | public DistributedState | getDistributedStateService() | 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 String | getNodeName() | public String | getPartitionName() | public byte[] | getState() | public long | getStateTransferTimeout() | public Object | handle(Message req) Message contains MethodCall. | public void | init() | public boolean | isCurrentNodeCoordinator() | public void | logHistory(String message) | protected void | notifyListeners(ArrayList theListeners, long viewID, Vector allMembers, Vector deadMembers, Vector newMembers, Vector originatingGroups) | public static Object | objectFromByteBuffer(byte[] buffer) | public static byte[] | objectToByteBuffer(Object obj) Serializes an object into a byte buffer. | public void | processEvent(Object event) | public void | receive(org.jgroups.Message msg) | public void | registerMembershipListener(HAMembershipListener listener) | public void | registerRPCHandler(String objName, Object subscriber) | public void | setAllowSynchronousMembershipNotifications(boolean allowSync) | public void | setBindIntoJndi(boolean bind) | public void | setMethodCallTimeout(long timeout) | public void | setState(byte[] obj) | public void | setStateTransferTimeout(long state_transfer_timeout) | public void | startPartition() | public void | subscribeToStateTransferEvents(String objectName, HAPartitionStateTransfer subscriber) | public void | suspect(org.jgroups.Address suspected_mbr) | protected Vector | translateAddresses(Vector jgAddresses) | public void | unregisterMembershipListener(HAMembershipListener listener) | public void | unregisterRPCHandler(String objName, Object subscriber) | public void | unsubscribeFromStateTransferEvents(String objectName, HAPartitionStateTransfer subscriber) | protected void | verifyNodeIsUnique(Vector javaGroupIpAddresses) | public void | viewAccepted(View newView) Notification of a cluster view change. |
allowSyncListeners | protected boolean allowSyncListeners(Code) | | Do we send any membership change notifications synchronously?
|
asynchHandler | protected AsynchEventHandler asynchHandler(Code) | | The handler used to send membership change notifications asynchronously
|
asynchListeners | protected ArrayList asynchListeners(Code) | | The asynch HAMembershipListener and HAMembershipExtendedListeners
|
bindIntoJndi | protected boolean bindIntoJndi(Code) | | Whether to bind the partition into JNDI
|
channel | protected JChannel channel(Code) | | The JGroups partition channel
|
clusterLifeCycleLog | protected Logger clusterLifeCycleLog(Code) | | |
currentViewId | protected long currentViewId(Code) | | The current cluster view id
|
isStateSet | protected boolean isStateSet(Code) | | True if state was initialized during start-up.
|
localJGAddress | protected org.jgroups.stack.IpAddress localJGAddress(Code) | | the local JG IP Address
|
log | protected Logger log(Code) | | The cluster instance log category
|
members | protected Vector members(Code) | | The current cluster partition members
|
nodeName | protected String nodeName(Code) | | The cluster transport protocol address string
|
otherMembers | protected Vector otherMembers(Code) | | The partition members other than this node
|
partitionName | protected String partitionName(Code) | | The JChannel name
|
server | protected MBeanServer server(Code) | | The JMX MBeanServer to use for registrations
|
setStateException | protected Exception setStateException(Code) | | An exception occuring upon fetch state.
|
state_transfer_timeout | protected long state_transfer_timeout(Code) | | Number of ms to wait for state
|
synchListeners | protected ArrayList synchListeners(Code) | | The synch HAMembershipListener and HAMembershipExtendedListeners
|
timeout | protected long timeout(Code) | | The timeout for cluster RPC calls
|
HAPartitionImpl | public HAPartitionImpl(String partitionName, org.jgroups.JChannel channel, boolean deadlock_detection, MBeanServer server) throws Exception(Code) | | |
HAPartitionImpl | public HAPartitionImpl(String partitionName, org.jgroups.JChannel channel, boolean deadlock_detection) throws Exception(Code) | | |
bind | protected void bind(String jndiName, Object who, Class classType, Context ctx) throws Exception(Code) | | Helper method that binds the partition in the JNDI tree.
Parameters: jndiName - Name under which the object must be bound Parameters: who - Object to bind in JNDI Parameters: classType - Class type under which should appear the bound object Parameters: ctx - Naming context under which we bind the object throws: Exception - Thrown if a naming exception occurs during binding |
block | public void block()(Code) | | |
callAsynchMethodOnCluster | public void callAsynchMethodOnCluster(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf) throws Exception(Code) | | This function is an abstraction of RpcDispatcher for asynchronous messages
|
callMethodOnCoordinatorNode | public ArrayList callMethodOnCoordinatorNode(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf) throws Exception(Code) | | Calls method on Cluster coordinator node only. The cluster coordinator node is the first node to join the
cluster.
and is replaced
Parameters: objName - Parameters: methodName - Parameters: args - Parameters: types - Parameters: excludeSelf - throws: Exception - |
callMethodOnCoordinatorNode | public ArrayList callMethodOnCoordinatorNode(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf, long methodTimeout) throws Exception(Code) | | Calls method on Cluster coordinator node only. The cluster coordinator node is the first node to join the
cluster.
and is replaced
Parameters: objName - Parameters: methodName - Parameters: args - Parameters: types - Parameters: excludeSelf - Parameters: methodTimeout - throws: Exception - |
getAllowSynchronousMembershipNotifications | public boolean getAllowSynchronousMembershipNotifications()(Code) | | |
getBindIntoJndi | public boolean getBindIntoJndi()(Code) | | |
getCurrentViewId | public long getCurrentViewId()(Code) | | |
getDeadMembers | protected Vector getDeadMembers(Vector oldMembers, Vector newMembers)(Code) | | 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.
Parameters: oldMembers - Vector of old members Parameters: newMembers - Vector of new members Vector of members that have died between the two views, can be empty. |
getMethodCallTimeout | public long getMethodCallTimeout()(Code) | | |
getNewMembers | protected Vector getNewMembers(Vector oldMembers, Vector allMembers)(Code) | | Helper method that returns a vector of new members from two input vectors: new and old vectors of two views.
Parameters: oldMembers - Vector of old members Parameters: allMembers - Vector of new members Vector of members that have joined the partition between the two views |
getState | public byte[] getState()(Code) | | |
getStateTransferTimeout | public long getStateTransferTimeout()(Code) | | |
handle | public Object handle(Message req)(Code) | | Message contains MethodCall. Execute it against *this* object and return result.
Use MethodCall.Invoke() to do this. Return result.
This overrides RpcDispatcher.Handle so that we can dispatch to many different objects.
Parameters: req - The org.jgroups. representation of the method invocation The serializable return value from the invocation |
isCurrentNodeCoordinator | public boolean isCurrentNodeCoordinator()(Code) | | |
objectFromByteBuffer | public static Object objectFromByteBuffer(byte[] buffer) throws Exception(Code) | | Creates an object from a byte buffer
|
objectToByteBuffer | public static byte[] objectToByteBuffer(Object obj) throws Exception(Code) | | Serializes an object into a byte buffer.
The object has to implement interface Serializable or Externalizable
|
receive | public void receive(org.jgroups.Message msg)(Code) | | |
registerMembershipListener | public void registerMembershipListener(HAMembershipListener listener)(Code) | | |
setAllowSynchronousMembershipNotifications | public void setAllowSynchronousMembershipNotifications(boolean allowSync)(Code) | | |
setBindIntoJndi | public void setBindIntoJndi(boolean bind)(Code) | | |
setMethodCallTimeout | public void setMethodCallTimeout(long timeout)(Code) | | |
setState | public void setState(byte[] obj)(Code) | | |
setStateTransferTimeout | public void setStateTransferTimeout(long state_transfer_timeout)(Code) | | |
subscribeToStateTransferEvents | public void subscribeToStateTransferEvents(String objectName, HAPartitionStateTransfer subscriber)(Code) | | |
suspect | public void suspect(org.jgroups.Address suspected_mbr)(Code) | | |
unregisterMembershipListener | public void unregisterMembershipListener(HAMembershipListener listener)(Code) | | |
unregisterRPCHandler | public void unregisterRPCHandler(String objName, Object subscriber)(Code) | | |
unsubscribeFromStateTransferEvents | public void unsubscribeFromStateTransferEvents(String objectName, HAPartitionStateTransfer subscriber)(Code) | | |
viewAccepted | public void viewAccepted(View newView)(Code) | | 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.
Parameters: newView - |
|
|