|
|||||||||||
| 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
ServiceExceptionpublic void setServiceManager(ServiceManager manager)
Service
setServiceManager in interface Servicepublic ServiceManager getServiceManager()
Service
getServiceManager in interface Servicepublic void setName(java.lang.String name)
Service
setName in interface Servicepublic java.lang.String getName()
Service
getName in interface Service
public void init()
throws ServiceException
Service
init in interface ServiceServiceException
public void initDependents()
throws ServiceException
Service
initDependents in interface ServiceServiceException
public void init(java.lang.Object param)
throws ServiceException
ServiceExceptionpublic boolean hasInited()
Service
hasInited in interface Servicepublic void start()
Service
start in interface Servicepublic void stop()
Service
stop in interface Service
public void handleDispatchUnit(DispatchUnit dunit)
throws java.lang.Exception
Service
handleDispatchUnit in interface Servicejava.lang.Exception
public java.lang.Object handleRequest(Request req)
throws java.lang.Exception
RequestHandler
handleRequest in interface RequestHandlerjava.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 EventHandlerjava.lang.Exception
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||