1 Reply Latest reply on May 6, 2009 9:06 AM by Nicklas Karlsson

    Web Beans annotation syntax

    Arbi Sookazian Master

      This is from a recent DAllen post:


      public
      @Stateless
      class AccountProducerBean implements AccountProducer
      {
          @PersistenceContext EntityManager em;
      
          @Current Identity identity;
      
          public
          @Produces
          @Registered
          @SessionScoped
          User getCurrentUser()
          {
              User user = em.find(User.class, identity.getUsername());
              return user != null ? user : new User();
          }
      }



      Note that public access modifier keyword comes before the annotations.  Is this required syntax by Web Beans RI or is it merely preference by DAllen?


      I guess I should just experiment by modifying the example apps that ship with the RI distro...