public class RouterStub extends java.lang.Object implements java.lang.Comparable<RouterStub>
限定符和类型 | 类和说明 |
---|---|
static interface |
RouterStub.ConnectionListener |
static class |
RouterStub.ConnectionStatus |
限定符和类型 | 字段和说明 |
---|---|
protected java.net.InetAddress |
bind_addr |
protected RouterStub.ConnectionListener |
conn_listener |
protected RouterStub.ConnectionStatus |
connectionState |
protected java.io.DataInputStream |
input |
protected java.util.concurrent.locks.ReentrantLock |
lock |
protected static Log |
log |
protected java.io.DataOutputStream |
output |
protected TUNNEL.StubReceiver |
receiver |
protected java.lang.String |
router_host |
protected int |
router_port |
protected java.net.Socket |
sock |
protected int |
sock_conn_timeout |
protected int |
sock_read_timeout |
protected boolean |
tcp_nodelay |
构造器和说明 |
---|
RouterStub(java.net.InetSocketAddress addr) |
RouterStub(java.lang.String routerHost,
int routerPort,
java.net.InetAddress bindAddress,
RouterStub.ConnectionListener l)
Creates a stub for a remote Router object.
|
限定符和类型 | 方法和说明 |
---|---|
protected void |
_doConnect() |
void |
checkConnection()
Checks whether the connection is open
|
int |
compareTo(RouterStub o) |
void |
connect(java.lang.String group,
Address addr,
java.lang.String logical_name,
PhysicalAddress phys_addr)
Register this process with the router under
group . |
protected void |
connectionStateChanged(RouterStub.ConnectionStatus newState) |
void |
destroy() |
void |
disconnect(java.lang.String group,
Address addr) |
void |
doConnect() |
boolean |
equals(java.lang.Object obj) |
RouterStub.ConnectionStatus |
getConnectionStatus() |
java.net.InetSocketAddress |
getGossipRouterAddress() |
java.io.DataInputStream |
getInputStream() |
void |
getMembers(java.lang.String group,
Responses rsps) |
TUNNEL.StubReceiver |
getReceiver() |
java.net.Socket |
getSocket() |
int |
getSocketConnectionTimeout() |
int |
getSocketReadTimeout() |
int |
hashCode() |
void |
interrupt() |
boolean |
isConnected() |
boolean |
isTcpNoDelay() |
void |
join(long wait) |
void |
sendToAllMembers(java.lang.String group,
byte[] data,
int offset,
int length) |
void |
sendToMember(java.lang.String group,
Address dest,
byte[] data,
int offset,
int length) |
void |
setReceiver(TUNNEL.StubReceiver receiver) |
void |
setSocketConnectionTimeout(int sock_conn_timeout) |
void |
setSocketReadTimeout(int sock_read_timeout) |
void |
setTcpNoDelay(boolean tcp_nodelay) |
java.lang.String |
toString() |
protected final java.lang.String router_host
protected final int router_port
protected java.net.Socket sock
protected java.io.DataOutputStream output
protected java.io.DataInputStream input
protected volatile RouterStub.ConnectionStatus connectionState
protected static final Log log
protected final RouterStub.ConnectionListener conn_listener
protected final java.net.InetAddress bind_addr
protected int sock_conn_timeout
protected int sock_read_timeout
protected boolean tcp_nodelay
protected volatile TUNNEL.StubReceiver receiver
protected final java.util.concurrent.locks.ReentrantLock lock
public RouterStub(java.lang.String routerHost, int routerPort, java.net.InetAddress bindAddress, RouterStub.ConnectionListener l)
routerHost
- The name of the router's hostrouterPort
- The router's portjava.net.SocketException
public RouterStub(java.net.InetSocketAddress addr)
public void setReceiver(TUNNEL.StubReceiver receiver)
public TUNNEL.StubReceiver getReceiver()
public boolean isTcpNoDelay()
public void setTcpNoDelay(boolean tcp_nodelay)
public int compareTo(RouterStub o)
compareTo
在接口中 java.lang.Comparable<RouterStub>
public boolean equals(java.lang.Object obj)
equals
在类中 java.lang.Object
public int hashCode()
hashCode
在类中 java.lang.Object
public void interrupt()
public void join(long wait) throws java.lang.InterruptedException
java.lang.InterruptedException
public int getSocketConnectionTimeout()
public void setSocketConnectionTimeout(int sock_conn_timeout)
public int getSocketReadTimeout()
public void setSocketReadTimeout(int sock_read_timeout)
public boolean isConnected()
public RouterStub.ConnectionStatus getConnectionStatus()
public void connect(java.lang.String group, Address addr, java.lang.String logical_name, PhysicalAddress phys_addr) throws java.lang.Exception
group
.group
- The name of the group under which to registerjava.lang.Exception
public void doConnect() throws java.lang.Exception
java.lang.Exception
protected void _doConnect() throws java.lang.Exception
java.lang.Exception
public void checkConnection()
public void disconnect(java.lang.String group, Address addr)
public void destroy()
public java.net.Socket getSocket()
public void getMembers(java.lang.String group, Responses rsps) throws java.lang.Exception
java.lang.Exception
public java.net.InetSocketAddress getGossipRouterAddress()
public java.lang.String toString()
toString
在类中 java.lang.Object
public void sendToAllMembers(java.lang.String group, byte[] data, int offset, int length) throws java.lang.Exception
java.lang.Exception
public void sendToMember(java.lang.String group, Address dest, byte[] data, int offset, int length) throws java.lang.Exception
java.lang.Exception
public java.io.DataInputStream getInputStream()
protected void connectionStateChanged(RouterStub.ConnectionStatus newState)