3 Replies Latest reply on Mar 31, 2008 6:34 AM by Bernd Ruecker

    ejb timer session

    Alejandro Guizar Master

      I'm working on an EJB based implementation of the timer session. The salient design features are:

      The implementation relies on the EJB 2.1 timer service instead of the job executor
      EJB timers are associated to an entity bean which uses the same table as the PVM timer class.
      EjbTimerSession inherits the scheduled activity query methods from StandardTimerSession.

      One open point is whether to execute the timer directly in the ejbTimeout method, or use the command facility. The latter adds extra overhead and the advantages are unclear to me, other than using commands as the uniform way to move the execution ahead. Is that a sound motivation to employ commands?

        • 1. Re: ejb timer session
          Bernd Ruecker Master

          Hi Alex!

          I would at least use the Commands in that Timer implementation. The CommandExecutor is not really necessary, since the Timer is already EJB aware and can create and manage the environment (the JbpmContext).

          But the code should go in the Commands in my opinion. There it will be reusable and it is in some central place. And the most important features are already present as commands...

          Cheers
          Bernd

          • 2. Re: ejb timer session
            Tom Baeyens Master

            yes, the command should definitely be executed in the command facility.

            the advantage is configuration and manageability.

            configuration: you might add an interceptor with configuration when the command service is used

            manageability: it's much easier to explain and keep track of what is executed where. so if someone adds a configuration to the command service it might be expected that this configuration will apply to all jbpm commands...