solar.service
Interface Service

All Superinterfaces:
EventHandler, RequestHandler
All Known Subinterfaces:
DanService, DirectoryService, DispatchService, FapService, ForkService, MobileCodeService, MobileHostService, MulticastService, PackService, PubSubService, RoutingService, RpcService, TransportService
All Known Implementing Classes:
AbstractDanService, BaseService, BaseTransportService, CentralDirectoryService, ClientPackService, ClientPubSubService, DanClientService, DistDirectoryService, FapClientService, ManualRoutingService, NaiveMulticastService, ScribeMulticastService, ScribePackService, ScribePubSubService, SolarDispatchService, SolarForkService, SolarMobileHostService, SolarRpcService

public interface Service
extends EventHandler, RequestHandler

Service is an independent module that has a name and a set of configuration options.

Version:
$Id: Service.java,v 1.15 2003/09/25 05:29:55 glchen Exp $
Author:
Guanling Chen

Method Summary
 java.lang.String getName()
          Return the name of this service.
 ServiceManager getServiceManager()
          Get the service manager for this service.
 void handleDispatchUnit(DispatchUnit dunit)
          Handle the data unit delivered by dispatch service.
 boolean hasInited()
          Return whether the service has been initialized.
 void init()
          Initiate the service, do not try to init dependent services here.
 void initDependents()
          Initialize dependent services here.
 void setName(java.lang.String name)
          Set the name of this service.
 void setServiceManager(ServiceManager manager)
          Set the service manager for this service.
 void start()
          Start the service.
 void stop()
          Shutdown the service.
 
Methods inherited from interface solar.api.EventHandler
handleEvent
 
Methods inherited from interface solar.api.RequestHandler
handleRequest
 

Method Detail

handleDispatchUnit

public void handleDispatchUnit(DispatchUnit dunit)
                        throws java.lang.Exception
Handle the data unit delivered by dispatch service.

java.lang.Exception

setServiceManager

public void setServiceManager(ServiceManager manager)
Set the service manager for this service.


getServiceManager

public ServiceManager getServiceManager()
Get the service manager for this service.


setName

public void setName(java.lang.String name)
Set the name of this service.


getName

public java.lang.String getName()
Return the name of this service.


init

public void init()
          throws ServiceException
Initiate the service, do not try to init dependent services here.

ServiceException

initDependents

public void initDependents()
                    throws ServiceException
Initialize dependent services here.

ServiceException

hasInited

public boolean hasInited()
Return whether the service has been initialized.


start

public void start()
Start the service.


stop

public void stop()
Shutdown the service.