2 Replies Latest reply on Dec 17, 2008 3:39 PM by jnusaira

    Asynchronous annotation and SLSB components

    admin.admin.email.tld

      Are there any working examples anywhere to download that demonstrate using @Asynchronous, @IntervalDuration and @Expiration methods for EJB3 timer or Quartz scheduling in EJB components, not just Seam POJO components (i.e. classes w/ @Stateless)?


      All the classes I've found in the examples Seam distro folder are using straight-up POJO's (i.e. w/o @Stateless).  non-EJB POJO examples include:


      org.jboss.seam.example.quartz.PaymentProcessor
      org.jboss.seam.example.seampay.PaymentProcessor
      org.jboss.seam.wiki.core.search.IndexManager
      org.jboss.seam.example.seambay.AuctionEndAction
      org.jboss.seam.example.mail.AsynchronousMailProcessor


      I would post my code but I am having a difficult time with invalid markup BULLSHIT errors that I can't completely read and that never occurred when I posted code fragments in the old Seam forum.  This is very irritating and time consuming.


      Also, are both of the tags below (this site doesn't seem to handle xml, angle brackets, quotes or equal signs very well??) required in the components.xml?  The second one (ThreadPoolDispatcher) is not referenced in the Seam doc in section 18.1 but is in the components.xml for seampay app.



      • async:timer-service-dispatcher

      • component class org.jboss.seam.async.ThreadPoolDispatcher precedence 40

        • 1. Re: Asynchronous annotation and SLSB components
          pmuir

          I don't believe there are any examples showing exactly what you are after.


          Just include your stack trace and code inside back ticks - if you have specific problems and can't make that work post on the Seam Wiki forum.


          You need to choose your dispatcher - Quartz


          <async:quartz-dispatcher />



          or JDK


          <async:thread-pool-dispatcher />



          or EJB3


          <async:timer-service-dispatcher />



          use at most one.


          The seampay example uses the ThreadPoolDispatcher for tests only (a precedence of 40 is for tests).

          • 2. Re: Asynchronous annotation and SLSB components
            jnusaira

            With ... @Asynchronous and using quartz-dispatcher are you able to actually launch SLSB asynchrnously.


            I have one and now that i converted it to a SLSB it no longer seems to run asyncrhonosuly.