public ContextManagerImpl() { this.contexts = new HashMap<String, Context>(); this.root = new ContextImpl( ROOT, this ); this.contexts.put( ROOT, this.root ); }
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,
ContextImpl localSessionContext = new ContextImpl( "session_" + msg.getSessionId(), this.data.getContextManager(), this.data.getTemp() );