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); }
/** * Adds shutdown handlers in order which will be used during execution of shutdown. */ private void initShutdownQueue() { addShutdownHandler(new OShutdownWorkersHandler()); addShutdownHandler(new OShutdownOrientDBInstancesHandler()); addShutdownHandler(new OShutdownPendingThreadsHandler()); addShutdownHandler(new OShutdownProfilerHandler()); addShutdownHandler(new OShutdownCallListenersHandler()); }
@Override protected void doStart() throws Exception { Orient.instance().startup(); Orient.instance().removeShutdownHook(); }
@Override public void setDatabaseThreadLocalFactory( ODatabaseThreadLocalFactory factory) { Orient.instance().registerThreadDatabaseFactory(factory); }
public OLuceneIndexFactory(boolean manual) { if (!manual) { Orient.instance().addDbLifecycleListener(this); } }
public OReentrantResourcePool(final int maxResources, final OResourcePoolListener<K, V> listener) { super(maxResources, listener); Orient.instance().registerWeakOrientShutdownListener(this); Orient.instance().registerWeakOrientStartupListener(this); }
@Override public ODatabaseThreadLocalFactory getDatabaseThreadLocalFactory() { return Orient.instance().getDatabaseThreadFactory(); }
public OAbstractProfiler(boolean registerListener) { if (registerListener) { Orient.instance().registerWeakOrientStartupListener(this); } }
public void removeSignalHandler() { if (signalHandler != null) { signalHandler.cancel(); signalHandler = null; } }
public static Orient instance() { if (instance != null) return instance; return startUp(false); }
public void removeShutdownHook() { if (shutdownHook != null) { shutdownHook.cancel(); shutdownHook = null; } }
public int getDriverMajorVersion() { return OConstants.getVersionMajor(); }
@Override protected void doStart() throws Exception { Orient.instance().startup(); Orient.instance().removeShutdownHook(); }
@Override public void setDatabaseThreadLocalFactory( ODatabaseThreadLocalFactory factory) { Orient.instance().registerThreadDatabaseFactory(factory); }
@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