ByteArrayOutputStream out = new ByteArrayOutputStream();
MarshallerFactory.newMarshaller( kbase ).marshall( out,
ksession );
KnowledgeSessionConfiguration ksconf = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
((SessionConfiguration) ksconf).setTimerJobFactoryManager( new TrackableTimeJobFactoryManager() );
ksconf.setOption( ClockTypeOption.get( "pseudo" ) );
Environment env = EnvironmentFactory.newEnvironment();
env.set( EnvironmentName.GLOBALS, globals );
ksession = MarshallerFactory.newMarshaller( kbase ).unmarshall( new ByteArrayInputStream( out.toByteArray() ), ksconf, env );