|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.oozie.service.Services
public class Services
Services is a singleton that manages the lifecycle of all registered Services
.
XLogService
and ConfigurationService
. The rest of the services are loaded from the
CONF_SERVICE_CLASSES
configuration property. The services class names must be separated by commas (spaces
and enters are allowed). The CONF_SYSTEM_MODE
configuration property is any of
NORMAL/SAFEMODE/NOWEBSERVICE. Services are loaded and initialized in the order they are defined in the in
configuration property. After all services are initialized, if the Instrumentation service is present, all
services that implement the Instrumentable
are instrumented. Services are destroyed in reverse order.
If services initialization fail, initialized services are immediatly destroyed.
Field Summary | |
---|---|
static String |
CONF_DELETE_RUNTIME_DIR
|
static String |
CONF_SERVICE_CLASSES
|
static String |
CONF_SERVICE_EXT_CLASSES
|
static String |
CONF_SYSTEM_ID
|
static String |
CONF_SYSTEM_MODE
|
static String |
OOZIE_HOME_DIR
Environment variable that indicates the location of the Oozie home directory. |
Constructor Summary | |
---|---|
Services()
Create a services. |
Method Summary | ||
---|---|---|
void |
destroy()
Destroy all services. |
|
static Services |
get()
Return the services singleton. |
|
|
get(Class<T> serviceKlass)
Return a service by its public interface. |
|
org.apache.hadoop.conf.Configuration |
getConf()
Return the services configuration. |
|
static String |
getOozieHome()
|
|
String |
getRuntimeDir()
Return the runtime directory of the Oozie instance. |
|
String |
getSystemId()
Return the system ID, the value defined in the CONF_SYSTEM_ID configuration property. |
|
org.apache.oozie.client.OozieClient.SYSTEM_MODE |
getSystemMode()
Return active system mode. |
|
void |
init()
Initialize all services define in the CONF_SERVICE_CLASSES configuration property. |
|
static void |
setOozieHome()
|
|
void |
setService(Class<? extends Service> klass)
Set a service programmatically. |
|
void |
setSystemMode(org.apache.oozie.client.OozieClient.SYSTEM_MODE sysMode)
Set and set system mode. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String OOZIE_HOME_DIR
public static final String CONF_SYSTEM_ID
public static final String CONF_SERVICE_CLASSES
public static final String CONF_SERVICE_EXT_CLASSES
public static final String CONF_SYSTEM_MODE
public static final String CONF_DELETE_RUNTIME_DIR
Constructor Detail |
---|
public Services() throws ServiceException
ServiceException
- thrown if any of the built in services could not initialize.Method Detail |
---|
public static void setOozieHome() throws ServiceException
ServiceException
public static String getOozieHome() throws ServiceException
ServiceException
public org.apache.oozie.client.OozieClient.SYSTEM_MODE getSystemMode()
public String getRuntimeDir()
public String getSystemId()
CONF_SYSTEM_ID
configuration property.
CONF_SYSTEM_ID
configuration property.public void setSystemMode(org.apache.oozie.client.OozieClient.SYSTEM_MODE sysMode)
sysMode
- system modepublic org.apache.hadoop.conf.Configuration getConf()
public void init() throws ServiceException
CONF_SERVICE_CLASSES
configuration property.
ServiceException
- thrown if any of the services could not initialize.public void destroy()
public <T extends Service> T get(Class<T> serviceKlass)
serviceKlass
- service public interface.
null
if not define.public void setService(Class<? extends Service> klass) throws ServiceException
klass
- service klass
ServiceException
- if the service could not be initialized, at this point all services have been
destroyed.public static Services get()
null
if not initialized.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |