Java Doc for HAPartitionImpl.java in  » EJB-Server-JBoss-4.2.1 » cluster » org » jboss » ha » framework » server » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » EJB Server JBoss 4.2.1 » cluster » org.jboss.ha.framework.server 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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 $


Field Summary
protected  booleanallowSyncListeners
    
protected  AsynchEventHandlerasynchHandler
    
protected  ArrayListasynchListeners
    
protected  booleanbindIntoJndi
    
protected  JChannelchannel
    
protected  LoggerclusterLifeCycleLog
    
protected  longcurrentViewId
    
protected  DistributedStateImpldsManager
    
public  Vectorhistory
    
protected  booleanisStateSet
     True if state was initialized during start-up.
protected  Vectorjgmembers
    
protected  VectorjgotherMembers
    
protected  org.jgroups.stack.IpAddresslocalJGAddress
    
protected  Loggerlog
    
protected  ClusterNodeme
    
protected  Vectormembers
    
protected  StringnodeName
    
protected  VectorotherMembers
    
protected  StringpartitionName
    
protected  DistributedReplicantManagerImplreplicantManager
    
protected  HashMaprpcHandlers
    
protected  MBeanServerserver
    
protected  ExceptionsetStateException
     An exception occuring upon fetch state.
protected  HashMapstateHandlers
    
protected  longstate_transfer_timeout
    
protected  ArrayListsynchListeners
    
protected  longtimeout
    

Constructor Summary
public  HAPartitionImpl(String partitionName, org.jgroups.JChannel channel, boolean deadlock_detection, MBeanServer server)
    
public  HAPartitionImpl(String partitionName, org.jgroups.JChannel channel, boolean deadlock_detection)
    

Method Summary
protected  voidbind(String jndiName, Object who, Class classType, Context ctx)
     Helper method that binds the partition in the JNDI tree.
public  voidblock()
    
public  voidcallAsynchMethodOnCluster(String objName, String methodName, Object[] args, boolean excludeSelf)
    
public  voidcallAsynchMethodOnCluster(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf)
    
public  ArrayListcallMethodOnCluster(String objName, String methodName, Object[] args, boolean excludeSelf)
    
public  ArrayListcallMethodOnCluster(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf)
     This function is an abstraction of RpcDispatcher.
public  ArrayListcallMethodOnCluster(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf, long methodTimeout)
    
public  ArrayListcallMethodOnCoordinatorNode(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf)
     Calls method on Cluster coordinator node only.
public  ArrayListcallMethodOnCoordinatorNode(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf, long methodTimeout)
     Calls method on Cluster coordinator node only.
public  voidclosePartition()
    
public  voiddestroyPartition()
    
protected  voidfetchState()
    
public  booleangetAllowSynchronousMembershipNotifications()
    
public  booleangetBindIntoJndi()
    
public  ClusterNodegetClusterNode()
    
public  ClusterNode[]getClusterNodes()
    
public  VectorgetCurrentView()
    
public  longgetCurrentViewId()
    
protected  VectorgetDeadMembers(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  DistributedReplicantManagergetDistributedReplicantManager()
    
public  DistributedStategetDistributedStateService()
    
public  longgetMethodCallTimeout()
    
protected  VectorgetNewMembers(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  StringgetNodeName()
    
public  StringgetPartitionName()
    
public  byte[]getState()
    
public  longgetStateTransferTimeout()
    
public  Objecthandle(Message req)
     Message contains MethodCall.
public  voidinit()
    
public  booleanisCurrentNodeCoordinator()
    
public  voidlogHistory(String message)
    
protected  voidnotifyListeners(ArrayList theListeners, long viewID, Vector allMembers, Vector deadMembers, Vector newMembers, Vector originatingGroups)
    
public static  ObjectobjectFromByteBuffer(byte[] buffer)
    
public static  byte[]objectToByteBuffer(Object obj)
     Serializes an object into a byte buffer.
public  voidprocessEvent(Object event)
    
public  voidreceive(org.jgroups.Message msg)
    
public  voidregisterMembershipListener(HAMembershipListener listener)
    
public  voidregisterRPCHandler(String objName, Object subscriber)
    
public  voidsetAllowSynchronousMembershipNotifications(boolean allowSync)
    
public  voidsetBindIntoJndi(boolean bind)
    
public  voidsetMethodCallTimeout(long timeout)
    
public  voidsetState(byte[] obj)
    
public  voidsetStateTransferTimeout(long state_transfer_timeout)
    
public  voidstartPartition()
    
public  voidsubscribeToStateTransferEvents(String objectName, HAPartitionStateTransfer subscriber)
    
public  voidsuspect(org.jgroups.Address suspected_mbr)
    
protected  VectortranslateAddresses(Vector jgAddresses)
    
public  voidunregisterMembershipListener(HAMembershipListener listener)
    
public  voidunregisterRPCHandler(String objName, Object subscriber)
    
public  voidunsubscribeFromStateTransferEvents(String objectName, HAPartitionStateTransfer subscriber)
    
protected  voidverifyNodeIsUnique(Vector javaGroupIpAddresses)
    
public  voidviewAccepted(View newView)
     Notification of a cluster view change.

Field Detail
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



dsManager
protected DistributedStateImpl dsManager(Code)
The cluster state manager



history
public Vector history(Code)



isStateSet
protected boolean isStateSet(Code)
True if state was initialized during start-up.



jgmembers
protected Vector jgmembers(Code)



jgotherMembers
protected Vector jgotherMembers(Code)



localJGAddress
protected org.jgroups.stack.IpAddress localJGAddress(Code)
the local JG IP Address



log
protected Logger log(Code)
The cluster instance log category



me
protected ClusterNode me(Code)
me as a ClusterNode



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



replicantManager
protected DistributedReplicantManagerImpl replicantManager(Code)
The cluster replicant manager



rpcHandlers
protected HashMap rpcHandlers(Code)



server
protected MBeanServer server(Code)
The JMX MBeanServer to use for registrations



setStateException
protected Exception setStateException(Code)
An exception occuring upon fetch state.



stateHandlers
protected HashMap stateHandlers(Code)



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




Constructor Detail
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)




Method Detail
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, boolean excludeSelf) throws Exception(Code)

Parameters:
  objName -
Parameters:
  methodName -
Parameters:
  args -
Parameters:
  excludeSelf -
throws:
  Exception - HAPartitionImpl.callAsynchMethodOnCluster(String,String,Object[],Class[],boolean)



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



callMethodOnCluster
public ArrayList callMethodOnCluster(String objName, String methodName, Object[] args, boolean excludeSelf) throws Exception(Code)

Parameters:
  objName -
Parameters:
  methodName -
Parameters:
  args -
Parameters:
  excludeSelf -
throws:
  Exception - HAPartitionImpl.callMethodOnCluster(String,String,Object[],Class[],boolean)



callMethodOnCluster
public ArrayList callMethodOnCluster(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf) throws Exception(Code)
This function is an abstraction of RpcDispatcher.



callMethodOnCluster
public ArrayList callMethodOnCluster(String objName, String methodName, Object[] args, Class[] types, boolean excludeSelf, long methodTimeout) throws Exception(Code)



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 -



closePartition
public void closePartition() throws Exception(Code)



destroyPartition
public void destroyPartition() throws Exception(Code)



fetchState
protected void fetchState() throws Exception(Code)



getAllowSynchronousMembershipNotifications
public boolean getAllowSynchronousMembershipNotifications()(Code)



getBindIntoJndi
public boolean getBindIntoJndi()(Code)



getClusterNode
public ClusterNode getClusterNode()(Code)



getClusterNodes
public ClusterNode[] getClusterNodes()(Code)



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



getDistributedReplicantManager
public DistributedReplicantManager getDistributedReplicantManager()(Code)



getDistributedStateService
public DistributedState getDistributedStateService()(Code)



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



getNodeName
public String getNodeName()(Code)



getPartitionName
public String getPartitionName()(Code)



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



init
public void init() throws Exception(Code)



isCurrentNodeCoordinator
public boolean isCurrentNodeCoordinator()(Code)



logHistory
public void logHistory(String message)(Code)



notifyListeners
protected void notifyListeners(ArrayList theListeners, long viewID, Vector allMembers, Vector deadMembers, Vector newMembers, Vector originatingGroups)(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



processEvent
public void processEvent(Object event)(Code)



receive
public void receive(org.jgroups.Message msg)(Code)



registerMembershipListener
public void registerMembershipListener(HAMembershipListener listener)(Code)



registerRPCHandler
public void registerRPCHandler(String objName, Object subscriber)(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)



startPartition
public void startPartition() throws Exception(Code)



subscribeToStateTransferEvents
public void subscribeToStateTransferEvents(String objectName, HAPartitionStateTransfer subscriber)(Code)



suspect
public void suspect(org.jgroups.Address suspected_mbr)(Code)



translateAddresses
protected Vector translateAddresses(Vector jgAddresses)(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)



verifyNodeIsUnique
protected void verifyNodeIsUnique(Vector javaGroupIpAddresses) throws Exception(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 -



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.