org.jgroups.stack
Class Router
java.lang.Object
org.jgroups.stack.Router
- public class Router
- extends java.lang.Object
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.
- Author:
- Bela Ban
Field Summary |
static int |
DUMP
|
static int |
GET
|
protected org.apache.commons.logging.Log |
log
|
static int |
REGISTER
|
Constructor Summary |
Router(int port)
|
Router(int port,
java.net.InetAddress bind_address)
|
Method Summary |
static void |
main(java.lang.String[] args)
|
void |
start()
|
void |
stop()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected final org.apache.commons.logging.Log log
GET
public static final int GET
- See Also:
- Constant Field Values
REGISTER
public static final int REGISTER
- See Also:
- Constant Field Values
DUMP
public static final int DUMP
- See Also:
- Constant Field Values
Router
public Router(int port)
throws java.lang.Exception
Router
public Router(int port,
java.net.InetAddress bind_address)
throws java.lang.Exception
start
public void start()
stop
public void stop()
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception
Copyright ? 1998-2005 Bela Ban. All Rights Reserved.