marshaller.marshall( baos,
ksession );
baos.close();
serializedRulebase = DroolsStreamUtils.streamOut( ruleBase );
session.dispose();
// Deserialize the rulebase and the session
ruleBase = (RuleBase) DroolsStreamUtils.streamIn( serializedRulebase );
marshaller = MarshallerFactory.newMarshaller( new KnowledgeBaseImpl( ruleBase ) );
ksession = (StatefulKnowledgeSessionImpl) marshaller.unmarshall( new ByteArrayInputStream( baos.toByteArray() ),
KnowledgeBaseFactory.newKnowledgeSessionConfiguration(),