|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.lib.server.BaseService
@InterfaceAudience.Private public abstract class BaseService
Convenience class implementing the Service
interface.
Constructor Summary | |
---|---|
BaseService(String prefix)
Service constructor. |
Method Summary | |
---|---|
void |
destroy()
Destroy the services. |
protected String |
getPrefix()
Returns the service prefix. |
protected String |
getPrefixedName(String name)
Returns the full prefixed name of a service property. |
protected Server |
getServer()
Returns the server owning the service. |
protected org.apache.hadoop.conf.Configuration |
getServiceConfig()
Returns the service configuration properties. |
Class[] |
getServiceDependencies()
Returns the service dependencies of this service. |
protected abstract void |
init()
Initializes the server. |
void |
init(Server server)
Initializes the service. |
void |
postInit()
Post initializes the service. |
void |
serverStatusChange(Server.Status oldStatus,
Server.Status newStatus)
Notification callback when the server changes its status. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.hadoop.lib.server.Service |
---|
getInterface |
Constructor Detail |
---|
public BaseService(String prefix)
prefix
- service prefix.Method Detail |
---|
public final void init(Server server) throws ServiceException
#SERVER#.#SERVICE#.
prefix). The property names are then
trimmed from the #SERVER#.#SERVICE#.
prefix.
After collecting the service properties it delegates to the
init()
method.
init
in interface Service
server
- the server initializing the service, give access to the
server context.
ServiceException
- thrown if the service could not be initialized.public void postInit() throws ServiceException
Server
after all services of the server have been initialized.
This method does a NOP.
postInit
in interface Service
ServiceException
- thrown if the service could not be
post-initialized.public void destroy()
Server
owning the service is being destroyed.
This method does a NOP.
destroy
in interface Service
public Class[] getServiceDependencies()
getServiceDependencies
in interface Service
public void serverStatusChange(Server.Status oldStatus, Server.Status newStatus) throws ServiceException
serverStatusChange
in interface Service
oldStatus
- old server status.newStatus
- new server status.
ServiceException
- thrown if the service could not process the status change.protected String getPrefix()
protected Server getServer()
protected String getPrefixedName(String name)
name
- of the property.
protected org.apache.hadoop.conf.Configuration getServiceConfig()
#SERVER#.#SERVICE#.
in the server configuration.
#SERVER#.#SERVICE#.
prefix.protected abstract void init() throws ServiceException
init(Server)
after all service properties
(properties prefixed with
ServiceException
- thrown if the service could not be initialized.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |