Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-2614

TimerSessionBinding does not allow 3rd party TimerSession implementations

XMLWordPrintable

      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;
      }

              Unassigned Unassigned
              vchira_jira sdfsd sdfsd (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: