use of com.orientechnologies.orient.server.OServer in project wicket-orientdb by OrienteerBAP.
the class TestStandaloneOrientDBCompatibility method testOrientDbLifeCycle.
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);
}
use of com.orientechnologies.orient.server.OServer in project wicket-orientdb by OrienteerBAP.
the class EmbeddOrientDbApplicationListener method onBeforeDestroyed.
@Override
public void onBeforeDestroyed(Application application) {
OrientDbWebApplication app = (OrientDbWebApplication) application;
OServer server = app.getServer();
if (server != null)
server.shutdown();
}
use of com.orientechnologies.orient.server.OServer in project wicket-orientdb by OrienteerBAP.
the class EmbeddOrientDbApplicationListener method onAfterInitialized.
@Override
public void onAfterInitialized(Application application) {
try {
OrientDbWebApplication app = (OrientDbWebApplication) application;
OServer server = OServerMain.create(false);
if (url != null) {
server.startup(url.openStream());
} else if (configFile != null) {
server.startup(configFile);
} else if (config != null) {
server.startup(config);
} else if (serverConfiguration != null) {
server.startup(serverConfiguration);
} else {
server.startup();
}
server.activate();
server.removeShutdownHook();
app.setServer(server);
app.getOrientDbSettings().setDatabasePoolFactory(server.getDatabasePoolFactory());
onAfterServerStartupAndActivation(app);
} catch (Exception e) {
throw new WicketRuntimeException("Can't start OrientDB Embedded Server", e);
}
}
use of com.orientechnologies.orient.server.OServer in project serverless by bluenimble.
the class PlaygroundPlugin method main.
public static void main(String[] args) throws Exception {
OServer oServer = OServerMain.create();
oServer.startup(new File("/repos/bluenimble/serverless/plugins/bluenimble-plugin-dev.playground/src/main/resources/orientdb-server-config.xml"));
oServer.activate();
}
use of com.orientechnologies.orient.server.OServer in project orientdb by orientechnologies.
the class BareBonesServer method start.
public void start(String configFileDir, String configFileName) {
OLogManager.instance().info(this, "starting the database based on: " + configFileName);
try {
server = new OServer(false);
server.startup(new File(configFileDir, configFileName));
server.activate();
if (server.getPluginByClass(OHazelcastPlugin.class) != null)
server.getPluginByClass(OHazelcastPlugin.class).waitUntilNodeOnline();
} catch (Exception e) {
OLogManager.instance().error(this, "start", e);
}
}
Aggregations