|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport
org.jboss.system.ServiceMBeanSupport
org.jboss.ha.framework.server.ClusterPartition
public class ClusterPartition
HAPartition
implementation based on a
JGroups RpcDispatcher
and a multiplexed JChannel
.
Nested Class Summary | |
---|---|
static class |
ClusterPartition.NoHandlerForRPC
Returned when an RPC call arrives for a service that isn't registered. |
Nested classes/interfaces inherited from interface org.jboss.ha.framework.interfaces.HAPartition |
---|
org.jboss.ha.framework.interfaces.HAPartition.AsynchHAMembershipExtendedListener, org.jboss.ha.framework.interfaces.HAPartition.AsynchHAMembershipListener, org.jboss.ha.framework.interfaces.HAPartition.HAMembershipExtendedListener, org.jboss.ha.framework.interfaces.HAPartition.HAMembershipListener, org.jboss.ha.framework.interfaces.HAPartition.HAPartitionStateTransfer |
Field Summary | |
---|---|
static String |
DEFAULT_CACHE_CONFIG
|
protected boolean |
isStateSet
True if serviceState was initialized during start-up. |
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
---|
server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.ha.framework.server.ClusterPartitionMBean |
---|
OBJECT_NAME |
Fields inherited from interface org.jboss.system.ServiceMBean |
---|
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
---|---|
ClusterPartition()
|
Method Summary | |
---|---|
protected void |
bind(String jndiName,
Object who,
Class<?> classType,
Context ctx)
Helper method that binds the partition in the JNDI tree. |
void |
block()
|
void |
callAsynchMethodOnCluster(String objName,
String methodName,
Object[] args,
Class[] types,
boolean excludeSelf)
This function is an abstraction of RpcDispatcher for asynchronous messages |
void |
callAsyncMethodOnNode(String serviceName,
String methodName,
Object[] args,
Class[] types,
long methodTimeout,
org.jboss.ha.framework.interfaces.ClusterNode targetNode)
Calls method on target node only. |
ArrayList |
callMethodOnCluster(String objName,
String methodName,
Object[] args,
Class[] types,
boolean excludeSelf)
This function is an abstraction of RpcDispatcher. |
ArrayList |
callMethodOnCluster(String objName,
String methodName,
Object[] args,
Class[] types,
boolean excludeSelf,
long methodTimeout,
org.jboss.ha.framework.interfaces.ResponseFilter filter)
|
ArrayList |
callMethodOnCluster(String objName,
String methodName,
Object[] args,
Class[] types,
boolean excludeSelf,
org.jboss.ha.framework.interfaces.ResponseFilter filter)
|
ArrayList |
callMethodOnCoordinatorNode(String objName,
String methodName,
Object[] args,
Class[] types,
boolean excludeSelf)
Calls method on Cluster coordinator node only. |
ArrayList |
callMethodOnCoordinatorNode(String objName,
String methodName,
Object[] args,
Class[] types,
boolean excludeSelf,
long methodTimeout)
Calls method on Cluster coordinator node only. |
Object |
callMethodOnNode(String serviceName,
String methodName,
Object[] args,
Class[] types,
long methodTimeout,
org.jboss.ha.framework.interfaces.ClusterNode targetNode)
Calls method synchrounously on target node only. |
protected void |
createService()
|
protected void |
destroyService()
|
protected void |
fetchState()
|
boolean |
getAllowSynchronousMembershipNotifications()
Returns whether this partition will synchronously notify any HAPartition.HAMembershipListener of membership changes using the calling thread from the underlying group communications layer (e.g. |
boolean |
getBindIntoJndi()
|
String |
getCacheConfigName()
Gets the configuration name under which our cache is registered with the cache manager. |
org.jboss.ha.framework.server.spi.HAPartitionCacheHandler |
getCacheHandler()
|
org.jgroups.ChannelFactory |
getChannelFactory()
|
String |
getChannelStackName()
Gets the name of the JGroups channel protocol stack configuration provided to the channel factory . |
org.jboss.ha.framework.interfaces.ClusterNode |
getClusterNode()
|
org.jboss.ha.framework.interfaces.ClusterNode[] |
getClusterNodes()
|
Vector<String> |
getCurrentView()
Return the list of member nodes that built from the current view |
long |
getCurrentViewId()
|
boolean |
getDeadlockDetection()
Deprecated. will be removed in next major release |
protected Vector<org.jboss.ha.framework.interfaces.ClusterNode> |
getDeadMembers(Vector<org.jboss.ha.framework.interfaces.ClusterNode> oldMembers,
Vector<org.jboss.ha.framework.interfaces.ClusterNode> newMembers)
Helper method that returns a vector of dead members from two input vectors: new and old vectors of two views. |
org.jboss.ha.framework.interfaces.DistributedReplicantManager |
getDistributedReplicantManager()
Access to the DistributedReplicantManager implementation |
DistributedReplicantManagerImpl |
getDistributedReplicantManagerImpl()
|
org.jboss.ha.framework.interfaces.DistributedState |
getDistributedStateService()
Access to the DistributedState implementation |
org.jboss.ha.framework.interfaces.HAPartition |
getHAPartition()
Deprecated. |
HAPartitionDependencyCreator |
getHaPartitionDependencyCreator()
|
String |
getJGroupsVersion()
The version of JGroups this is running on |
long |
getMethodCallTimeout()
Gets the max time (in ms) to wait for synchronous group method calls ( HAPartition.callMethodOnCluster(String, String, Object[], Class[], boolean) ) |
protected Vector<org.jboss.ha.framework.interfaces.ClusterNode> |
getNewMembers(Vector<org.jboss.ha.framework.interfaces.ClusterNode> oldMembers,
Vector<org.jboss.ha.framework.interfaces.ClusterNode> allMembers)
Helper method that returns a vector of new members from two input vectors: new and old vectors of two views. |
InetAddress |
getNodeAddress()
The node address used to generate the node name |
String |
getNodeName()
Uniquely identifies this node across the entire cluster. |
String |
getPartitionName()
Name of the partition being built. |
long |
getStateTransferTimeout()
Number of milliseconds to wait until state has been transferred, or zero to wait forever. |
org.jboss.util.threadpool.ThreadPool |
getThreadPool()
|
boolean |
isCurrentNodeCoordinator()
|
void |
logHistory(String message)
|
protected void |
notifyListeners(ArrayList<org.jboss.ha.framework.interfaces.HAPartition.HAMembershipListener> theListeners,
long viewID,
Vector<org.jboss.ha.framework.interfaces.ClusterNode> allMembers,
Vector<org.jboss.ha.framework.interfaces.ClusterNode> deadMembers,
Vector<org.jboss.ha.framework.interfaces.ClusterNode> newMembers,
Vector<org.jgroups.View> originatingGroups)
|
protected Object |
objectFromByteBufferInternal(byte[] buffer)
Creates an object from a byte buffer |
protected Object |
objectFromByteBufferResponseInternal(byte[] buffer)
Creates a response object from a byte buffer - optimized for response marshalling |
protected byte[] |
objectToByteBufferInternal(Object obj)
Serializes an object into a byte buffer. |
protected byte[] |
objectToByteBufferResponseInternal(Object obj)
Serializes a response object into a byte buffer, optimized for response marshalling. |
void |
processEvent(Object event)
|
void |
registerMembershipListener(org.jboss.ha.framework.interfaces.HAPartition.HAMembershipListener listener)
|
void |
registerRPCHandler(String objName,
Object subscriber)
|
void |
registerRPCHandler(String objName,
Object subscriber,
ClassLoader classloader)
|
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. |
void |
setBindIntoJndi(boolean bind)
|
void |
setCacheHandler(org.jboss.ha.framework.server.spi.HAPartitionCacheHandler cacheHandler)
|
void |
setDeadlockDetection(boolean doit)
Deprecated. will be removed in next major release |
void |
setDistributedStateImpl(org.jboss.ha.framework.interfaces.DistributedState distributedState)
|
void |
setHaPartitionDependencyCreator(HAPartitionDependencyCreator haPartitionDependencyCreator)
|
void |
setKernelControllerContext(org.jboss.kernel.spi.dependency.KernelControllerContext controllerContext)
|
void |
setMethodCallTimeout(long timeout)
|
void |
setNodeAddress(InetAddress address)
|
void |
setPartitionName(String newName)
|
void |
setStateTransferTimeout(long timeout)
|
void |
setThreadPool(org.jboss.util.threadpool.ThreadPool threadPool)
|
String |
showHistory()
Gets a listing of significant events since the instantiation of this service (e.g. |
String |
showHistoryAsXML()
Gets a listing of significant events since the instantiation of this service (e.g. |
protected void |
startService()
|
protected void |
stopService()
|
void |
subscribeToStateTransferEvents(String objectName,
org.jboss.ha.framework.interfaces.HAPartition.HAPartitionStateTransfer subscriber)
|
void |
suspect(org.jgroups.Address suspected_mbr)
|
protected Vector<org.jboss.ha.framework.interfaces.ClusterNode> |
translateAddresses(Vector<org.jgroups.Address> addresses)
|
void |
unblock()
|
void |
unregisterMembershipListener(org.jboss.ha.framework.interfaces.HAPartition.HAMembershipListener listener)
|
void |
unregisterRPCHandler(String objName,
Object subscriber)
|
void |
unsetKernelControllerContext(org.jboss.kernel.spi.dependency.KernelControllerContext controllerContext)
|
void |
unsubscribeFromStateTransferEvents(String objectName,
org.jboss.ha.framework.interfaces.HAPartition.HAPartitionStateTransfer subscriber)
|
protected void |
verifyNodeIsUnique()
|
void |
viewAccepted(org.jgroups.View newView)
Notification of a cluster view change. |
Methods inherited from class org.jboss.system.ServiceMBeanSupport |
---|
create, destroy, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, pojoChange, pojoCreate, pojoDestroy, pojoStart, pojoStop, postDeregister, postRegister, preDeregister, preRegister, start, stop |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport |
---|
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.system.ServiceMBean |
---|
getName, getState, getStateString, jbossInternalLifecycle |
Methods inherited from interface org.jboss.system.Service |
---|
create, destroy, start, stop |
Field Detail |
---|
public static final String DEFAULT_CACHE_CONFIG
protected boolean isStateSet
Constructor Detail |
---|
public ClusterPartition()
Method Detail |
---|
protected void createService() throws Exception
createService
in class ServiceMBeanSupport
Exception
protected void startService() throws Exception
startService
in class ServiceMBeanSupport
Exception
protected void stopService() throws Exception
stopService
in class ServiceMBeanSupport
Exception
protected void destroyService() throws Exception
destroyService
in class ServiceMBeanSupport
Exception
protected void fetchState() throws Exception
Exception
public void suspect(org.jgroups.Address suspected_mbr)
suspect
in interface org.jgroups.MembershipListener
public void block()
block
in interface org.jgroups.MembershipListener
public void unblock()
unblock
in interface org.jgroups.ExtendedMembershipListener
public void viewAccepted(org.jgroups.View newView)
viewAccepted
in interface org.jgroups.MembershipListener
newView
- public String getNodeName()
ClusterPartitionMBean
getNodeName
in interface org.jboss.ha.framework.interfaces.HAPartition
getNodeName
in interface ClusterPartitionMBean
public String getPartitionName()
ClusterPartitionMBean
getPartitionName
in interface org.jboss.ha.framework.interfaces.HAPartition
getPartitionName
in interface ClusterPartitionMBean
public void setPartitionName(String newName)
public org.jboss.ha.framework.interfaces.DistributedReplicantManager getDistributedReplicantManager()
ClusterPartitionMBean
getDistributedReplicantManager
in interface org.jboss.ha.framework.interfaces.HAPartition
getDistributedReplicantManager
in interface ClusterPartitionMBean
public org.jboss.ha.framework.interfaces.DistributedState getDistributedStateService()
ClusterPartitionMBean
getDistributedStateService
in interface org.jboss.ha.framework.interfaces.HAPartition
getDistributedStateService
in interface ClusterPartitionMBean
public long getCurrentViewId()
getCurrentViewId
in interface org.jboss.ha.framework.interfaces.HAPartition
public Vector<String> getCurrentView()
ClusterPartitionMBean
getCurrentView
in interface org.jboss.ha.framework.interfaces.HAPartition
getCurrentView
in interface ClusterPartitionMBean
public org.jboss.ha.framework.interfaces.ClusterNode[] getClusterNodes()
getClusterNodes
in interface org.jboss.ha.framework.interfaces.HAPartition
public org.jboss.ha.framework.interfaces.ClusterNode getClusterNode()
getClusterNode
in interface org.jboss.ha.framework.interfaces.HAPartition
public boolean isCurrentNodeCoordinator()
public void registerRPCHandler(String objName, Object subscriber)
registerRPCHandler
in interface org.jboss.ha.framework.interfaces.HAPartition
public void registerRPCHandler(String objName, Object subscriber, ClassLoader classloader)
registerRPCHandler
in interface org.jboss.ha.framework.interfaces.HAPartition
public void unregisterRPCHandler(String objName, Object subscriber)
unregisterRPCHandler
in interface org.jboss.ha.framework.interfaces.HAPartition
public ArrayList callMethodOnCluster(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf) throws Exception
callMethodOnCluster
in interface org.jboss.ha.framework.interfaces.HAPartition
Exception
public ArrayList callMethodOnCluster(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf, org.jboss.ha.framework.interfaces.ResponseFilter filter) throws Exception
callMethodOnCluster
in interface org.jboss.ha.framework.interfaces.HAPartition
Exception
public ArrayList callMethodOnCluster(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf, long methodTimeout, org.jboss.ha.framework.interfaces.ResponseFilter filter) throws Exception
Exception
public ArrayList callMethodOnCoordinatorNode(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf) throws Exception
callMethodOnCoordinatorNode
in interface org.jboss.ha.framework.interfaces.HAPartition
objName
- methodName
- args
- types
- excludeSelf
-
Exception
public ArrayList callMethodOnCoordinatorNode(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf, long methodTimeout) throws Exception
objName
- methodName
- args
- types
- excludeSelf
- methodTimeout
-
Exception
public Object callMethodOnNode(String serviceName, String methodName, Object[] args, Class[] types, long methodTimeout, org.jboss.ha.framework.interfaces.ClusterNode targetNode) throws Throwable
callMethodOnNode
in interface org.jboss.ha.framework.interfaces.HAPartition
serviceName
- 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 parameters
node of the partition or only on remote nodestargetNode
- is the target of the call
Exception
- Throws if a communication exception occurs
Throwable
public void callAsyncMethodOnNode(String serviceName, String methodName, Object[] args, Class[] types, long methodTimeout, org.jboss.ha.framework.interfaces.ClusterNode targetNode) throws Throwable
callAsyncMethodOnNode
in interface org.jboss.ha.framework.interfaces.HAPartition
serviceName
- 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 parameters
node of the partition or only on remote nodestargetNode
- is the target of the call
Exception
- Throws if a communication exception occurs
Throwable
public void callAsynchMethodOnCluster(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf) throws Exception
callAsynchMethodOnCluster
in interface org.jboss.ha.framework.interfaces.HAPartition
Exception
public void subscribeToStateTransferEvents(String objectName, org.jboss.ha.framework.interfaces.HAPartition.HAPartitionStateTransfer subscriber)
subscribeToStateTransferEvents
in interface org.jboss.ha.framework.interfaces.HAPartition
public void unsubscribeFromStateTransferEvents(String objectName, org.jboss.ha.framework.interfaces.HAPartition.HAPartitionStateTransfer subscriber)
unsubscribeFromStateTransferEvents
in interface org.jboss.ha.framework.interfaces.HAPartition
public void registerMembershipListener(org.jboss.ha.framework.interfaces.HAPartition.HAMembershipListener listener)
registerMembershipListener
in interface org.jboss.ha.framework.interfaces.HAPartition
public void unregisterMembershipListener(org.jboss.ha.framework.interfaces.HAPartition.HAMembershipListener listener)
unregisterMembershipListener
in interface org.jboss.ha.framework.interfaces.HAPartition
public boolean getAllowSynchronousMembershipNotifications()
ClusterPartitionMBean
getAllowSynchronousMembershipNotifications
in interface org.jboss.ha.framework.interfaces.HAPartition
getAllowSynchronousMembershipNotifications
in interface ClusterPartitionMBean
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 void setAllowSynchronousMembershipNotifications(boolean allowSync)
setAllowSynchronousMembershipNotifications
in interface org.jboss.ha.framework.interfaces.HAPartition
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 void processEvent(Object event)
processEvent
in interface AsynchEventHandler.AsynchEventProcessor
public void setDistributedStateImpl(org.jboss.ha.framework.interfaces.DistributedState distributedState)
protected void verifyNodeIsUnique() throws IllegalStateException
IllegalStateException
protected void bind(String jndiName, Object who, Class<?> classType, Context ctx) throws 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
Exception
- Thrown if a naming exception occurs during bindingprotected Vector<org.jboss.ha.framework.interfaces.ClusterNode> getDeadMembers(Vector<org.jboss.ha.framework.interfaces.ClusterNode> oldMembers, Vector<org.jboss.ha.framework.interfaces.ClusterNode> newMembers)
oldMembers
- Vector of old membersnewMembers
- Vector of new members
protected Vector<org.jboss.ha.framework.interfaces.ClusterNode> getNewMembers(Vector<org.jboss.ha.framework.interfaces.ClusterNode> oldMembers, Vector<org.jboss.ha.framework.interfaces.ClusterNode> allMembers)
oldMembers
- Vector of old membersallMembers
- Vector of new members
protected void notifyListeners(ArrayList<org.jboss.ha.framework.interfaces.HAPartition.HAMembershipListener> theListeners, long viewID, Vector<org.jboss.ha.framework.interfaces.ClusterNode> allMembers, Vector<org.jboss.ha.framework.interfaces.ClusterNode> deadMembers, Vector<org.jboss.ha.framework.interfaces.ClusterNode> newMembers, Vector<org.jgroups.View> originatingGroups)
public void setBindIntoJndi(boolean bind)
public boolean getBindIntoJndi()
public org.jboss.util.threadpool.ThreadPool getThreadPool()
public void setThreadPool(org.jboss.util.threadpool.ThreadPool threadPool)
public HAPartitionDependencyCreator getHaPartitionDependencyCreator()
public void setHaPartitionDependencyCreator(HAPartitionDependencyCreator haPartitionDependencyCreator)
protected Vector<org.jboss.ha.framework.interfaces.ClusterNode> translateAddresses(Vector<org.jgroups.Address> addresses)
public void logHistory(String message)
public String showHistory()
ClusterPartitionMBean
showHistory
in interface ClusterPartitionMBean
public String showHistoryAsXML()
ClusterPartitionMBean
showHistoryAsXML
in interface ClusterPartitionMBean
@Deprecated public boolean getDeadlockDetection()
false
.
getDeadlockDetection
in interface ClusterPartitionMBean
false
@Deprecated public void setDeadlockDetection(boolean doit)
doIt
- ignored@Deprecated public org.jboss.ha.framework.interfaces.HAPartition getHAPartition()
ClusterPartitionMBean
getHAPartition
in interface ClusterPartitionMBean
public String getJGroupsVersion()
ClusterPartitionMBean
getJGroupsVersion
in interface ClusterPartitionMBean
public DistributedReplicantManagerImpl getDistributedReplicantManagerImpl()
public org.jgroups.ChannelFactory getChannelFactory()
public org.jboss.ha.framework.server.spi.HAPartitionCacheHandler getCacheHandler()
public void setCacheHandler(org.jboss.ha.framework.server.spi.HAPartitionCacheHandler cacheHandler)
public String getCacheConfigName()
ClusterPartitionMBean
getCacheConfigName
in interface ClusterPartitionMBean
public String getChannelStackName()
ClusterPartitionMBean
channel factory
.
getChannelStackName
in interface ClusterPartitionMBean
public InetAddress getNodeAddress()
ClusterPartitionMBean
getNodeAddress
in interface ClusterPartitionMBean
public void setNodeAddress(InetAddress address)
public long getStateTransferTimeout()
ClusterPartitionMBean
getStateTransferTimeout
in interface ClusterPartitionMBean
public void setStateTransferTimeout(long timeout)
public long getMethodCallTimeout()
ClusterPartitionMBean
HAPartition.callMethodOnCluster(String, String, Object[], Class[], boolean)
)
getMethodCallTimeout
in interface ClusterPartitionMBean
public void setMethodCallTimeout(long timeout)
public void setKernelControllerContext(org.jboss.kernel.spi.dependency.KernelControllerContext controllerContext) throws Exception
setKernelControllerContext
in interface org.jboss.kernel.spi.dependency.KernelControllerContextAware
setKernelControllerContext
in class ServiceMBeanSupport
Exception
public void unsetKernelControllerContext(org.jboss.kernel.spi.dependency.KernelControllerContext controllerContext) throws Exception
unsetKernelControllerContext
in interface org.jboss.kernel.spi.dependency.KernelControllerContextAware
unsetKernelControllerContext
in class ServiceMBeanSupport
Exception
protected Object objectFromByteBufferInternal(byte[] buffer) throws Exception
Exception
protected byte[] objectToByteBufferInternal(Object obj) throws Exception
Exception
protected Object objectFromByteBufferResponseInternal(byte[] buffer) throws Exception
Exception
protected byte[] objectToByteBufferResponseInternal(Object obj) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |