Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-15372

Remove the use of TimerHandle in ejb timer management operations




      the spec states that:

      The javax.ejb.TimerHandle interface allows the caller to obtain a serializable timer handle that may be persisted. Timer handles are only available for persistent timers. Since timers are local objects, a TimerHandle must not be passed through a bean’s remote business interface, remote interface or web service interface.

      Since the TimerHandle interface extends java.io.Serializable, a client may serialize the handle. The serialized handle may be used later to obtain a reference to the timer identified by the han- dle. A TimerHandle is intended to be storable in persistent storage.
      A TimerHandle must not be passed as an argument or result of an enterprise bean’s remote business interface, remote interface, or web service method.


      WildFly ejb timer management operations creates new TimerHandle instances in order to obtain the associated timers. This is not the intended usage of TimerHandle and is not necessary. We should be able to perform the same operations with timer id and timed object id.

      We should consider making TimerHandleImpl class package private to disallow external instantiation.

      removes the timerHandle field from TimerImpl class and modifies its getHandle() method to return a new instance of TimerHandleImpl for every call, since it's not worthwhile to save it as an instance variable. In most cases, application calls getHandle() method once or none at all.


        Issue Links



              cfang@redhat.com Cheng Fang
              cfang@redhat.com Cheng Fang
              0 Vote for this issue
              1 Start watching this issue