| 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 | |
Constructor Summary | |
public | RouterStub() | public | RouterStub(String router_host, int router_port) Creates a stub for a remote Router object. |
RECONNECT_TIMEOUT | final static long RECONNECT_TIMEOUT(Code) | | |
conn_listener | protected ConnectionListener conn_listener(Code) | | |
log | final protected static Log log(Code) | | |
router_port | int router_port(Code) | | |
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 |
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 |
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.
|
getRouterPort | public int getRouterPort()(Code) | | |
isConnected | public boolean isConnected()(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.
|
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.
|
setConnectionListener | public void setConnectionListener(ConnectionListener conn_listener)(Code) | | |
setRouterHost | public void setRouterHost(String router_host)(Code) | | |
setRouterPort | public void setRouterPort(int router_port)(Code) | | |
|
|