org.livetribe.slp.spi
Class StandardAgentManager
java.lang.Object
org.livetribe.slp.spi.StandardAgentManager
- All Implemented Interfaces:
- AgentManager
- Direct Known Subclasses:
- StandardDirectoryAgentManager, StandardServiceAgentManager, StandardUserAgentManager
public abstract class StandardAgentManager
- extends Object
- implements AgentManager
- Version:
- $Rev: 200 $ $Date: 2006-08-09 14:17:10 +0200 (Wed, 09 Aug 2006) $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final Logger logger
StandardAgentManager
public StandardAgentManager()
getMulticastAddress
public InetAddress getMulticastAddress()
setMulticastAddress
public void setMulticastAddress(InetAddress multicastAddress)
getPort
public int getPort()
setPort
public void setPort(int port)
getNotificationPort
public int getNotificationPort()
setNotificationPort
public void setNotificationPort(int notificationPort)
getMulticastMaxWait
public long getMulticastMaxWait()
setMulticastMaxWait
public void setMulticastMaxWait(long multicastMaxWait)
getMulticastTimeouts
public long[] getMulticastTimeouts()
setMulticastTimeouts
public void setMulticastTimeouts(long[] multicastTimeouts)
getMaxTransmissionUnit
public int getMaxTransmissionUnit()
setMaxTransmissionUnit
public void setMaxTransmissionUnit(int maxTransmissionUnit)
setUDPConnector
public void setUDPConnector(UDPConnector connector)
getUDPConnector
protected UDPConnector getUDPConnector()
setTCPConnector
public void setTCPConnector(TCPConnector tcpConnector)
getTCPConnector
protected TCPConnector getTCPConnector()
addMessageListener
public void addMessageListener(MessageListener listener,
boolean udp)
- Specified by:
addMessageListener
in interface AgentManager
removeMessageListener
public void removeMessageListener(MessageListener listener,
boolean udp)
- Specified by:
removeMessageListener
in interface AgentManager
isRunning
public boolean isRunning()
- Specified by:
isRunning
in interface AgentManager
start
public void start()
throws IOException
- Specified by:
start
in interface AgentManager
- Throws:
IOException
doStart
protected void doStart()
throws IOException
- Throws:
IOException
createUDPConnector
protected UDPConnector createUDPConnector()
throws IOException
- Throws:
IOException
configureUDPConnector
protected void configureUDPConnector(UDPConnector connector)
createTCPConnector
protected TCPConnector createTCPConnector()
throws IOException
- Throws:
IOException
configureTCPConnector
protected void configureTCPConnector(TCPConnector connector)
stop
public void stop()
throws IOException
- Specified by:
stop
in interface AgentManager
- Throws:
IOException
doStop
protected void doStop()
throws IOException
- Throws:
IOException
generateXID
protected int generateXID()
closeNoExceptions
protected void closeNoExceptions(Socket socket)
serializeMessage
protected byte[] serializeMessage(Message message)
convergentDASrvRqst
protected DAAdvert[] convergentDASrvRqst(SrvRqst message,
long timeframe)
throws IOException
- Throws:
IOException
convergentSASrvRqst
protected SAAdvert[] convergentSASrvRqst(SrvRqst message,
long timeframe)
throws IOException
- Throws:
IOException
convergentSrvRqst
protected SrvRply[] convergentSrvRqst(SrvRqst message,
long timeframe)
throws IOException
- Throws:
IOException
convergentMulticastSend
protected List convergentMulticastSend(Rqst message,
long timeframe,
Converger converger)
throws IOException
- Implements the multicast convergence algorithm, with the extension of returning
after the specified timeframe. If the timeframe is negative, the plain multicast
convergence algorithm is used.
The multicast convergence algorithm tries to give some sort of reliability to
multicast and sends the message via multicast many times at different response timeouts
until: a) all responses have been received, or b) no responses have been received
and a timeout expires, or c) the number of responders cannot fit into a datagram
of the size of the configured MTU.
The multicast convergence algorithm works in this way:
- Set the initial responder list to be empty
- Send the message via multicast, with the responder list
- Wait at most responseTimeout[i] and collect the replies
- Extract the responders from the replies into the responder list
- Increase i and go back to point 2
Exit point of the algorithm are when no responses are received (because ServiceAgents
and DirectoryAgents drops messages containing their IP in the received responder list),
or when a timeout expires.
The algorithm is described very briefly in RFC 2608, section 6.3
- Returns:
- A list of messages in response of the multicast send
- Throws:
IOException
Copyright © 2006-2012 LiveTribe. All Rights Reserved.