Ejemplo n.º 1
0
 /**
  * Create a services.
  *
  * <p>The built in services are initialized.
  *
  * @throws ServiceException thrown if any of the built in services could not initialize.
  */
 public Services() throws ServiceException {
   if (SERVICES != null) {
     XLog log = XLog.getLog(getClass());
     log.warn(XLog.OPS, "Previous services singleton active, destroying it");
     SERVICES.destroy();
     SERVICES = null;
   }
   setServiceInternal(XLogService.class, false);
   setServiceInternal(ConfigurationService.class, true);
   conf = get(ConfigurationService.class).getConf();
   systemId = conf.get(CONF_SYSTEM_ID, ("oozie-" + System.getProperty("user.name")));
   if (systemId.length() > MAX_SYSTEM_ID_LEN) {
     systemId = systemId.substring(0, MAX_SYSTEM_ID_LEN);
     XLog.getLog(getClass())
         .warn(
             "System ID [{0}] exceeds maximun lenght [{1}], trimming",
             systemId, MAX_SYSTEM_ID_LEN);
   }
   setSystemMode(SYSTEM_MODE.valueOf(conf.get(CONF_SYSTEM_MODE, SYSTEM_MODE.NORMAL.toString())));
   runtimeDir = createRuntimeDir();
 }