org.livetribe.slp.api.sa
Class StandardServiceAgent

java.lang.Object
  extended by org.livetribe.slp.api.StandardAgent
      extended by 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) $

Field Summary
 
Fields inherited from class org.livetribe.slp.api.StandardAgent
logger
 
Constructor Summary
StandardServiceAgent()
           
 
Method Summary
protected  void configureServiceAgentManager(ServiceAgentManager saManager)
           
protected  edu.emory.mathcs.backport.java.util.concurrent.ScheduledExecutorService createScheduledExecutorService()
          Creates and returns the default ScheduledExecutorService, configured to use one daemon thread.
protected  ServiceAgentManager createServiceAgentManager()
           
 void deregister(ServiceInfo service)
           
protected  List discoverDirectoryAgents(Scopes scopes)
           
protected  void doStart()
           
protected  void doStop()
           
protected  List findDirectoryAgents(Scopes scopes)
           
 Attributes getAttributes()
           
protected  List getCachedDirectoryAgents(Scopes scopes)
           
 int getDiscoveryInitialWaitBound()
           
 long getDiscoveryPeriod()
           
 String getIdentifier()
           
 InetAddress getInetAddress()
           
 String getLanguage()
           
 Collection getServices()
           
protected  void handleMulticastDAAdvert(DAAdvert message, InetSocketAddress address)
           
protected  void handleMulticastSrvRqst(SrvRqst message, InetSocketAddress address)
           
protected  void handleTCPSrvRqst(SrvRqst message, Socket socket)
           
 boolean isPeriodicDirectoryAgentDiscoveryEnabled()
           
 boolean isPeriodicServiceRenewalEnabled()
           
 void register(ServiceInfo service)
          Registers the given service with directory agents.
 void setAttributes(Attributes attributes)
           
 void setDiscoveryInitialWaitBound(int discoveryInitialWaitBound)
          Sets the bound (in seconds) to the initial random delay this ServiceAgent waits before attempting to discover DirectoryAgents
 void setDiscoveryPeriod(long discoveryPeriod)
           
 void setInetAddress(InetAddress address)
           
 void setLanguage(String language)
           
 void setPeriodicDirectoryAgentDiscoveryEnabled(boolean periodicDirectoryAgentDiscoveryEnabled)
           
 void setPeriodicServiceRenewalEnabled(boolean periodicServiceRenewalEnabled)
           
 void setScheduledExecutorService(edu.emory.mathcs.backport.java.util.concurrent.ScheduledExecutorService scheduledExecutorService)
          Sets the ScheduledExecutorService used to perform periodic tasks such as discovery of DirectoryAgents.
 void setServiceAgentManager(ServiceAgentManager manager)
           
 
Methods inherited from class org.livetribe.slp.api.StandardAgent
getPort, getScopes, isRunning, setPort, setScopes, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.livetribe.slp.api.Agent
isRunning, setScopes, start, stop
 

Constructor Detail

StandardServiceAgent

public StandardServiceAgent()
Method Detail

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.