private void startupIfEnginesAreMissing() { // Using a jdk which doesn't bundle a javascript engine // throws a NoClassDefFoundError while logging the warning // see https://github.com/orientechnologies/orientdb/issues/5855 OLogManager.instance().setWarnEnabled(false); // If an instance of Orient was previously shutdown all engines are removed. // We need to startup Orient again. if (Orient.instance().getEngines().isEmpty()) { Orient.instance().startup(); } OLogManager.instance().setWarnEnabled(true); }
public static Orient startUp(boolean insideWebContainer) { initLock.lock(); try { if (initInProgress) { return null; } initInProgress = true; if (instance != null) return instance; final Orient orient = new Orient(false); orient.startup(); instance = orient; } finally { initInProgress = false; initLock.unlock(); } return instance; }
/** * Start the orientdb related process. This will also setup the graph connection pool and handle clustering. */ @Override public void setupConnectionPool() throws Exception { Orient.instance().startup(); initGraphDB(); }
@Override protected void doStart() throws Exception { Orient.instance().startup(); Orient.instance().removeShutdownHook(); }
@Override protected void doStart() throws Exception { Orient.instance().startup(); Orient.instance().removeShutdownHook(); }
@Override public void onAfterInitialized(Application application) { Orient.instance().startup(); Orient.instance().removeShutdownHook(); } @Override
@Override public void onAfterInitialized(Application application) { Orient.instance().startup(); Orient.instance().removeShutdownHook(); } @Override
@Override protected void doStart() throws Exception { // global startup Orient.instance().startup(); // instance startup OServer server = new OServer(); server.setExtensionClassLoader(uberClassLoader); OServerConfiguration config = createConfiguration(); server.startup(config); // create default root user to avoid orientdb prompt on console server.addUser(OServerConfiguration.SRV_ROOT_ADMIN, null, "*"); // Log global configuration if (log.isDebugEnabled()) { StringWriter buff = new StringWriter(); // FIXME: Remove need for commons-io WriterOutputStream OGlobalConfiguration.dumpConfiguration(new PrintStream(new WriterOutputStream(buff), true)); log.debug("Global configuration:\n{}", buff); } server.activate(); log.info("Activated"); this.orientServer = server; }
private void startupIfEnginesAreMissing() { // Using a jdk which doesn't bundle a javascript engine // throws a NoClassDefFoundError while logging the warning // see https://github.com/orientechnologies/orientdb/issues/5855 OLogManager.instance().setWarnEnabled(false); // If an instance of Orient was previously shutdown all engines are removed. // We need to startup Orient again. if (Orient.instance().getEngines().isEmpty()) { Orient.instance().startup(); } OLogManager.instance().setWarnEnabled(true); }
@Override protected void doStart() throws Exception { // global startup Orient.instance().startup(); // instance startup OServer server = new OServer(); configureOrientMinimumLogLevel(); server.setExtensionClassLoader(uberClassLoader); OServerConfiguration config = createConfiguration(); server.startup(config); // remove Orient shutdown-hooks added during startup, we'll manage shutdown ourselves Orient.instance().removeShutdownHook(); server.removeShutdownHook(); // create default root user to avoid orientdb prompt on console server.addUser(OServerConfiguration.DEFAULT_ROOT_USER, null, "*"); // Log global configuration if (log.isDebugEnabled()) { // dumpConfiguration() only accepts ancient stream api String encoding = StandardCharsets.UTF_8.name(); ByteArrayOutputStream buff = new ByteArrayOutputStream(); OGlobalConfiguration.dumpConfiguration(new PrintStream(buff, true, encoding)); log.debug("Global configuration:\n{}", new String(buff.toByteArray(), encoding)); } Orient.instance().addDbLifecycleListener(entityHook); server.activate(); log.info("Activated"); this.orientServer = server; }
final Orient orient = Orient.instance(); try { orient.startup();
public void testOrientDbLifeCycle(String dbURL, boolean createDb, boolean dropDb) throws Exception { Orient.instance().startup(); assertNotNull(ODatabaseRecordThreadLocal.instance()); Orient.instance().removeShutdownHook(); OServer server = OServerMain.create(); server.startup(OrientDbTestWebApplication.class.getResource("db.config.xml").openStream()); server.activate(); if(createDb) { ODatabaseDocument dbToCreate = new ODatabaseDocumentTx(dbURL); if(!dbToCreate.exists()) dbToCreate.create(); dbToCreate.close(); } assertNotNull(ODatabaseRecordThreadLocal.instance()); ODatabaseDocument db = new OPartitionedDatabasePoolFactory().get(dbURL, "admin", "admin").acquire(); db.close(); assertNotNull(ODatabaseRecordThreadLocal.instance()); if(dropDb) { ODatabaseDocument dbToDrop = new ODatabaseDocumentTx(dbURL); dbToDrop.open("admin", "admin"); dbToDrop.drop(); } server.shutdown(); Orient.instance().shutdown(); // Thread.sleep(50); }