ejb-spec
  1. ejb-spec
  2. EJB_SPEC-1

Decoupling the @Schedule annotation from the EJB component model.

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.2
    • Fix Version/s: Future version
    • Labels:
      None

      Description

      Currently the EJB @Schedule annotation can only be used with the EJB component model. With the introduction of managed beans and CDI, there are not many good technical reasons why the @Schedule annotation should not be used in managed beans as well. In fact, many developers that are wary of the EJB component model would opt to use this model instead. In addition, decoupling EJB services such as @Schedule from the component model moves towards removing one-off component models in Java EE in favor of unifying around managed beans/CDI.

      We currently allow this capability in Resin. The code looks like this:

      @ApplicationScoped
      public class MyScheduledBean {
      ...
      @Schedule(...)
      public void myScheduledTask()

      { ... }

      ...
      }

      It should also be possible to use @Schedule in CDI stereotypes so that developers can compose custom component types to meet the needs of their individual applications (currently the @Schedule annotation can only be applied to methods). The code for this could look like the following:

      @ApplicationScoped
      @Stereotype
      @Retention(RUNTIME)
      @Target(TYPE)
      @Schedule(...)
      public @interface MonthlyTask {}

        Activity

          People

          • Assignee:
            marina vatkina
            Reporter:
            reza_rahman
          • Votes:
            15 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: