org.jgroups.stack
Class RouterStub

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

public class RouterStub
extends java.lang.Object

Client stub that talks to a remote GossipRouter

Version:
$Id: RouterStub.java,v 1.30.4.3 2009/02/06 16:41:55 vlada Exp $
Author:
Bela Ban

Nested Class Summary
static interface RouterStub.ConnectionListener
           
 
Field Summary
static int STATUS_CONNECTED
           
static int STATUS_DISCONNECTED
           
 
Constructor Summary
RouterStub(java.lang.String routerHost, int routerPort, java.net.InetAddress bindAddress)
          Creates a stub for a remote Router object.
 
Method Summary
 void connect(java.lang.String groupname)
          Register this process with the router under groupname.
 void disconnect()
           
 java.io.DataInputStream getInputStream()
           
 Address getLocalAddress()
           
 boolean isConnected()
           
 void sendToAllMembers(byte[] data, int offset, int length)
           
 void sendToSingleMember(Address dest, byte[] data, int offset, int length)
           
 void setConnectionListener(RouterStub.ConnectionListener conn_listener)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATUS_CONNECTED

public static final int STATUS_CONNECTED
See Also:
Constant Field Values

STATUS_DISCONNECTED

public static final int STATUS_DISCONNECTED
See Also:
Constant Field Values
Constructor Detail

RouterStub

public RouterStub(java.lang.String routerHost,
                  int routerPort,
                  java.net.InetAddress bindAddress)
Creates a stub for a remote Router object.

Parameters:
routerHost - The name of the router's host
routerPort - The router's port
Method Detail

isConnected

public boolean isConnected()

setConnectionListener

public void setConnectionListener(RouterStub.ConnectionListener conn_listener)

getLocalAddress

public Address getLocalAddress()
                        throws java.net.SocketException
Throws:
java.net.SocketException

connect

public void connect(java.lang.String groupname)
             throws java.lang.Exception
Register this process with the router under groupname.

Parameters:
groupname - The name of the group under which to register
Throws:
java.lang.Exception

disconnect

public void disconnect()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

sendToAllMembers

public void sendToAllMembers(byte[] data,
                             int offset,
                             int length)
                      throws java.lang.Exception
Throws:
java.lang.Exception

sendToSingleMember

public void sendToSingleMember(Address dest,
                               byte[] data,
                               int offset,
                               int length)
                        throws java.lang.Exception
Throws:
java.lang.Exception

getInputStream

public java.io.DataInputStream getInputStream()
                                       throws java.io.IOException
Throws:
java.io.IOException


Copyright ? 1998-2008 Bela Ban. All Rights Reserved.