|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jgroups.stack.Protocol
org.jgroups.protocols.TP
org.jgroups.protocols.TUNNEL
public class TUNNEL
Replacement for UDP. Instead of sending packets via UDP, a TCP connection is opened to a Router
(using the RouterStub client-side stub), the IP address/port of which was given using channel
properties router_host and router_port. All outgoing traffic is sent
via this TCP socket to the Router which distributes it to all connected TUNNELs in this group.
Incoming traffic received from Router will simply be passed up the stack.
A TUNNEL layer can be used to penetrate a firewall, most firewalls allow creating TCP connections to the outside world, however, they do not permit outside hosts to initiate a TCP connection to a host inside the firewall. Therefore, the connection created by the inside host is reused by Router to send traffic from an outside host to a host inside the firewall.
| Nested Class Summary | |
|---|---|
class |
TUNNEL.StubReceiver
|
static interface |
TUNNEL.TUNNELPolicy
|
| Nested classes/interfaces inherited from class org.jgroups.protocols.TP |
|---|
TP.Bundler, TP.DefaultBundler, TP.DefaultBundler2, TP.ProtocolAdapter, TP.TransferQueueBundler, TP.TransferQueueBundler2 |
| Field Summary |
|---|
| Fields inherited from class org.jgroups.stack.Protocol |
|---|
down_prot, ergonomics, id, log, name, stack, stats, up_prot |
| Constructor Summary | |
|---|---|
TUNNEL()
|
|
| Method Summary | |
|---|---|
void |
destroy()
This method is called on a Channel.close(). |
java.lang.String |
getInfo()
|
protected PhysicalAddress |
getPhysicalAddress()
|
long |
getReconnectInterval()
|
java.lang.Object |
handleDownEvent(Event evt)
|
void |
init()
Called after instance has been created (null constructor) and before protocol is started. |
protected void |
send(Message msg,
Address dest,
boolean multicast)
Serializes and sends a message. |
void |
sendMulticast(byte[] data,
int offset,
int length)
Send to all members in the group. |
void |
sendUnicast(PhysicalAddress dest,
byte[] data,
int offset,
int length)
Send a unicast to 1 member. |
void |
setGossipRouterHosts(java.lang.String hosts)
|
void |
setReconnectInterval(long reconnect_interval)
|
void |
setTUNNELPolicy(TUNNEL.TUNNELPolicy policy)
|
boolean |
supportsMulticasting()
Whether or not hardware multicasting is supported |
java.lang.String |
toString()
|
| Methods inherited from class org.jgroups.stack.Protocol |
|---|
dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getName, getProtocolStack, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStatistics, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setUpProtocol, setValue, setValues, statsEnabled |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TUNNEL()
| Method Detail |
|---|
public boolean supportsMulticasting()
TP
supportsMulticasting in class TP
public void setGossipRouterHosts(java.lang.String hosts)
throws java.net.UnknownHostException
java.net.UnknownHostExceptionpublic java.lang.String toString()
toString in class TPpublic long getReconnectInterval()
public void setReconnectInterval(long reconnect_interval)
public void setTUNNELPolicy(TUNNEL.TUNNELPolicy policy)
public void init()
throws java.lang.Exception
Protocol
init in class TPjava.lang.Exception - Thrown if protocol cannot be initialized successfully. This will cause the
ProtocolStack to fail, so the channel constructor will throw an exceptionpublic void destroy()
ProtocolChannel.close().
Does some cleanup; after the call the VM will terminate
destroy in class TPpublic java.lang.Object handleDownEvent(Event evt)
handleDownEvent in class TP
protected void send(Message msg,
Address dest,
boolean multicast)
throws java.lang.Exception
TP
send in class TPjava.lang.Exception
public void sendMulticast(byte[] data,
int offset,
int length)
throws java.lang.Exception
TP
sendMulticast in class TPdata - The data to be sent. This is not a copy, so don't modify it
java.lang.Exception
public void sendUnicast(PhysicalAddress dest,
byte[] data,
int offset,
int length)
throws java.lang.Exception
TP
sendUnicast in class TPdest - Must be a non-null unicast addressdata - The data to be sent. This is not a copy, so don't modify it
java.lang.Exceptionpublic java.lang.String getInfo()
getInfo in class TPprotected PhysicalAddress getPhysicalAddress()
getPhysicalAddress in class TP
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||