public void shutdown() { Orient.instance().shutdown(); }
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 public void onBeforeDestroyed(Application application) { Orient.instance().shutdown(); } });
@Override protected void doStop() throws Exception { Orient.instance().shutdown(); }
@Override protected void doStop() throws Exception { // instance shutdown orientServer.shutdown(); orientServer = null; // global shutdown Orient.instance().shutdown(); log.info("Shutdown"); }
/** * 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(); }
/** * All operations running at cache destruction stage */ public void shutdown() { underlying.shutdown(); if (Orient.instance().getProfiler() != null) { Orient.instance().getProfiler().unregisterHookValue(profilerPrefix + "enabled"); Orient.instance().getProfiler().unregisterHookValue(profilerPrefix + "current"); Orient.instance().getProfiler().unregisterHookValue(profilerPrefix + "max"); } } }
/** * Report the tip to the profiler and collect it in context to be reported by tools like Studio */ protected void reportTip(final String iMessage) { Orient.instance().getProfiler().reportTip(iMessage); List<String> tips = (List<String>) context.getVariable("tips"); if (tips == null) { tips = new ArrayList<String>(3); context.setVariable("tips", tips); } tips.add(iMessage); }
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 public void close() { if (context.isOpen()) { context.close(); } Orient.instance().shutdown(); }
/** * All operations running at cache initialization stage */ public void startup() { underlying.startup(); Orient.instance().getProfiler() .registerHookValue(profilerPrefix + "current", "Number of entries in cache", METRIC_TYPE.SIZE, new OProfilerHookValue() { public Object getValue() { return getSize(); } }, profilerMetadataPrefix + "current"); }
/** * Shutdown Orient engine. */ @Override public void run() { try { Orient.instance().shutdown(); } finally { OLogManager.instance().shutdown(); } }
public void change(final Object iCurrentValue, final Object iNewValue) { Orient instance = Orient.instance(); if (instance != null) { final OProfiler prof = instance.getProfiler(); if (prof != null) if ((Boolean) iNewValue) prof.startRecording(); else prof.stopRecording(); } } }),
@Override public <DB extends ODatabase<?>> DB setConflictStrategy(String iStrategyName) { if (internal != null) { internal.setConflictStrategy(iStrategyName); } else { conflictStrategy = Orient.instance().getRecordConflictStrategy().getStrategy(iStrategyName); } return (DB) this; }
public OPartitionedObjectPoolFactory(final ObjectFactoryFactory<K, T> objectFactoryFactory, final int capacity) { this.objectFactoryFactory = objectFactoryFactory; poolStore = new ConcurrentLinkedHashMap.Builder<K, OPartitionedObjectPool<T>>().maximumWeightedCapacity(capacity) .listener(evictionListener).build(); Orient.instance().registerWeakOrientStartupListener(this); Orient.instance().registerWeakOrientShutdownListener(this); }
public void callOnCloseListeners() { // WAKE UP DB LIFECYCLE LISTENER for (Iterator<ODatabaseLifecycleListener> it = Orient.instance().getDbLifecycleListeners(); it.hasNext(); ) it.next().onClose(getDatabaseOwner()); // WAKE UP LISTENERS for (ODatabaseListener listener : getListenersCopy()) try { listener.onClose(getDatabaseOwner()); } catch (Exception e) { OLogManager.instance().error(this, "Error during call of database listener", e); } }
public ODatabaseDocumentAbstract setConflictStrategy(final String iStrategyName) { checkIfActive(); getStorage().setConflictStrategy(Orient.instance().getRecordConflictStrategy().getStrategy(iStrategyName)); return this; }
public OrientBaseGraph setConflictStrategy(final String iStrategyName) { makeActive(); getDatabase().setConflictStrategy(Orient.instance().getRecordConflictStrategy().getStrategy(iStrategyName)); return this; }
@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(); } } } }