org.jgroups.blocks
Class LogicalLink
public
class
LogicalLink
extends Object
implements Link.Receiver
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%.
Author: Bela Ban, June 2000
| Method Summary |
| 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 |
public LogicalLink()
public void addLink(String local_addr, int local_port, String remote_addr, int remote_port)
public void addLink(String local_addr, int local_port, String remote_addr, int remote_port, long timeout, long hb_interval)
public Vector getLinks()
public void linkDown(InetAddress local, int local_port, InetAddress remote, int remote_port)
One of the physical links went down
public void linkUp(InetAddress local, int local_port, InetAddress remote, int remote_port)
One of the physical links came up
public static void main(String[] args)
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
public int numberOfEstablishedLinks()
public int numberOfLinks()
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
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
public void removeAllLinks()
public boolean send(byte[] buf)
Send a message to the other side
public void start()
Start all links
public void stop()
Stop all links
Copyright ? 1998-2005 Bela Ban. All Rights Reserved.