|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--solar.service.BaseService
A base service implementation.
Field Summary | |
protected boolean |
_inited
|
protected ServiceManager |
_manager
|
protected java.lang.String |
_name
|
Constructor Summary | |
BaseService()
|
Method Summary | |
protected void |
assertInited()
Check whether the service has been initialized. |
protected Service |
getDependentService(java.lang.String nameKey,
java.lang.String defaultName)
This method is provided so service can specify a different name key for other services used by it. |
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. |
void |
handleEvent(Event evt)
Processing an event. |
void |
handleEvent(Event evt,
Address source)
|
java.lang.Object |
handleRequest(Request req)
Processing a request. |
boolean |
hasInited()
Return whether the service has been initialized. |
void |
init()
Initiate the service, do not try to init dependent services here. |
void |
init(java.lang.Object param)
|
void |
initDependents()
Initialize dependent services here. |
void |
setInited(boolean flag)
|
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 class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ServiceManager _manager
protected java.lang.String _name
protected boolean _inited
Constructor Detail |
public BaseService()
Method Detail |
public void setInited(boolean flag)
protected void assertInited()
protected Service getDependentService(java.lang.String nameKey, java.lang.String defaultName) throws ServiceException
ServiceException
public void setServiceManager(ServiceManager manager)
Service
setServiceManager
in interface Service
public ServiceManager getServiceManager()
Service
getServiceManager
in interface Service
public void setName(java.lang.String name)
Service
setName
in interface Service
public java.lang.String getName()
Service
getName
in interface Service
public void init() throws ServiceException
Service
init
in interface Service
ServiceException
public void initDependents() throws ServiceException
Service
initDependents
in interface Service
ServiceException
public void init(java.lang.Object param) throws ServiceException
ServiceException
public boolean hasInited()
Service
hasInited
in interface Service
public void start()
Service
start
in interface Service
public void stop()
Service
stop
in interface Service
public void handleDispatchUnit(DispatchUnit dunit) throws java.lang.Exception
Service
handleDispatchUnit
in interface Service
java.lang.Exception
public java.lang.Object handleRequest(Request req) throws java.lang.Exception
RequestHandler
handleRequest
in interface RequestHandler
java.lang.Exception
public void handleEvent(Event evt, Address source) throws java.lang.Exception
java.lang.Exception
public void handleEvent(Event evt) throws java.lang.Exception
EventHandler
handleEvent
in interface EventHandler
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |