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


java.lang.Object
   org.jgroups.stack.RouterStub

RouterStub
public class RouterStub (Code)
Client stub that talks to a remote GossipRouter
author:
   Bela Ban
version:
   $Id: RouterStub.java,v 1.22 2006/10/25 08:23:58 belaban Exp $

Inner Class :public interface ConnectionListener

Field Summary
final static  longRECONNECT_TIMEOUT
    
protected  ConnectionListenerconn_listener
    
 DataInputStreaminput
    
 Addresslocal_addr
    
final protected static  Loglog
    
 DatagramSocketmy_sock
    
 DataOutputStreamoutput
    
 Stringrouter_host
    
 introuter_port
    
 Socketsock
    

Constructor Summary
public  RouterStub()
    
public  RouterStub(String router_host, int router_port)
     Creates a stub for a remote Router object.

Method Summary
public synchronized  voidconnect(String groupname)
     Register this process with the router under groupname.
public  voidconnect(String groupname, String router_host, int router_port)
    
public synchronized  voiddisconnect()
    
public synchronized  voiddisconnect(boolean is_reconnect)
    
public  Listget(String groupname)
     Retrieves the membership (list of Addresses) for a given group.
public  InetAddressgetBindAddress()
    
public synchronized  AddressgetLocalAddress()
    
public  StringgetRouterHost()
    
public  intgetRouterPort()
    
public  booleanisConnected()
    
public static  voidmain(String[] args)
    
public  Messagereceive()
     Receives a message from the router (blocking mode).
public  voidreconnect(int max_attempts)
     Tries to establish connection to router.
public  voidreconnect()
    
public  booleansend(Message msg, String groupname)
     Sends a message to the router.
public  voidsetBindAddress(InetAddress bind_addr)
    
public  voidsetConnectionListener(ConnectionListener conn_listener)
    
public  voidsetRouterHost(String router_host)
    
public  voidsetRouterPort(int router_port)
    

Field Detail
RECONNECT_TIMEOUT
final static long RECONNECT_TIMEOUT(Code)



conn_listener
protected ConnectionListener conn_listener(Code)



input
DataInputStream input(Code)



local_addr
Address local_addr(Code)



log
final protected static Log log(Code)



my_sock
DatagramSocket my_sock(Code)



output
DataOutputStream output(Code)



router_host
String router_host(Code)



router_port
int router_port(Code)



sock
Socket sock(Code)




Constructor Detail
RouterStub
public RouterStub()(Code)



RouterStub
public RouterStub(String router_host, int router_port)(Code)
Creates a stub for a remote Router object.
Parameters:
  router_host - The name of the router's host
Parameters:
  router_port - The router's port




Method Detail
connect
public synchronized void connect(String groupname) throws Exception(Code)
Register this process with the router under groupname.
Parameters:
  groupname - The name of the group under which to register



connect
public void connect(String groupname, String router_host, int router_port) throws Exception(Code)



disconnect
public synchronized void disconnect()(Code)
Closes the socket and the input and output streams associated with it



disconnect
public synchronized void disconnect(boolean is_reconnect)(Code)



get
public List get(String groupname)(Code)
Retrieves the membership (list of Addresses) for a given group. This is mainly used by the PING protocol to obtain its initial membership. This is used infrequently, so don't maintain socket for the entire time, but create/delete it on demand.



getBindAddress
public InetAddress getBindAddress()(Code)



getLocalAddress
public synchronized Address getLocalAddress() throws SocketException(Code)



getRouterHost
public String getRouterHost()(Code)



getRouterPort
public int getRouterPort()(Code)



isConnected
public boolean isConnected()(Code)



main
public static void main(String[] args)(Code)



receive
public Message receive() throws Exception(Code)
Receives a message from the router (blocking mode). If the connection is down, false is returned, otherwise true



reconnect
public void reconnect(int max_attempts) throws Exception(Code)
Tries to establish connection to router. Tries until router is up again.



reconnect
public void reconnect() throws Exception(Code)



send
public boolean send(Message msg, String groupname)(Code)
Sends a message to the router. Returns false if message cannot be sent (e.g. no connection to router, true otherwise.



setBindAddress
public void setBindAddress(InetAddress bind_addr)(Code)



setConnectionListener
public void setConnectionListener(ConnectionListener conn_listener)(Code)



setRouterHost
public void setRouterHost(String router_host)(Code)



setRouterPort
public void setRouterPort(int router_port)(Code)



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.