public void shutdown() { Orient.instance().shutdown(); }
@Override public void shutdown() { Orient.instance().shutdown(); }
@Override public void onBeforeDestroyed(Application application) { Orient.instance().shutdown(); } });
@Override public void onBeforeDestroyed(Application application) { Orient.instance().shutdown(); } });
@Override protected void doStop() throws Exception { Orient.instance().shutdown(); } }
@Override protected void doStop() throws Exception { Orient.instance().shutdown(); }
public void shutdown() { Orient.instance().shutdown(); }
@Override protected void doStop() throws Exception { // instance shutdown orientServer.shutdown(); orientServer = null; // global shutdown Orient.instance().shutdown(); log.info("Shutdown"); }
@Override protected void doStop() throws Exception { // instance shutdown orientServer.shutdown(); orientServer = null; // global shutdown Orient.instance().shutdown(); log.info("Shutdown"); } }
/** * Shutdown Orient engine. */ @Override public void run() { try { Orient.instance().shutdown(); } finally { OLogManager.instance().shutdown(); } }
public static void main(final String[] args) throws Exception { String inputFile = args.length > 0 ? args[0] : null; String dbURL = args.length > 1 ? args[1] : null; new OInternalGraphImporter().runImport(inputFile, dbURL); Orient.instance().shutdown(); }
@Override public void close() { if (context.isOpen()) { context.close(); } Orient.instance().shutdown(); }
Orient.instance().shutdown();
public void handle(final Signal signal) { OLogManager.instance().warn(this, "Received signal: %s", signal); final String s = signal.toString().trim(); if (Orient.instance().isSelfManagedShutdown() && (s.equals("SIGKILL") || s.equals("SIGHUP") || s.equals("SIGINT") || s .equals("SIGTERM"))) { Orient.instance().shutdown(); System.exit(1); } else if (s.equals("SIGTRAP")) { System.out.println(); OGlobalConfiguration.dumpConfiguration(System.out); System.out.println(); Orient.instance().getProfiler().dump(System.out); System.out.println(); System.out.println(Orient.instance().getProfiler().threadDump()); } else { SignalHandler redefinedHandler = redefinedHandlers.get(signal); if (redefinedHandler != null) { redefinedHandler.handle(signal); } } for (OSignalListener l : listeners) l.onSignal(signal); }
e.printStackTrace(); } finally { orient.shutdown();
@Override public void contextDestroyed(ServletContextEvent sce) { if (OGlobalConfiguration.INIT_IN_SERVLET_CONTEXT_LISTENER.getValueAsBoolean()) { final Orient orient = Orient.instance(); if (orient != null) { OLogManager.instance().infoNoDb(this, "Shutting down of OrientDB engine because web application is going to be stopped"); orient.shutdown(); OLogManager.instance().shutdown(); } } } }
public static void main(final String[] args) { int result = 0; try { boolean tty = false; try { if (setTerminalToCBreak()) tty = true; Runtime.getRuntime().addShutdownHook(new Thread(() -> restoreTerminal())); } catch (Exception ignored) { } new OSignalHandler().installDefaultSignals(signal -> restoreTerminal()); final OConsoleDatabaseApp console = new OConsoleDatabaseApp(args); if (tty) console.setReader(new TTYConsoleReader(console.historyEnabled())); result = console.run(); } finally { restoreTerminal(); } Orient.instance().shutdown(); System.exit(result); }
@Test(expected=OStorageException.class) @Ignore public void testMemoryDBShouldDisapear() throws Exception { try { testOrientDbLifeCycle(MEMORY_DB_NAME, true, false); testOrientDbLifeCycle(MEMORY_DB_NAME, false, true); } finally { OServer server = OServerMain.server(); if(server!=null) server.shutdown(); Orient.instance().shutdown(); } }
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); }