MarshallerReaderContext context ) throws IOException, ClassNotFoundException { boolean multithread = context.readBoolean(); long time = context.readLong(); int handleId = context.readInt(); long handleCounter = context.readLong(); long propagationCounter = context.readLong(); context.readInt(); context.readLong();
public static void readTimer( MarshallerReaderContext inCtx ) throws IOException, ClassNotFoundException { short timerType = inCtx.readShort(); TimersInputMarshaller reader = inCtx.readersByInt.get( timerType ); reader.read( inCtx ); }
public WorkingMemoryReteAssertAction(MarshallerReaderContext context) throws IOException { this.factHandle = context.handles.get( context.readInt() ); this.removeLogical = context.readBoolean(); this.updateEqualsMap = context.readBoolean(); if ( context.readBoolean() ) { String pkgName = context.readUTF(); String ruleName = context.readUTF(); Package pkg = context.ruleBase.getPackage( pkgName ); this.ruleOrigin = pkg.getRule( ruleName ); } if ( context.readBoolean() ) { this.leftTuple = context.terminalTupleMap.get( context.readInt() ); } }
public static void readSlidingTimeWindowBehaviour( WindowNode windowNode, WindowMemory memory, SlidingTimeWindow stw, SlidingTimeWindowContext stwCtx, MarshallerReaderContext inCtx ) throws IOException { if (inCtx.readBoolean()) { int sinkId = inCtx.readInt(); int factId = inCtx.readInt(); RightTupleSink sink = (RightTupleSink) inCtx.sinks.get( sinkId ); RightTupleKey key = new RightTupleKey( factId, sink ); RightTuple rightTuple = inCtx.rightTuples.get( key ); //FIXME: stwCtx.expiringTuple = rightTuple; } if (inCtx.readBoolean()) { int size = inCtx.readInt(); for (int i = 0; i < size; i++) { int sinkId = inCtx.readInt(); int factId = inCtx.readInt(); RightTupleSink sink = (RightTupleSink) inCtx.sinks.get( sinkId ); RightTupleKey key = new RightTupleKey( factId, sink ); RightTuple rightTuple = inCtx.rightTuples.get( key ); //FIXME: stwCtx.queue.add( rightTuple ); } } }
public static Trigger readTrigger( MarshallerReaderContext inCtx ) throws IOException, ClassNotFoundException { short triggerInt = inCtx.readShort(); long startTime = inCtx.readLong(); if (inCtx.readBoolean()) { long endTime = inCtx.readLong(); trigger.setEndTime( new Date( endTime ) ); int repeatLimit = inCtx.readInt(); trigger.setRepeatLimit( repeatLimit ); int repeatCount = inCtx.readInt(); trigger.setRepeatCount( repeatCount ); String expr = inCtx.readUTF(); trigger.setCronExpression( expr ); if (inCtx.readBoolean()) { long nextFireTime = inCtx.readLong(); trigger.setNextFireTime( new Date( nextFireTime ) ); String[] calendarNames = (String[]) inCtx.readObject(); trigger.setCalendarNames( calendarNames ); return trigger; long startTime = inCtx.readLong(); trigger.setStartTime( new Date( startTime ) ); if (inCtx.readBoolean()) { long endTime = inCtx.readLong(); trigger.setEndTime( new Date( endTime ) );
public void unmarshall(final InputStream stream, final StatefulKnowledgeSession ksession) throws IOException, ClassNotFoundException { MarshallerReaderContext context = new MarshallerReaderContext( stream, (InternalRuleBase) ((KnowledgeBaseImpl) kbase).ruleBase, RuleBaseNodes.getNodeMap( (InternalRuleBase) ((KnowledgeBaseImpl) kbase).ruleBase ), this.strategyStore, this.timerReaders, this.marshallingConfig.isMarshallProcessInstances(), marshallingConfig.isMarshallWorkItems(), ksession.getEnvironment() ); InputMarshaller.readSession( (ReteooStatefulSession) ((StatefulKnowledgeSessionImpl) ksession).session, context ); context.close(); }
public static InternalFactHandle readFactHandle( MarshallerReaderContext context ) throws IOException, ClassNotFoundException { int type = context.stream.readInt(); int id = context.stream.readInt(); long recency = context.stream.readLong(); long activationsCount = 0; if (type == 2) { startTimeStamp = context.stream.readLong(); duration = context.stream.readLong(); expired = context.stream.readBoolean(); activationsCount = context.stream.readLong(); int strategyIndex = context.stream.readInt(); Object object = null; ObjectMarshallingStrategy strategy = null; String strategyClassName = context.stream.readUTF(); if (!StringUtils.isEmpty( strategyClassName )) { strategy = context.resolverStrategyFactory.getStrategyObject( strategyClassName ); if (context.readBoolean()) { String entryPointId = context.readUTF(); if (entryPointId != null && !entryPointId.equals( "" )) { entryPoint = context.wm.getEntryPoints().get( entryPointId );
if (context.stream.readBoolean()) { InternalFactHandle initialFactHandle = context.wm.getInitialFactHandle(); int sinkId = context.stream.readInt(); ObjectTypeNode initialFactNode = (ObjectTypeNode) context.sinks.get( sinkId ); if (initialFactNode == null) { while ( context.readShort() == PersisterEnums.ENTRY_POINT) { String entryPointId = context.stream.readUTF(); WorkingMemoryEntryPoint wmep = context.wm.getEntryPoints().get( entryPointId ); readFactHandles( context, while (context.stream.readShort() == PersisterEnums.LEFT_TUPLE) { LeftTupleSink sink = (LeftTupleSink) context.sinks.get( context.stream.readInt() ); LeftTuple leftTuple = sink.createLeftTuple( handle, sink, short type = context.stream.readShort(); if (PersisterEnums.END != type) { throw new IllegalStateException( "No process marshaller, unable to unmarshall type: " + type ); short type = context.stream.readShort(); if (PersisterEnums.END != type) { throw new IllegalStateException( "No process marshaller, unable to unmarshall type: " + type ); short type = context.stream.readShort(); if (PersisterEnums.END != type) { throw new IllegalStateException( "No process marshaller, unable to unmarshall type: " + type ); while ( context.readShort() == PersisterEnums.DEFAULT_TIMER) {
public void read(MarshallerReaderContext inCtx) throws IOException, ClassNotFoundException { InternalFactHandle factHandle = inCtx.handles.get( inCtx.readInt() ); String entryPointId = inCtx.readUTF(); EntryPointNode epn = ((ReteooRuleBase) inCtx.wm.getRuleBase()).getRete().getEntryPointNode( new EntryPoint( entryPointId ) ); String className = inCtx.readUTF(); Class< ? > cls = ((ReteooRuleBase) inCtx.wm.getRuleBase()).getRootClassLoader().loadClass( className ); ObjectTypeNode otn = epn.getObjectTypeNodes().get( new ClassObjectType( cls ) ); long nextTimeStamp = inCtx.readLong(); TimerService clock = inCtx.wm.getTimerService(); JobContext jobctx = new ExpireJobContext( new WorkingMemoryReteExpireAction( factHandle, otn ), inCtx.wm ); JobHandle handle = clock.scheduleJob( job, jobctx, new PointInTimeTrigger( nextTimeStamp, null, null ) ); jobctx.setJobHandle( handle ); }
public PropagateAction(MarshallerReaderContext context) throws IOException { this.node = (PropagationQueuingNode) context.sinks.get( context.readInt() ); }
public LogicalRetractCallback(MarshallerReaderContext context) throws IOException { this.tms = context.wm.getTruthMaintenanceSystem(); this.handle = context.handles.get( context.readInt() ); this.context = context.propagationContexts.get( context.readLong() ); this.activation = (Activation) context.terminalTupleMap.get( context.readInt() ).getObject(); this.beliefSet = (BeliefSet) this.tms.getJustifiedMap().get( handle.getId() ); for ( LinkedListEntry entry = (LinkedListEntry) beliefSet.getFirst(); entry != null; entry = (LinkedListEntry) entry.getNext() ) { final LogicalDependency node = (LogicalDependency) entry.getObject(); if ( node.getJustifier() == this.activation ) { this.node = node; break; } } }
public static void readBehaviors( WindowNode windowNode, WindowMemory memory, MarshallerReaderContext inCtx ) throws IOException { short token = -1; while (( token = inCtx.readShort() ) != PersisterEnums.END) { int i = inCtx.readInt(); Object object = ( (Object[]) memory.behaviorContext )[i]; switch (token) { case PersisterEnums.SLIDING_TIME_WIN: { readSlidingTimeWindowBehaviour( windowNode, memory, (SlidingTimeWindow) windowNode.getBehaviors()[i], (SlidingTimeWindowContext) object, inCtx ); break; } case PersisterEnums.SLIDING_LENGTH_WIN: { readSlidingLengthWindowBehaviour( windowNode, memory, (SlidingLengthWindow) windowNode.getBehaviors()[i], (SlidingLengthWindowContext) object, inCtx ); break; } } } }
context = new MarshallerReaderContext(stream, null, null, objectMarshallingStrategyStore, null, env); if (classloader != null) { context.classLoader = classloader;
public DeactivateCallback(MarshallerReaderContext context) throws IOException { this.ruleFlowGroup = (InternalRuleFlowGroup) context.wm.getAgenda().getRuleFlowGroup( context.readUTF() ); }
boolean isOpen = context.readBoolean(); boolean unificationNode = context.readBoolean(); if (unificationNode) {
public void unmarshall(final InputStream stream, final StatefulKnowledgeSession ksession) throws IOException, ClassNotFoundException { MarshallerReaderContext context = new MarshallerReaderContext( stream, (InternalRuleBase) ((KnowledgeBaseImpl) kbase).ruleBase, RuleBaseNodes.getNodeMap( (InternalRuleBase) ((KnowledgeBaseImpl) kbase).ruleBase ), this.strategyStore, TIMER_READERS, this.marshallingConfig.isMarshallProcessInstances(), marshallingConfig.isMarshallWorkItems(), ksession.getEnvironment() ); ProtobufInputMarshaller.readSession( (ReteooStatefulSession) ((StatefulKnowledgeSessionImpl) ksession).session, context ); context.close(); }
MarshallerReaderContext context = new MarshallerReaderContext( stream, (InternalRuleBase) ((KnowledgeBaseImpl) kbase).ruleBase, RuleBaseNodes.getNodeMap( (InternalRuleBase) ((KnowledgeBaseImpl) kbase).ruleBase ), (SessionConfiguration) config ); executor.setCommandExecutor( new CommandExecutor( session ) ); context.close(); if ( ((SessionConfiguration) config).isKeepReference() ) { ((ReteooRuleBase) ((KnowledgeBaseImpl) this.kbase).ruleBase).addStatefulSession( session );
ClassNotFoundException { boolean multithread = context.readBoolean(); long time = context.readLong(); FactHandleFactory handleFactory = context.ruleBase.newFactHandleFactory( context.readInt(), context.readLong() ); long propagationCounter = context.readLong(); InternalFactHandle initialFactHandle = new DefaultFactHandle( context.readInt(), //id InitialFactImpl.getInstance(), context.readLong(), null, false );
public void read(MarshallerReaderContext inCtx) throws IOException, ClassNotFoundException { int sinkId = inCtx.readInt(); WindowNode windowNode = (WindowNode) inCtx.sinks.get( sinkId ); WindowMemory memory = (WindowMemory) inCtx.wm.getNodeMemory( windowNode ); Object[] behaviorContext = ( Object[] ) memory.behaviorContext; int i = inCtx.readInt(); // SlidingTimeWindowContext stwCtx = ( SlidingTimeWindowContext ) behaviorContext[i]; // // updateNextExpiration( stwCtx.queue.peek(), // inCtx.wm, // memory, // (SlidingTimeWindow) windowNode.getBehaviors()[i], // stwCtx ); }