-
Feature Request
-
Resolution: Won't Do
-
Major
-
None
-
jBPM 4.x
We want to use our own scheduler for Timers but even if the infrastracture is in place one can not configure it's own implementation of TimerSession.
The <timer-session/> element allows only target ='ejb' and nothing else will be parsed by the method TimerSessionBinding.parse(). I can't understand why can't I provide my own implementation of TimerSession.
the Solution would be to change add and attribute className to <timer-session/> element and to change the TimerSessionBinding.parse() method like this :
objectDescriptor.setClassName(XmlUtil.attribute(element, "class"));
you can also add a target like 'custom' and only then check the 'class' attribute. Something like this:
public Object parse(Element element, Parse parse, Parser parser) {
ObjectDescriptor objectDescriptor = new ObjectDescriptor();
String target = XmlUtil.attribute(element, "target");
if ((target!=null){
if ("ejb".equalsIgnoreCase(target)))
else if ("custom".equalsIgnoreCase(target)))
{ objectDescriptor.setClassName(XmlUtil.attribute(element, "class")); }} else
{ // wire the JobExecutorTimerSession objectDescriptor.setClassName(JobExecutorTimerSession.class.getName()); // inject fields objectDescriptor.addInjection("transaction", new TransactionRefDescriptor()); objectDescriptor.addInjection("jobExecutor", new EnvDescriptor(JobExecutor.class)); objectDescriptor.addInjection("session", new ContextTypeRefDescriptor(Session.class)); } return objectDescriptor;
}