]
Huisheng Xu commented on JBPM-2614:
-----------------------------------
We needn't extend TimerSessionBinding, could use <object
class="your.customTimerSession"/> to do that.
TimerSessionBinding does not allow 3rd party TimerSession
implementations
-------------------------------------------------------------------------
Key: JBPM-2614
URL:
https://jira.jboss.org/jira/browse/JBPM-2614
Project: jBPM
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 4.x
Reporter: Valentin Chira
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))) {
objectDescriptor.setClassName("org.jbpm.enterprise.internal.ejb.EnterpriseTimerSession");
}
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;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: