public ContextManagerImpl() { this.contexts = new HashMap<String, Context>(); this.root = new ContextImpl( ROOT, this ); this.contexts.put( ROOT, this.root ); }
@Override public Object get(String identifier){ Object result = super.get(identifier); if(evictionEnabled && identifier != null && result != null){ long currentTimeStamp = System.currentTimeMillis(); evictionMap.put(identifier, currentTimeStamp); log.log(Level.FINE,"Updating key=" +identifier +"@"+super.getName()+":"+currentTimeStamp); } return result; }
ContextImpl localSessionContext = new ContextImpl( "session_" + msg.getSessionId(), this.data.getContextManager(), this.data.getTemp() ); ExecutionResultImpl localKresults = new ExecutionResultImpl(); localSessionContext.set( "kresults_" + msg.getSessionId(), localKresults );
public void set(String identifier, Object value, boolean shadow) { if ( !shadow ) { actualCtx.set( identifier, value ); } else { super.set( identifier,value ); } }
public ContextImpl(String name, World manager, Context delegate) { this.name = name; this.manager = manager; setParent( delegate ); }
public ShadowWorld getContextManager() { return (ShadowWorld) super.getContextManager(); }
public Context createContext(String identifier) { Context ctx = this.contexts.get( identifier ); if ( ctx == null ) { ctx = new ContextImpl( identifier, this, root ); this.contexts.put( identifier, ctx ); } return ctx; }
public WorldImpl() { this.root = new ContextImpl( ROOT, this ); this.root.set( "world", this ); this.contexts = new HashMap<String, Context>(); this.contexts.put( ROOT, this.root ); }
public NodeData() { // Setup ROOT context, this will hold all long lived intances and instanceIds this.contextManager = new ContextManagerImpl(); this.root = new ContextImpl( ROOT, this.contextManager ); ((ContextManagerImpl) this.contextManager).addContext( this.root ); this.root.set( NODE_DATA, this ); // Setup TEMP context, this will hold all short lived instanceId and instances // TODO: TEMP context should have a time/utilisation eviction queue added this.temp = new ContextImpl( TEMP, this.contextManager, this.root ); ((ContextManagerImpl) this.contextManager).addContext( this.temp ); }
public NodeData() { // Setup ROOT context, this will hold all long lived intances and instanceIds this.contextManager = new ContextManagerImpl(); this.root = new ContextImpl( ROOT, this.contextManager ); ((ContextManagerImpl) this.contextManager).addContext( this.root ); this.root.set( NODE_DATA, this ); // Setup TEMP context, this will hold all short lived instanceId and instances // TODO: TEMP context should have a time/utilisation eviction queue added this.temp = new ContextImplWithEviction( TEMP, this.contextManager, this.root); ((ContextManagerImpl) this.contextManager).addContext( this.temp ); }
public <T> T execute(Command<T> command) { StatefulKnowledgeSession ksession = newWorkingMemory(); FixedKnowledgeCommandContext context = new FixedKnowledgeCommandContext( new ContextImpl( "ksession", null ), null,