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

Nested Class Summary
classLogicalLink.AllLinksDown
classLogicalLink.NoLinksAvailable
interfaceLogicalLink.Receiver
Constructor Summary
LogicalLink(LogicalLink.Receiver r)
LogicalLink()
Method Summary
voidaddLink(String local_addr, int local_port, String remote_addr, int remote_port)
voidaddLink(String local_addr, int local_port, String remote_addr, int remote_port, long timeout, long hb_interval)
VectorgetLinks()
voidlinkDown(InetAddress local, int local_port, InetAddress remote, int remote_port)
One of the physical links went down
voidlinkUp(InetAddress local, int local_port, InetAddress remote, int remote_port)
One of the physical links came up
static voidmain(String[] args)
voidmissedHeartbeat(InetAddress local, int local_port, InetAddress remote, int remote_port, int num_missed_hbs)
Missed one or more heartbeats.
intnumberOfEstablishedLinks()
intnumberOfLinks()
voidreceive(byte[] buf)
Receive a message from any of the physical links.
voidreceivedHeartbeatAgain(InetAddress local, int local_port, InetAddress remote, int remote_port)
Heartbeat came back again (before link was taken down) after missing some heartbeats
voidremoveAllLinks()
booleansend(byte[] buf)
Send a message to the other side
voidsetReceiver(LogicalLink.Receiver r)
voidstart()
Start all links
voidstop()
Stop all links

Constructor Detail

LogicalLink

public LogicalLink(LogicalLink.Receiver r)

LogicalLink

public LogicalLink()

Method Detail

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

linkUp

public void linkUp(InetAddress local, int local_port, InetAddress remote, int remote_port)
One of the physical links came up

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

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

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

removeAllLinks

public void removeAllLinks()

send

public boolean send(byte[] buf)
Send a message to the other side

setReceiver

public void setReceiver(LogicalLink.Receiver r)

start

public void start()
Start all links

stop

public void stop()
Stop all links
Copyright ? 1998-2005 Bela Ban. All Rights Reserved.