@Override public void config(final OServer server, OServerParameterConfiguration[] iParams) { graphPoolMax = server.getContextConfiguration().getValueAsInteger(OGlobalConfiguration.DB_POOL_MAX); for (OServerParameterConfiguration param : iParams) { if (param.name.equalsIgnoreCase("enabled")) { if (!Boolean.parseBoolean(param.value)) // DISABLE IT return; } else if (param.name.equalsIgnoreCase("graph.pool.max")) graphPoolMax = Integer.parseInt(param.value); } if (OGremlinHelper.isGremlinAvailable()) { enabled = true; OLogManager.instance() .info(this, "Installed GREMLIN language v.%s - graph.pool.max=%d", OGremlinHelper.getEngineVersion(), graphPoolMax); Orient.instance().getScriptManager().registerInjection(this); } else enabled = false; this.server = server; }
String script = pageDocumentModel.getObject().field(PagesModule.OPROPERTY_SCRIPT); if(!Strings.isEmpty(script)) { OScriptManager scriptManager = Orient.instance().getScriptManager(); ODatabaseDocument db = OrienteerWebSession.get().getDatabase(); final OPartitionedObjectPool.PoolEntry<ScriptEngine> entry =
final OScriptManager scriptManager = Orient.instance().getScriptManager();
return ORecordHook.RESULT.RECORD_NOT_CHANGED; final OScriptManager scriptManager = Orient.instance().getScriptManager();
@Override public OResultSet execute(ODatabaseDocumentInternal database, String script, Map params) { final OScriptManager scriptManager = Orient.instance().getScriptManager(); CompiledScript compiledScript = null;
protected Object executeJsr223Script(final String language, final OCommandContext iContext, final Map<Object, Object> iArgs) { ODatabaseDocumentInternal db = ODatabaseRecordThreadLocal.instance().get(); final OScriptManager scriptManager = Orient.instance().getScriptManager(); CompiledScript compiledScript = request.getCompiledScript();
public void afterUpdateOperations(final OIdentifiable id) { if (id instanceof ODocument) { ODocument doc = (ODocument) id; OImmutableClass clazz = ODocumentInternal.getImmutableSchemaClass(this, doc); if (clazz != null) { OClassIndexManager.checkIndexesAfterUpdate((ODocument) id, this); if (clazz.isFunction()) { this.getSharedContext().getFunctionLibrary().updatedFunction(doc); Orient.instance().getScriptManager().close(this.getName()); } if (clazz.isOuser() || clazz.isOrole()) { getMetadata().getSecurity().incrementVersion(); } if (clazz.isSequence()) { ((OSequenceLibraryProxy) getMetadata().getSequenceLibrary()).getDelegate().onSequenceUpdated(this, doc); } if (clazz.isTriggered()) { OClassTrigger.onRecordAfterUpdate(doc, this); } } OLiveQueryHook.addOp(doc, ORecordOperation.UPDATED, this); OLiveQueryHookV2.addOp(doc, ORecordOperation.UPDATED, this); } callbackHooks(ORecordHook.TYPE.AFTER_UPDATE, id); }
public void afterCreateOperations(final OIdentifiable id) { if (id instanceof ODocument) { ODocument doc = (ODocument) id; OImmutableClass clazz = ODocumentInternal.getImmutableSchemaClass(this, doc); if (clazz != null) { OClassIndexManager.checkIndexesAfterCreate(doc, this); if (clazz.isFunction()) { this.getSharedContext().getFunctionLibrary().createdFunction(doc); Orient.instance().getScriptManager().close(this.getName()); } if (clazz.isOuser() || clazz.isOrole()) { getMetadata().getSecurity().incrementVersion(); } if (clazz.isSequence()) { ((OSequenceLibraryProxy) getMetadata().getSequenceLibrary()).getDelegate().onSequenceCreated(this, doc); } if (clazz.isScheduler()) { getMetadata().getScheduler().scheduleEvent(new OScheduledEvent(doc)); } if (clazz.isTriggered()) { OClassTrigger.onRecordAfterCreate(doc, this); } } OLiveQueryHook.addOp(doc, ORecordOperation.CREATED, this); OLiveQueryHookV2.addOp(doc, ORecordOperation.CREATED, this); } callbackHooks(ORecordHook.TYPE.AFTER_CREATE, id); }
public void afterDeleteOperations(final OIdentifiable id) { if (id instanceof ODocument) { ODocument doc = (ODocument) id; OImmutableClass clazz = ODocumentInternal.getImmutableSchemaClass(this, doc); if (clazz != null) { OClassIndexManager.checkIndexesAfterDelete(doc, this); if (clazz.isFunction()) { this.getSharedContext().getFunctionLibrary().droppedFunction(doc); Orient.instance().getScriptManager().close(this.getName()); } if (clazz.isOuser() || clazz.isOrole()) { getMetadata().getSecurity().incrementVersion(); } if (clazz.isSequence()) { ((OSequenceLibraryProxy) getMetadata().getSequenceLibrary()).getDelegate().onSequenceDropped(this, doc); } if (clazz.isScheduler()) { final String eventName = doc.field(OScheduledEvent.PROP_NAME); getSharedContext().getScheduler().removeEventInternal(eventName); } if (clazz.isTriggered()) { OClassTrigger.onRecordAfterDelete(doc, this); } } OLiveQueryHook.addOp(doc, ORecordOperation.DELETED, this); OLiveQueryHookV2.addOp(doc, ORecordOperation.DELETED, this); } callbackHooks(ORecordHook.TYPE.AFTER_DELETE, id); }