org.jgroups.blocks
Class LogicalLink
java.lang.Object
org.jgroups.blocks.LogicalLink
- Link.Receiver
public class LogicalLink
extends java.lang.Object
Implements a logical point-to-point link between 2 entities consisting of a number of physical links.
Traffic is routed over any of the physical link, according to policies. Examples are: send traffic
over all links, round-robin, use first link for 70% of traffic, other links for the remaining 30%.
- Bela Ban, June 2000
void | addLink(String local_addr, int local_port, String remote_addr, int remote_port)
|
void | addLink(String local_addr, int local_port, String remote_addr, int remote_port, long timeout, long hb_interval)
|
Vector | getLinks()
|
void | linkDown(InetAddress local, int local_port, InetAddress remote, int remote_port) - One of the physical links went down
|
void | linkUp(InetAddress local, int local_port, InetAddress remote, int remote_port) - One of the physical links came up
|
static void | main(String[] args)
|
void | missedHeartbeat(InetAddress local, int local_port, InetAddress remote, int remote_port, int num_missed_hbs) - Missed one or more heartbeats.
|
int | numberOfEstablishedLinks()
|
int | numberOfLinks()
|
void | receive(byte[] buf) - Receive a message from any of the physical links.
|
void | receivedHeartbeatAgain(InetAddress local, int local_port, InetAddress remote, int remote_port) - Heartbeat came back again (before link was taken down) after missing some heartbeats
|
void | removeAllLinks()
|
boolean | send(byte[] buf) - Send a message to the other side
|
void | setReceiver(LogicalLink.Receiver r)
|
void | start() - Start all links
|
void | stop() - Stop all links
|
LogicalLink
public LogicalLink()
addLink
public void addLink(String local_addr,
int local_port,
String remote_addr,
int remote_port)
addLink
public void addLink(String local_addr,
int local_port,
String remote_addr,
int remote_port,
long timeout,
long hb_interval)
getLinks
public Vector getLinks()
linkDown
public void linkDown(InetAddress local,
int local_port,
InetAddress remote,
int remote_port)
One of the physical links went down
- linkDown in interface Link.Receiver
linkUp
public void linkUp(InetAddress local,
int local_port,
InetAddress remote,
int remote_port)
One of the physical links came up
- linkUp in interface Link.Receiver
main
public static void main(String[] args)
missedHeartbeat
public void missedHeartbeat(InetAddress local,
int local_port,
InetAddress remote,
int remote_port,
int num_missed_hbs)
Missed one or more heartbeats. Link is not yet down, though
- missedHeartbeat in interface Link.Receiver
numberOfEstablishedLinks
public int numberOfEstablishedLinks()
numberOfLinks
public int numberOfLinks()
receive
public void receive(byte[] buf)
Receive a message from any of the physical links. That's why this and the next methods have to be
synchronized
- receive in interface Link.Receiver
receivedHeartbeatAgain
public void receivedHeartbeatAgain(InetAddress local,
int local_port,
InetAddress remote,
int remote_port)
Heartbeat came back again (before link was taken down) after missing some heartbeats
- receivedHeartbeatAgain in interface Link.Receiver
removeAllLinks
public void removeAllLinks()
start
public void start()
Start all links
stop
public void stop()
Stop all links
Copyright B) 2001,2002 www.jgroups.com . All Rights Reserved.