public class GossipRouter extends ReceiverAdapter implements ConnectionListener
Modifier and Type | Class and Description |
---|---|
protected static class |
GossipRouter.Entry |
Modifier and Type | Field and Description |
---|---|
protected ConcurrentMap<String,ConcurrentMap<Address,GossipRouter.Entry>> |
address_mappings |
protected int |
backlog |
protected String |
bind_addr |
protected boolean |
emit_suspect_events |
protected long |
expiry_time |
protected boolean |
jmx |
protected long |
linger_timeout |
protected Log |
log |
protected int |
port |
protected AtomicBoolean |
running |
protected BaseServer |
server |
protected long |
sock_read_timeout |
protected ThreadFactory |
thread_factory |
protected Timer |
timer |
protected boolean |
use_nio |
Constructor and Description |
---|
GossipRouter(String bind_addr,
int local_port) |
receive
protected String bind_addr
protected int port
protected long expiry_time
protected long linger_timeout
protected long sock_read_timeout
protected ThreadFactory thread_factory
protected int backlog
protected boolean jmx
protected boolean use_nio
protected boolean emit_suspect_events
protected BaseServer server
protected final AtomicBoolean running
protected Timer timer
protected final Log log
protected final ConcurrentMap<String,ConcurrentMap<Address,GossipRouter.Entry>> address_mappings
public GossipRouter(String bind_addr, int local_port)
public Address localAddress()
public String bindAddress()
public GossipRouter bindAddress(String addr)
public int port()
public GossipRouter port(int port)
public long expiryTime()
public GossipRouter expiryTime(long t)
public long lingerTimeout()
public GossipRouter lingerTimeout(long t)
public long socketReadTimeout()
public GossipRouter socketReadTimeout(long t)
public ThreadFactory threadPoolFactory()
public GossipRouter threadPoolFactory(ThreadFactory f)
public int backlog()
public GossipRouter backlog(int backlog)
public boolean jmx()
public GossipRouter jmx(boolean flag)
public boolean useNio()
public GossipRouter useNio(boolean flag)
public boolean emitSuspectEvents()
public GossipRouter emitSuspectEvents(boolean flag)
public boolean running()
public void start() throws Exception
Exception
public void stop()
public String dumpRoutingTable()
public String dumpAddresssMappings()
public void receive(Address sender, byte[] buf, int offset, int length)
Receiver
receive
in interface Receiver
receive
in class ReceiverAdapter
sender
- The sender of the messagebuf
- The buffer. An application typically de-serializes data from the buffer into objects used by the
application. Note that when receive() returns, it is not safe to use the buffer any longer;
if an application needs to use a buffer after this callback returns, it must make a copy.offset
- The offset at which the received data startslength
- The length of the received datapublic void connectionClosed(Connection conn, String reason)
connectionClosed
in interface ConnectionListener
public void connectionEstablished(Connection conn)
connectionEstablished
in interface ConnectionListener
protected GossipData readRequest(ByteArrayDataInputStream in)
protected void handleRegister(Address sender, GossipData request)
protected void addAddressMapping(Address sender, String group, Address addr, PhysicalAddress phys_addr, String logical_name)
protected void removeFromAddressMappings(Address client_addr)
protected void sendToAllMembersInGroup(Set<Map.Entry<Address,GossipRouter.Entry>> dests, GossipData request)
protected void sendToAllMembersInGroup(Set<Map.Entry<Address,GossipRouter.Entry>> dests, byte[] buf, int offset, int len)
protected void sendToMember(Address dest, GossipData request)
protected void sendToMember(Address dest, byte[] buf, int offset, int len)
Copyright © 2019 JBoss, a division of Red Hat. All rights reserved.