public class RouterStub extends Object implements Comparable<RouterStub>
Modifier and Type | Class and Description |
---|---|
static interface |
RouterStub.ConnectionListener |
static class |
RouterStub.ConnectionStatus |
Modifier and Type | Field and Description |
---|---|
protected InetAddress |
bind_addr |
protected RouterStub.ConnectionListener |
conn_listener |
protected RouterStub.ConnectionStatus |
connectionState |
protected DataInputStream |
input |
protected ReentrantLock |
lock |
protected static Log |
log |
protected DataOutputStream |
output |
protected TUNNEL.StubReceiver |
receiver |
protected String |
router_host |
protected int |
router_port |
protected Socket |
sock |
protected int |
sock_conn_timeout |
protected int |
sock_read_timeout |
protected boolean |
tcp_nodelay |
Constructor and Description |
---|
RouterStub(InetSocketAddress addr) |
RouterStub(String routerHost,
int routerPort,
InetAddress bindAddress,
RouterStub.ConnectionListener l)
Creates a stub for a remote Router object.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_doConnect() |
void |
checkConnection()
Checks whether the connection is open
|
int |
compareTo(RouterStub o) |
void |
connect(String group,
Address addr,
String logical_name,
List<PhysicalAddress> phys_addrs)
Register this process with the router under
group . |
protected void |
connectionStateChanged(RouterStub.ConnectionStatus newState) |
void |
destroy() |
void |
disconnect(String group,
Address addr) |
void |
doConnect() |
boolean |
equals(Object obj) |
RouterStub.ConnectionStatus |
getConnectionStatus() |
InetSocketAddress |
getGossipRouterAddress() |
DataInputStream |
getInputStream() |
List<PingData> |
getMembers(String group) |
TUNNEL.StubReceiver |
getReceiver() |
Socket |
getSocket() |
int |
getSocketConnectionTimeout() |
int |
getSocketReadTimeout() |
int |
hashCode() |
void |
interrupt() |
boolean |
isConnected() |
boolean |
isTcpNoDelay() |
void |
join(long wait) |
void |
sendToAllMembers(String group,
byte[] data,
int offset,
int length) |
void |
sendToMember(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) |
String |
toString() |
protected final String router_host
protected final int router_port
protected Socket sock
protected DataOutputStream output
protected DataInputStream input
protected volatile RouterStub.ConnectionStatus connectionState
protected static final Log log
protected final RouterStub.ConnectionListener conn_listener
protected final InetAddress bind_addr
protected int sock_conn_timeout
protected int sock_read_timeout
protected boolean tcp_nodelay
protected volatile TUNNEL.StubReceiver receiver
protected final ReentrantLock lock
public RouterStub(String routerHost, int routerPort, InetAddress bindAddress, RouterStub.ConnectionListener l)
routerHost
- The name of the router's hostrouterPort
- The router's portSocketException
public RouterStub(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
in interface Comparable<RouterStub>
public void interrupt()
public void join(long wait) throws InterruptedException
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(String group, Address addr, String logical_name, List<PhysicalAddress> phys_addrs) throws Exception
group
.group
- The name of the group under which to registerException
public void checkConnection()
public void destroy()
public Socket getSocket()
public InetSocketAddress getGossipRouterAddress()
public void sendToAllMembers(String group, byte[] data, int offset, int length) throws Exception
Exception
public void sendToMember(String group, Address dest, byte[] data, int offset, int length) throws Exception
Exception
public DataInputStream getInputStream()
protected void connectionStateChanged(RouterStub.ConnectionStatus newState)
Copyright © 2014 JBoss, a division of Red Hat. All rights reserved.