private static ReteooStatefulSession createAndInitializeSession(MarshallerReaderContext context,
int id,
ExecutorService executor,
Environment environment,
SessionConfiguration config,
ProtobufMessages.KnowledgeSession _session) throws IOException {
FactHandleFactory handleFactory = context.ruleBase.newFactHandleFactory( _session.getRuleData().getLastId(),
_session.getRuleData().getLastRecency() );
DefaultAgenda agenda = context.ruleBase.getConfiguration().getComponentFactory().getAgendaFactory().createAgenda( context.ruleBase, false );
readAgenda( context,
_session.getRuleData(),
agenda );
ReteooStatefulSession session = new ReteooStatefulSession( id,
context.ruleBase,
executor,
handleFactory,
false,
1,
config,
agenda,
environment );
new StatefulKnowledgeSessionImpl( session );
return session;
}