|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgroups.stack.GossipRouter
public class GossipRouter
Router for TCP based group comunication (using layer TCP instead of UDP). Instead of the TCP layer sending packets point-to-point to each other member, it sends the packet to the router which - depending on the target address - multicasts or unicasts it to the group / or single member.
This class is especially interesting for applets which cannot directly make connections (neither UDP nor TCP) to a host different from the one they were loaded from. Therefore, an applet would create a normal channel plus protocol stack, but the bottom layer would have to be the TCP layer which sends all packets point-to-point (over a TCP connection) to the router, which in turn forwards them to their end location(s) (also over TCP). A centralized router would therefore have to be running on the host the applet was loaded from. An alternative for running JGroups in an applet (IP multicast is not allows in applets as of 1.2), is to use point-to-point UDP communication via the gossip server. However, then the appplet has to be signed which involves additional administrative effort on the part of the user. Note that a GossipRouter is also a good way of running JGroups in Amazon's EC2 environment which (as of summer 09) doesn't support IP multicasting.
Nested Class Summary | |
---|---|
static interface |
GossipRouter.ConnectionTearListener
|
Field Summary | |
---|---|
static byte |
CLOSE
|
static byte |
CONNECT
|
static byte |
CONNECT_OK
|
protected java.util.List<GossipRouter.ConnectionTearListener> |
connectionTearListeners
|
protected ThreadFactory |
default_thread_factory
|
static byte |
DISCONNECT
|
static byte |
DISCONNECT_OK
|
static byte |
GOSSIP_GET
|
protected Log |
log
|
static byte |
MESSAGE
|
static byte |
OP_FAIL
|
static byte |
PING
|
static int |
PORT
|
static byte |
SUSPECT
|
protected java.util.Timer |
timer
|
Constructor Summary | |
---|---|
GossipRouter()
|
|
GossipRouter(int port)
|
|
GossipRouter(int port,
java.lang.String bindAddressString)
|
|
GossipRouter(int port,
java.lang.String bindAddressString,
boolean jmx)
|
|
GossipRouter(int port,
java.lang.String bindAddressString,
boolean jmx,
long expiryTime)
|
Method Summary | |
---|---|
void |
clear()
|
void |
destroy()
|
java.lang.String |
dumpAddresssMappings()
|
java.lang.String |
dumpRoutingTable()
|
java.lang.String |
dumpRoutingTableDetailed()
|
int |
getBacklog()
|
java.lang.String |
getBindAddress()
|
ThreadFactory |
getDefaultThreadPoolThreadFactory()
|
long |
getExpiryTime()
|
static long |
getGossipRequestTimeout()
Deprecated. |
long |
getLingerTimeout()
|
int |
getPort()
|
static long |
getRoutingClientReplyTimeout()
Deprecated. |
long |
getSocketReadTimeout()
|
boolean |
isDiscardLoopbacks()
|
boolean |
isRunning()
|
boolean |
isStarted()
|
static void |
main(java.lang.String[] args)
|
void |
setBacklog(int backlog)
|
void |
setBindAddress(java.lang.String bindAddress)
|
void |
setDiscardLoopbacks(boolean discard_loopbacks)
|
void |
setExpiryTime(long expiryTime)
|
void |
setGossipRequestTimeout(long gossipRequestTimeout)
Deprecated. |
void |
setLingerTimeout(long linger_timeout)
|
void |
setPort(int port)
|
void |
setRoutingClientReplyTimeout(long routingClientReplyTimeout)
Deprecated. |
void |
setSocketReadTimeout(long sock_read_timeout)
|
void |
start()
Lifecycle operation. |
void |
stop()
Always called before destroy(). |
static java.lang.String |
type2String(int type)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte CONNECT
public static final byte DISCONNECT
public static final byte GOSSIP_GET
public static final byte MESSAGE
public static final byte SUSPECT
public static final byte PING
public static final byte CLOSE
public static final byte CONNECT_OK
public static final byte OP_FAIL
public static final byte DISCONNECT_OK
public static final int PORT
protected java.util.List<GossipRouter.ConnectionTearListener> connectionTearListeners
protected ThreadFactory default_thread_factory
protected java.util.Timer timer
protected final Log log
Constructor Detail |
---|
public GossipRouter()
public GossipRouter(int port)
public GossipRouter(int port, java.lang.String bindAddressString)
public GossipRouter(int port, java.lang.String bindAddressString, boolean jmx)
public GossipRouter(int port, java.lang.String bindAddressString, boolean jmx, long expiryTime)
Method Detail |
---|
public void setPort(int port)
public int getPort()
public void setBindAddress(java.lang.String bindAddress)
public java.lang.String getBindAddress()
public int getBacklog()
public void setBacklog(int backlog)
public void setExpiryTime(long expiryTime)
public long getExpiryTime()
@Deprecated public void setGossipRequestTimeout(long gossipRequestTimeout)
@Deprecated public static long getGossipRequestTimeout()
@Deprecated public void setRoutingClientReplyTimeout(long routingClientReplyTimeout)
@Deprecated public static long getRoutingClientReplyTimeout()
public boolean isStarted()
public boolean isDiscardLoopbacks()
public void setDiscardLoopbacks(boolean discard_loopbacks)
public long getLingerTimeout()
public void setLingerTimeout(long linger_timeout)
public long getSocketReadTimeout()
public void setSocketReadTimeout(long sock_read_timeout)
public ThreadFactory getDefaultThreadPoolThreadFactory()
public static java.lang.String type2String(int type)
public void start() throws java.lang.Exception
java.lang.Exception
public void stop()
public void clear()
public void destroy()
public boolean isRunning()
public java.lang.String dumpRoutingTable()
public java.lang.String dumpRoutingTableDetailed()
public java.lang.String dumpAddresssMappings()
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |