예제 #1
0
파일: ODEServer.java 프로젝트: rrialq/ode
 public InstanceManagement getInstanceManagement() {
   return _mgtService.getInstanceMgmt();
 }
예제 #2
0
파일: ODEServer.java 프로젝트: rrialq/ode
 public ProcessManagement getProcessManagement() {
   return _mgtService.getProcessMgmt();
 }
예제 #3
0
파일: ODEServer.java 프로젝트: rrialq/ode
  public void init(
      String contextPath, ConfigurationContext configContext, ODEConfigProperties config)
      throws ServletException {
    _configContext = configContext;
    String rootDir = System.getProperty("org.apache.ode.rootDir");
    if (rootDir != null) _appRoot = new File(rootDir);
    else _appRoot = new File(contextPath);

    if (!_appRoot.isDirectory())
      throw new IllegalArgumentException(_appRoot + " does not exist or is not a directory");
    TempFileManager.setWorkingDirectory(_appRoot);

    __log.debug("Loading properties");
    String confDir = System.getProperty("org.apache.ode.configDir");
    _configRoot = confDir == null ? new File(_appRoot, "conf") : new File(confDir);
    if (!_configRoot.isDirectory())
      throw new IllegalArgumentException(_configRoot + " does not exist or is not a directory");

    try {
      if (config == null) {
        _odeConfig = new ODEConfigProperties(_configRoot);
        _odeConfig.load();
      } else {
        _odeConfig = config;
      }
    } catch (FileNotFoundException fnf) {
      String errmsg = __msgs.msgOdeInstallErrorCfgNotFound(_odeConfig.getFile());
      __log.warn(errmsg);
    } catch (Exception ex) {
      String errmsg = __msgs.msgOdeInstallErrorCfgReadError(_odeConfig.getFile());
      __log.error(errmsg, ex);
      throw new ServletException(errmsg, ex);
    }

    String wdir = _odeConfig.getWorkingDir();
    if (wdir == null) _workRoot = _appRoot;
    else _workRoot = new File(wdir.trim());
    if (!_workRoot.isDirectory())
      throw new IllegalArgumentException(_workRoot + " does not exist or is not a directory");

    __log.debug("Initializing transaction manager");
    initTxMgr();
    if (txMgrCreatedCallback != null) {
      txMgrCreatedCallback.run();
    }
    __log.debug("Creating data source.");
    initDataSource();
    __log.debug("Starting DAO.");
    initDAO();
    EndpointReferenceContextImpl eprContext = new EndpointReferenceContextImpl(this);
    __log.debug("Initializing BPEL process store.");
    initProcessStore(eprContext);
    __log.debug("Initializing BPEL server.");
    initBpelServer(eprContext);
    __log.debug("Initializing HTTP connection manager");
    initHttpConnectionManager();

    // Register BPEL event listeners configured in axis2.properties file.
    registerEventListeners();
    registerMexInterceptors();
    registerExternalVariableModules();

    _store.loadAll();

    try {
      _bpelServer.start();
    } catch (Exception ex) {
      String errmsg = __msgs.msgOdeBpelServerStartFailure();
      __log.error(errmsg, ex);
      throw new ServletException(errmsg, ex);
    }

    _poller = getDeploymentPollerExt();
    if (_poller == null) {
      _poller = new DeploymentPoller(_store.getDeployDir(), this);
    }

    _mgtService = new ManagementService();
    _mgtService.enableService(
        _configContext.getAxisConfiguration(), _bpelServer, _store, _appRoot.getAbsolutePath());

    try {
      __log.debug("Initializing Deployment Web Service");
      new DeploymentWebService()
          .enableService(
              _configContext.getAxisConfiguration(),
              _store,
              _poller,
              _appRoot.getAbsolutePath(),
              _workRoot.getAbsolutePath());
    } catch (Exception e) {
      throw new ServletException(e);
    }

    __log.debug("Starting scheduler");
    _scheduler.start();

    __log.debug("Initializing JCA adapter.");
    initConnector();

    _poller.start();
    __log.info(__msgs.msgPollingStarted(_store.getDeployDir().getAbsolutePath()));
    __log.info(__msgs.msgOdeStarted());
  }