Search in sources :

Example 1 with TimerJobFactoryManager

use of org.drools.core.time.impl.TimerJobFactoryManager in project drools by kiegroup.

the class PersistableRunner method initNewKnowledgeSession.

protected void initNewKnowledgeSession(KieBase kbase, KieSessionConfiguration conf) {
    this.sessionInfo = new SessionInfo();
    // create session but bypass command service
    this.ksession = kbase.newKieSession(conf, this.env);
    initKieSessionMBeans(this.ksession);
    this.marshallingHelper = new SessionMarshallingHelper(this.ksession, conf);
    MarshallingConfigurationImpl config = (MarshallingConfigurationImpl) this.marshallingHelper.getMarshaller().getMarshallingConfiguration();
    config.setMarshallProcessInstances(false);
    config.setMarshallWorkItems(false);
    this.sessionInfo.setJPASessionMashallingHelper(this.marshallingHelper);
    ((InternalKnowledgeRuntime) this.ksession).setEndOperationListener(new EndOperationListenerImpl(this.txm, this.sessionInfo));
    this.runner = new TransactionInterceptor();
    TimerJobFactoryManager timerJobFactoryManager = ((InternalKnowledgeRuntime) ksession).getTimerService().getTimerJobFactoryManager();
    if (timerJobFactoryManager instanceof CommandServiceTimerJobFactoryManager) {
        ((CommandServiceTimerJobFactoryManager) timerJobFactoryManager).setRunner(this);
    }
}
Also used : InternalKnowledgeRuntime(org.drools.core.common.InternalKnowledgeRuntime) MarshallingConfigurationImpl(org.drools.core.marshalling.impl.MarshallingConfigurationImpl) CommandServiceTimerJobFactoryManager(org.drools.core.time.impl.CommandServiceTimerJobFactoryManager) TimerJobFactoryManager(org.drools.core.time.impl.TimerJobFactoryManager) CommandServiceTimerJobFactoryManager(org.drools.core.time.impl.CommandServiceTimerJobFactoryManager) SessionInfo(org.drools.persistence.info.SessionInfo) SessionMarshallingHelper(org.drools.persistence.api.SessionMarshallingHelper)

Aggregations

InternalKnowledgeRuntime (org.drools.core.common.InternalKnowledgeRuntime)1 MarshallingConfigurationImpl (org.drools.core.marshalling.impl.MarshallingConfigurationImpl)1 CommandServiceTimerJobFactoryManager (org.drools.core.time.impl.CommandServiceTimerJobFactoryManager)1 TimerJobFactoryManager (org.drools.core.time.impl.TimerJobFactoryManager)1 SessionMarshallingHelper (org.drools.persistence.api.SessionMarshallingHelper)1 SessionInfo (org.drools.persistence.info.SessionInfo)1