use of org.drools.core.time.impl.CommandServiceTimerJobFactoryManager 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);
}
}
use of org.drools.core.time.impl.CommandServiceTimerJobFactoryManager in project drools by kiegroup.
the class JpaTimerJobInstance method call.
public Void call() throws Exception {
try {
JDKCallableJobCommand command = new JDKCallableJobCommand(this);
ExecutableRunner runner = ((CommandServiceTimerJobFactoryManager) ((TimerService) scheduler).getTimerJobFactoryManager()).getRunner();
runner.execute(command);
return null;
} catch (Exception e) {
logger.error("Unable to execute timer job!", e);
throw e;
}
}
Aggregations