public synchronized void start() throws DatabaseConfigException { if (_started) { return; } _needH2Shutdown = false; _datasource = null; _connectionManager = null; initDataSource(); _started = true; }
public Object msgOdeUsingInternalDb(String dbIntenralJdbcUrl, String dbInternalJdbcDriverClass) { return format("ODE using internal database \"{0}\" with driver {1}.", dbIntenralJdbcUrl, dbInternalJdbcDriverClass); }
private void initDataSource() throws DatabaseConfigException { switch (_odeConfig.getDbMode()) { case EXTERNAL: initExternalDb(); break; case EMBEDDED: initEmbeddedDb(); break; case INTERNAL: initInternalDb(); break; default: break; } }
private void initPersistence() { _db = new Database(_config); _db.setTransactionManager(_txMgr); _db.setWorkRoot(_workRoot); try { _db.start(); _daoCF = _db.createDaoCF(); } catch (Exception ex) { String errmsg = "Error while configuring ODE persistence."; __log.error(errmsg, ex); throw new ODEInitializationException(errmsg, ex); } }
public BpelDAOConnectionFactoryJDBC createDaoCF() throws DatabaseConfigException { String pClassName = _odeConfig.getDAOConnectionFactory(); __log.info(__msgs.msgOdeUsingDAOImpl(pClassName)); BpelDAOConnectionFactoryJDBC cf; try { cf = (BpelDAOConnectionFactoryJDBC) Class.forName(pClassName).newInstance(); } catch (Exception ex) { String errmsg = __msgs.msgDAOInstantiationFailed(pClassName); __log.error(errmsg, ex); throw new DatabaseConfigException(errmsg, ex); } cf.setDataSource(getDataSource()); cf.setTransactionManager(_txm); cf.init(_odeConfig.getProperties()); return cf; }
private void registerExternalVariableModules() { JdbcExternalVariableModule jdbcext; jdbcext = new JdbcExternalVariableModule(); jdbcext.registerDataSource("ode", _db.getDataSource()); _ode._server.registerExternalVariableEngine(jdbcext); }
private void initExternalDb() throws DatabaseConfigException { try { _datasource = (DataSource) lookupInJndi(_odeConfig.getDbDataSource()); __log.info(__msgs.msgOdeUsingExternalDb(_odeConfig.getDbDataSource())); } catch (Exception ex) { String msg = __msgs.msgOdeInitExternalDbFailed(_odeConfig.getDbDataSource()); __log.error(msg, ex); throw new DatabaseConfigException(msg, ex); } }
/** * Initialize ODE DAO connection factory. * * @throws BPELEngineException if DAO connection factory creation fails */ private void initDAO() throws BPELEngineException { log.info("Using DAO Connection Factory class: " + odeConfigurationProperties.getDAOConnectionFactory()); try { daoConnectionFactory = db.createDaoCF(); } catch (Exception e) { String errMsg = "Error instantiating DAO Connection Factory class " + odeConfigurationProperties.getDAOConnectionFactory(); log.error(errMsg, e); throw new BPELEngineException(errMsg, e); } }
private void initInternalDb() throws DatabaseConfigException { __log.info(__msgs.msgOdeUsingInternalDb(_odeConfig.getDbIntenralJdbcUrl(), _odeConfig.getDbInternalJdbcDriverClass())); initInternalDb(_odeConfig.getDbIntenralJdbcUrl(), _odeConfig.getDbInternalJdbcDriverClass(), _odeConfig.getDbInternalUserName(), _odeConfig.getDbInternalPassword()); }
/** * Initialize embedded (H2) database. */ private void initEmbeddedDb() throws DatabaseConfigException { String db = _odeConfig.getDbEmbeddedName(); h2Url = "jdbc:h2:file:" + _workRoot + File.separator + db; String url = h2Url + ";MVCC=TRUE"; __log.info("Using Embedded H2: " + url); initInternalDb(url, org.h2.Driver.class.getName(), "sa", null); _needH2Shutdown = false; }
/** * Initialize process store/ * * @param eprContext Endpoint reference context * @throws Exception if process store initialization failed */ private void initProcessStore(EndpointReferenceContext eprContext) throws Exception { processStore = new ProcessStoreImpl(eprContext, db.getDataSource(), odeConfigurationProperties); processStore.setLocalBPELDeploymentUnitRepo(new File(CarbonUtils.getCarbonHome() + File.separator + "repository" + File.separator + "bpel")); processStore.registerListener(new ProcessStoreListenerImpl()); }
/** * Initialize the data store. * * @throws JBIException */ private void initDao() throws JBIException { BpelDAOConnectionFactoryJDBC cf; try { cf = _db.createDaoCF(); } catch (DatabaseConfigException e) { String errmsg = __msgs.msgDAOInstantiationFailed(_ode._config.getDAOConnectionFactory()); throw new JBIException(errmsg,e); } _ode._daocf = cf; }
public String msgOdeInitDAOErrorReadingProperties(File propfile) { return format("Error reading DAO properties file \"{0}\".", propfile); }
private Scheduler createScheduler() { SimpleScheduler simpleScheduler = new SimpleScheduler(bpelServerConfiguration.getNodeId(), new JdbcDelegate(db.getDataSource()), odeConfigurationProperties.getProperties()); simpleScheduler.setExecutorService(executorService); simpleScheduler.setTransactionManager(transactionManager); return simpleScheduler; }
public String msgOdeUsingDAOImpl(String className) { return format("Using DAO Connection Factory class {0}.", className); }
public String msgDAOInstantiationFailed(String className) { return format("Error instantiating DAO Connection Factory class {0}.", className); }
public String msgOdeInitHibernatePropertiesNotFound(File expected) { return format("Hibernate configuration file \"{0}\" not found, defaults will be used.", expected); }
public String msgOdeUsingExternalDb(String dbDataSource) { return format("ODE using external DataSource \"{0}\".", dbDataSource); }
public String msgOdeInitExternalDbFailed(String dbDataSource) { return format("Failed to resolved external DataSource at \"{0}\".", dbDataSource); }
public String msgOdeDbPoolStartupFailed(String url) { return format("Error starting connection pool for \"{0}\".", url); }