Java Doc for McastService.java in  » Sevlet-Container » apache-tomcat-6.0.14 » org » apache » catalina » tribes » membership » 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 » Sevlet Container » apache tomcat 6.0.14 » org.apache.catalina.tribes.membership 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.catalina.tribes.membership.McastService

McastService
public class McastService implements MembershipService,MembershipListener(Code)
A membership implementation using simple multicast. This is the representation of a multicast membership service. This class is responsible for maintaining a list of active cluster nodes in the cluster. If a node fails to send out a heartbeat, the node will be dismissed.
author:
   Filip Hanik
version:
   $Revision: 522651 $, $Date: 2007-03-27 00:24:32 +0200 (mar., 27 mars 2007) $


Field Summary
final protected static  Member[]EMPTY_MEMBERS
    
protected  byte[]domain
    
protected  McastServiceImplimpl
    
protected  MembershipListenerlistener
    
protected  MemberImpllocalMember
    
protected  byte[]payload
    
protected  Propertiesproperties
    
protected  StringManagersm
     The string manager for this package.

Constructor Summary
public  McastService()
     Create a membership service.

Method Summary
public  MemberfindMemberByName(String name)
    
public  StringgetAddress()
    
public  StringgetBind()
    
public  byte[]getDomain()
    
public  longgetDropTime()
    
public  longgetFrequency()
    
public  StringgetInfo()
     Return descriptive information about this implementation and the corresponding version number, in the format <description>/<version>.
public  MembergetLocalMember(boolean alive)
    
public  StringgetLocalMemberName()
    
public  StringgetMcastAddr()
    
public  StringgetMcastBindAddress()
    
public  longgetMcastDropTime()
    
public  longgetMcastFrequency()
    
public  intgetMcastPort()
    
public  intgetMcastSoTimeout()
    
public  intgetMcastTTL()
    
public  MembergetMember(Member mbr)
    
public  Member[]getMembers()
    
public  String[]getMembersByName()
    
public  byte[]getPayload()
    
public  intgetPort()
    
public  PropertiesgetProperties()
    
public  intgetSoTimeout()
    
public  intgetTtl()
    
public  booleanhasMembers()
    
protected  voidhasProperty(Properties properties, String name)
     Check if a required property is available.
public static  voidmain(String args)
    
public  voidmemberAdded(Member member)
    
public  voidmemberDisappeared(Member member)
    
public  voidremoveMembershipListener()
    
public  voidsetAddress(String addr)
    
public  voidsetBind(String bindaddr)
    
public  voidsetDomain(byte[] domain)
    
public  voidsetDropTime(long time)
    
public  voidsetFrequency(long time)
    
public  voidsetLocalMemberProperties(String listenHost, int listenPort)
    
public  voidsetMcastAddr(String addr)
    
public  voidsetMcastBindAddress(String bindaddr)
    
public  voidsetMcastDropTime(long time)
    
public  voidsetMcastFrequency(long time)
    
public  voidsetMcastPort(int port)
    
public  voidsetMcastSoTimeout(int mcastSoTimeout)
    
public  voidsetMcastTTL(int mcastTTL)
    
public  voidsetMembershipListener(MembershipListener listener)
     Add a membership listener, this version only supports one listener per service, so calling this method twice will result in only the second listener being active.
public  voidsetPayload(byte[] payload)
    
public  voidsetPort(int port)
    
public  voidsetProperties(Properties properties)
    
Parameters:
  properties -
All are required
1.
public  voidsetSoTimeout(int mcastSoTimeout)
    
public  voidsetTtl(int mcastTTL)
    
public  voidstart()
    
public  voidstart(int level)
    
public  voidstop(int svc)
    

Field Detail
EMPTY_MEMBERS
final protected static Member[] EMPTY_MEMBERS(Code)
Return all the members



domain
protected byte[] domain(Code)



impl
protected McastServiceImpl impl(Code)
A handle to the actual low level implementation



listener
protected MembershipListener listener(Code)
A membership listener delegate (should be the cluster :)



localMember
protected MemberImpl localMember(Code)
The local member



payload
protected byte[] payload(Code)



properties
protected Properties properties(Code)
The implementation specific properties



sm
protected StringManager sm(Code)
The string manager for this package.




Constructor Detail
McastService
public McastService()(Code)
Create a membership service.




Method Detail
findMemberByName
public Member findMemberByName(String name)(Code)
Return the member by name



getAddress
public String getAddress()(Code)



getBind
public String getBind()(Code)



getDomain
public byte[] getDomain()(Code)



getDropTime
public long getDropTime()(Code)



getFrequency
public long getFrequency()(Code)



getInfo
public String getInfo()(Code)
Return descriptive information about this implementation and the corresponding version number, in the format <description>/<version>.



getLocalMember
public Member getLocalMember(boolean alive)(Code)
Return the local member



getLocalMemberName
public String getLocalMemberName()(Code)
Return the local member name



getMcastAddr
public String getMcastAddr()(Code)
String



getMcastBindAddress
public String getMcastBindAddress()(Code)
String



getMcastDropTime
public long getMcastDropTime()(Code)
long



getMcastFrequency
public long getMcastFrequency()(Code)
long



getMcastPort
public int getMcastPort()(Code)
int



getMcastSoTimeout
public int getMcastSoTimeout()(Code)
int



getMcastTTL
public int getMcastTTL()(Code)
int



getMember
public Member getMember(Member mbr)(Code)



getMembers
public Member[] getMembers()(Code)



getMembersByName
public String[] getMembersByName()(Code)
Return all the members by name



getPayload
public byte[] getPayload()(Code)



getPort
public int getPort()(Code)



getProperties
public Properties getProperties()(Code)
Return the properties, see setProperties



getSoTimeout
public int getSoTimeout()(Code)



getTtl
public int getTtl()(Code)



hasMembers
public boolean hasMembers()(Code)
has members?



hasProperty
protected void hasProperty(Properties properties, String name)(Code)
Check if a required property is available.
Parameters:
  properties - The set of properties
Parameters:
  name - The property to check for



main
public static void main(String args) throws Exception(Code)
Simple test program
Parameters:
  args - Command-line arguments
throws:
  Exception - If an error occurs



memberAdded
public void memberAdded(Member member)(Code)



memberDisappeared
public void memberDisappeared(Member member)(Code)
Callback from the impl when a new member has been received
Parameters:
  member - The member



removeMembershipListener
public void removeMembershipListener()(Code)
Remove the membership listener



setAddress
public void setAddress(String addr)(Code)



setBind
public void setBind(String bindaddr)(Code)



setDomain
public void setDomain(byte[] domain)(Code)



setDropTime
public void setDropTime(long time)(Code)



setFrequency
public void setFrequency(long time)(Code)



setLocalMemberProperties
public void setLocalMemberProperties(String listenHost, int listenPort)(Code)
Sets the local member properties for broadcasting



setMcastAddr
public void setMcastAddr(String addr)(Code)

Parameters:
  addr - String



setMcastBindAddress
public void setMcastBindAddress(String bindaddr)(Code)



setMcastDropTime
public void setMcastDropTime(long time)(Code)



setMcastFrequency
public void setMcastFrequency(long time)(Code)

Parameters:
  time - long



setMcastPort
public void setMcastPort(int port)(Code)

Parameters:
  port - int



setMcastSoTimeout
public void setMcastSoTimeout(int mcastSoTimeout)(Code)

Parameters:
  mcastSoTimeout - int



setMcastTTL
public void setMcastTTL(int mcastTTL)(Code)

Parameters:
  mcastTTL - int



setMembershipListener
public void setMembershipListener(MembershipListener listener)(Code)
Add a membership listener, this version only supports one listener per service, so calling this method twice will result in only the second listener being active.
Parameters:
  listener - The listener



setPayload
public void setPayload(byte[] payload)(Code)



setPort
public void setPort(int port)(Code)



setProperties
public void setProperties(Properties properties)(Code)

Parameters:
  properties -
All are required
1. mcastPort - the port to listen to
2. mcastAddress - the mcast group address
4. bindAddress - the bind address if any - only one that can be null
5. memberDropTime - the time a member is gone before it is considered gone.
6. mcastFrequency - the frequency of sending messages
7. tcpListenPort - the port this member listens to
8. tcpListenHost - the bind address of this member

exception:
  java.lang.IllegalArgumentException - if a property is missing.



setSoTimeout
public void setSoTimeout(int mcastSoTimeout)(Code)



setTtl
public void setTtl(int mcastTTL)(Code)



start
public void start() throws java.lang.Exception(Code)
Start broadcasting and listening to membership pings
throws:
  java.lang.Exception - if a IO error occurs



start
public void start(int level) throws java.lang.Exception(Code)



stop
public void stop(int svc)(Code)
Stop broadcasting and listening to membership pings



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.