public abstract class AbstractService extends Object implements Service
Service.STATE
Constructor and Description |
---|
AbstractService(String name)
Construct the service.
|
Modifier and Type | Method and Description |
---|---|
HiveConf |
getHiveConf()
Get the configuration of this service.
|
String |
getName()
Get the name of this service.
|
Service.STATE |
getServiceState()
Get the current service state
|
long |
getStartTime()
Get the service start time
|
void |
init(HiveConf hiveConf)
Initialize the service.
|
void |
register(ServiceStateChangeListener l)
Register an instance of the service state change events.
|
protected void |
setHiveConf(HiveConf hiveConf) |
void |
start()
Start the service.
|
void |
stop()
Stop the service.
|
void |
unregister(ServiceStateChangeListener l)
Unregister a previously instance of the service state change events.
|
public AbstractService(String name)
name
- service namepublic Service.STATE getServiceState()
Service
getServiceState
in interface Service
public void init(HiveConf hiveConf)
Service.STATE.NOTINITED
to Service.STATE.INITED
unless the
operation failed and an exception was raised.init
in interface Service
IllegalStateException
- if the current service state does not permit
this actionprotected final void setHiveConf(HiveConf hiveConf)
public void start()
Service.STATE.INITED
to Service.STATE.STARTED
unless the
operation failed and an exception was raised.start
in interface Service
IllegalStateException
- if the current service state does not permit
this actionpublic void stop()
stop
in interface Service
IllegalStateException
- if the current service state does not permit
this actionpublic void register(ServiceStateChangeListener l)
Service
public void unregister(ServiceStateChangeListener l)
Service
unregister
in interface Service
l
- the listener to unregister.public String getName()
Service
public HiveConf getHiveConf()
Service
getHiveConf
in interface Service
public long getStartTime()
Service
getStartTime
in interface Service
Copyright © 2022 The Apache Software Foundation. All rights reserved.