Package org.apache.hadoop.lib.server
Interface Service
- All Known Implementing Classes:
BaseService,FileSystemAccessService,GroupsService,InstrumentationService,SchedulerService
@Private
public interface Service
Service interface for components to be managed by the
Server class.-
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Destroy the services.Returns the interface implemented by this service.Class[]Returns the service dependencies of this service.voidInitializes the service.voidpostInit()Post initializes the service.voidserverStatusChange(Server.Status oldStatus, Server.Status newStatus) Notification callback when the server changes its status.
-
Method Details
-
init
Initializes the service. This method is called once, when theServerowning the service is being initialized.- Parameters:
server- the server initializing the service, give access to the server context.- Throws:
ServiceException- thrown if the service could not be initialized.
-
postInit
Post initializes the service. This method is called by theServerafter all services of the server have been initialized.- Throws:
ServiceException- thrown if the service could not be post-initialized.
-
destroy
void destroy()Destroy the services. This method is called once, when theServerowning the service is being destroyed. -
getServiceDependencies
Class[] getServiceDependencies()Returns the service dependencies of this service. The service will be instantiated only if all the service dependencies are already initialized.- Returns:
- the service dependencies.
-
getInterface
Class getInterface()Returns the interface implemented by this service. This interface is used theServerwhen theServer.get(Class)method is used to retrieve a service.- Returns:
- the interface that identifies the service.
-
serverStatusChange
Notification callback when the server changes its status.- Parameters:
oldStatus- old server status.newStatus- new server status.- Throws:
ServiceException- thrown if the service could not process the status change.
-