Java Doc for GMS.java in  » Net » JGroups-2.4.1-sp3 » org » jgroups » protocols » 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 » Net » JGroups 2.4.1 sp3 » org.jgroups.protocols 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.jgroups.stack.RpcProtocol
   org.jgroups.protocols.GMS

GMS
public class GMS extends RpcProtocol implements Runnable(Code)
Group membership protocol. Handles joins/leaves/crashes (suspicions) and emits new views accordingly. Use VIEW_ENFORCER on top of this layer to make sure new members don't receive any messages until they are members.
author:
   Bela Ban


Field Summary
final static  StringCLIENT
    
final static  StringCOORD
    
final static  StringPART
    
 booleandisable_initial_coord
    
public  Stringgroup_addr
    
final public  Objectimpl_mutex
    
public  longjoin_retry_timeout
    
public  longjoin_timeout
    
public  longleave_timeout
    
public  Addresslocal_addr
    
public  longltime
    
final public  Membershipmbrs
    
final public static  Stringname
    
public  ViewIdview_id
    
final public  Objectview_mutex
    

Constructor Summary
public  GMS()
    

Method Summary
public  voidbecomeClient()
    
public  voidbecomeCoordinator()
    
public  voidbecomeParticipant()
    
public  voidcastViewChange(Vector new_mbrs, Vector old_mbrs, Vector suspected_mbrs)
     Compute a new view, given the current view, the new members and the suspected/left members.
 booleancheckForViewEnforcer(Protocol up_protocol)
    
protected  booleancheckSelfInclusion(Vector mbrs)
    
 VectorcomputeFlushDestination(Vector suspected_mbrs)
     Return a copy of the current membership minus the suspected members: FLUSH request is not sent to suspected members (because they won't respond, and not to joining members either.
protected  AddressdetermineCoordinator()
    
public  voidflush(Vector flush_dest, Vector suspected_mbrs)
     FLUSH protocol.
public  StringgetName()
    
public  ViewgetNextView(Vector new_mbrs, Vector old_mbrs, Vector suspected_mbrs)
     Computes the next view.
public  booleanhandleDownEvent(Event evt)
     Callback.
public  booleanhandleJoin(Address mbr)
    
public  voidhandleLeave(Address mbr, boolean suspected)
    
public  ViewhandleMerge(ViewId other_vid, Vector other_members)
    
public  voidhandleSuspect(Address mbr)
    
public  booleanhandleUpEvent(Event evt)
     Callback.
public  voidhandleViewChange(ViewId new_view, Vector mbrs)
    
 booleanhaveCoordinatorRole()
    
public  voidinstallView(ViewId new_view, Vector mbrs)
     Assigns the new ltime.
public  voidjoin(Address mbr)
    
public  voidleave(Address mbr)
    
public  ViewmakeView(Vector mbrs)
    
public static  ViewmakeView(Vector mbrs, ViewId vid)
    
public  voidmerge(Vector other_coords)
    
public  voidreceiveDownEvent(Event evt)
    
public  VectorrequiredDownServices()
    
public  voidrun()
    
public  voidsetImpl(GmsImpl new_impl)
    
public  booleansetProperties(Properties props)
    
public  voidstart()
    
public  voidsuspect(Address mbr)
    

Field Detail
CLIENT
final static String CLIENT(Code)



COORD
final static String COORD(Code)



PART
final static String PART(Code)



disable_initial_coord
boolean disable_initial_coord(Code)



group_addr
public String group_addr(Code)



impl_mutex
final public Object impl_mutex(Code)



join_retry_timeout
public long join_retry_timeout(Code)



join_timeout
public long join_timeout(Code)



leave_timeout
public long leave_timeout(Code)



local_addr
public Address local_addr(Code)



ltime
public long ltime(Code)



mbrs
final public Membership mbrs(Code)



name
final public static String name(Code)



view_id
public ViewId view_id(Code)



view_mutex
final public Object view_mutex(Code)




Constructor Detail
GMS
public GMS()(Code)




Method Detail
becomeClient
public void becomeClient()(Code)



becomeCoordinator
public void becomeCoordinator()(Code)



becomeParticipant
public void becomeParticipant()(Code)



castViewChange
public void castViewChange(Vector new_mbrs, Vector old_mbrs, Vector suspected_mbrs)(Code)
Compute a new view, given the current view, the new members and the suspected/left members. Run view update protocol to install a new view in all members (this involves casting the new view to all members). The targets for FLUSH and VIEW mcasts are computed as follows:

 existing          leaving        suspected          joining
 

1. FLUSH y y n n 2. new_view y n n y 3. tmp_view y y n y (view_dest)

  1. The FLUSH is only sent to the existing and leaving members (they are the only ones that might have old messages not yet seen by the group. The suspected members would not answer anyway (because they have failed) and the joining members have certainly no old messages.
  2. The new view to be installed includes the existing members plus the joining ones and excludes the leaving and suspected members.
  3. A temporary view is sent down the stack as an event. This allows the bottom layer (e.g. UDP or TCP) to determine the members to which to send a multicast message. Compared to the new view, leaving members are included since they have are waiting for a view in which they are not members any longer before they leave. So, if we did not set a temporary view, joining members would not receive the view (signalling that they have been joined successfully). The temporary view is essentially the current view plus the joining members (old members are still part of the current view).



checkForViewEnforcer
boolean checkForViewEnforcer(Protocol up_protocol)(Code)



checkSelfInclusion
protected boolean checkSelfInclusion(Vector mbrs)(Code)
Returns true if local_addr is member of mbrs, else false



computeFlushDestination
Vector computeFlushDestination(Vector suspected_mbrs)(Code)
Return a copy of the current membership minus the suspected members: FLUSH request is not sent to suspected members (because they won't respond, and not to joining members either. It IS sent to leaving members (before they are allowed to leave).



determineCoordinator
protected Address determineCoordinator()(Code)



flush
public void flush(Vector flush_dest, Vector suspected_mbrs)(Code)
FLUSH protocol. Send to current mbrs - suspected_mbrs (not including new_mbrs, but including old_mbr) Send TMP_VIEW event down, this allows FLUSH/NAKACK to set membership correctly



getName
public String getName()(Code)



getNextView
public View getNextView(Vector new_mbrs, Vector old_mbrs, Vector suspected_mbrs)(Code)
Computes the next view. Returns a copy that has old_mbrs and suspected_mbrs removed and new_mbrs added.



handleDownEvent
public boolean handleDownEvent(Event evt)(Code)
Callback. Called by superclass when event may be handled.

Do not use PassDown in this method as the event is passed down by default by the superclass after this method returns ! boolean Defaults to true. If false, event will not be passed down the stack.




handleJoin
public boolean handleJoin(Address mbr)(Code)



handleLeave
public void handleLeave(Address mbr, boolean suspected)(Code)



handleMerge
public View handleMerge(ViewId other_vid, Vector other_members)(Code)



handleSuspect
public void handleSuspect(Address mbr)(Code)



handleUpEvent
public boolean handleUpEvent(Event evt)(Code)
Callback. Called by superclass when event may be handled.

Do not use PassUp in this method as the event is passed up by default by the superclass after this method returns ! boolean Defaults to true. If false, event will not be passed up the stack.




handleViewChange
public void handleViewChange(ViewId new_view, Vector mbrs)(Code)



haveCoordinatorRole
boolean haveCoordinatorRole()(Code)



installView
public void installView(ViewId new_view, Vector mbrs)(Code)
Assigns the new ltime. Installs view and view_id. Changes role to coordinator if necessary. Sends VIEW_CHANGE event up and down the stack.



join
public void join(Address mbr)(Code)



leave
public void leave(Address mbr)(Code)



makeView
public View makeView(Vector mbrs)(Code)



makeView
public static View makeView(Vector mbrs, ViewId vid)(Code)



merge
public void merge(Vector other_coords)(Code)



receiveDownEvent
public void receiveDownEvent(Event evt)(Code)



requiredDownServices
public Vector requiredDownServices()(Code)



run
public void run()(Code)



setImpl
public void setImpl(GmsImpl new_impl)(Code)



setProperties
public boolean setProperties(Properties props)(Code)
Setup the Protocol instance acording to the configuration string



start
public void start() throws Exception(Code)



suspect
public void suspect(Address mbr)(Code)



Methods inherited from org.jgroups.stack.RpcProtocol
public Object callRemoteMethod(Address dest, String method_name, int mode, long timeout) throws TimeoutException, SuspectedException(Code)(Java Doc)
public Object callRemoteMethod(Address dest, String method_name, Object[] args, Class[] types, int mode, long timeout) throws TimeoutException, SuspectedException(Code)(Java Doc)
public Object callRemoteMethod(Address dest, String method_name, Object[] args, String[] signature, int mode, long timeout) throws TimeoutException, SuspectedException(Code)(Java Doc)
public Object callRemoteMethod(Address dest, MethodCall method_call, int mode, long timeout) throws TimeoutException, SuspectedException(Code)(Java Doc)
public RspList callRemoteMethods(Vector dests, String method_name, Object[] args, Class[] types, int mode, long timeout)(Code)(Java Doc)
public RspList callRemoteMethods(Vector dests, String method_name, Object[] args, String[] signature, int mode, long timeout)(Code)(Java Doc)
public RspList callRemoteMethods(Vector dests, MethodCall method_call, int mode, long timeout)(Code)(Java Doc)
public String getName()(Code)(Java Doc)
public Object handle(Message req)(Code)(Java Doc)
public boolean handleDownEvent(Event evt)(Code)(Java Doc)
public boolean handleUpEvent(Event evt)(Code)(Java Doc)

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