org.livetribe.slp.api.sa
Class StandardServiceAgent
java.lang.Object
org.livetribe.slp.api.StandardAgent
org.livetribe.slp.api.sa.StandardServiceAgent
- All Implemented Interfaces:
- Agent, ServiceAgent
public class StandardServiceAgent
- extends StandardAgent
- implements ServiceAgent
- Version:
- $Rev: 258 $ $Date: 2006-08-23 15:45:17 +0200 (Wed, 23 Aug 2006) $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StandardServiceAgent
public StandardServiceAgent()
setServiceAgentManager
public void setServiceAgentManager(ServiceAgentManager manager)
- Specified by:
setServiceAgentManager
in interface ServiceAgent
getIdentifier
public String getIdentifier()
setScheduledExecutorService
public void setScheduledExecutorService(edu.emory.mathcs.backport.java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
- Sets the ScheduledExecutorService used to perform periodic tasks such as discovery
of DirectoryAgents.
- See Also:
createScheduledExecutorService()
setAttributes
public void setAttributes(Attributes attributes)
getAttributes
public Attributes getAttributes()
setLanguage
public void setLanguage(String language)
getLanguage
public String getLanguage()
isPeriodicDirectoryAgentDiscoveryEnabled
public boolean isPeriodicDirectoryAgentDiscoveryEnabled()
setPeriodicDirectoryAgentDiscoveryEnabled
public void setPeriodicDirectoryAgentDiscoveryEnabled(boolean periodicDirectoryAgentDiscoveryEnabled)
setDiscoveryPeriod
public void setDiscoveryPeriod(long discoveryPeriod)
getDiscoveryPeriod
public long getDiscoveryPeriod()
setDiscoveryInitialWaitBound
public void setDiscoveryInitialWaitBound(int discoveryInitialWaitBound)
- Sets the bound (in seconds) to the initial random delay this ServiceAgent waits
before attempting to discover DirectoryAgents
getDiscoveryInitialWaitBound
public int getDiscoveryInitialWaitBound()
isPeriodicServiceRenewalEnabled
public boolean isPeriodicServiceRenewalEnabled()
setPeriodicServiceRenewalEnabled
public void setPeriodicServiceRenewalEnabled(boolean periodicServiceRenewalEnabled)
setInetAddress
public void setInetAddress(InetAddress address)
getInetAddress
public InetAddress getInetAddress()
register
public void register(ServiceInfo service)
throws IOException,
ServiceLocationException
- Description copied from interface:
ServiceAgent
- Registers the given service with directory agents.
If this SA is not yet started, the service will be scheduled for registration
when the SA is started.
- Specified by:
register
in interface ServiceAgent
- Parameters:
service
- The service to register
- Throws:
IOException
ServiceLocationException
deregister
public void deregister(ServiceInfo service)
throws IOException,
ServiceLocationException
- Specified by:
deregister
in interface ServiceAgent
- Throws:
IOException
ServiceLocationException
getServices
public Collection getServices()
doStart
protected void doStart()
throws Exception
- Specified by:
doStart
in class StandardAgent
- Throws:
Exception
createScheduledExecutorService
protected edu.emory.mathcs.backport.java.util.concurrent.ScheduledExecutorService createScheduledExecutorService()
- Creates and returns the default ScheduledExecutorService, configured to use one daemon thread.
createServiceAgentManager
protected ServiceAgentManager createServiceAgentManager()
configureServiceAgentManager
protected void configureServiceAgentManager(ServiceAgentManager saManager)
doStop
protected void doStop()
throws Exception
- Specified by:
doStop
in class StandardAgent
- Throws:
Exception
findDirectoryAgents
protected List findDirectoryAgents(Scopes scopes)
throws IOException,
ServiceLocationException
- Throws:
IOException
ServiceLocationException
getCachedDirectoryAgents
protected List getCachedDirectoryAgents(Scopes scopes)
discoverDirectoryAgents
protected List discoverDirectoryAgents(Scopes scopes)
throws IOException
- Throws:
IOException
handleMulticastSrvRqst
protected void handleMulticastSrvRqst(SrvRqst message,
InetSocketAddress address)
throws ServiceLocationException
- Throws:
ServiceLocationException
handleMulticastDAAdvert
protected void handleMulticastDAAdvert(DAAdvert message,
InetSocketAddress address)
handleTCPSrvRqst
protected void handleTCPSrvRqst(SrvRqst message,
Socket socket)
throws ServiceLocationException
- Throws:
ServiceLocationException
Copyright © 2006-2012 LiveTribe. All Rights Reserved.