2 Replies Latest reply on Jul 30, 2008 12:49 AM by Samuel Doyle

    Problem with @Asynchronous method in startup component.

    Samuel Doyle Apprentice

      I'm trying to launch an indexing method on server startup so that the application server does not block. Looking at the examples I had thought something like the following would work but my doIndex method is still synchronous.


      @Local
      public interface Index
      {
         public void create();
       
         @Asynchronous
         public void doIndex();
         
         public void remove();
      }




      @Name( "indexer" )
      @Stateful
      @Scope( ScopeType.APPLICATION )
      @Startup
      
      public class IndexerAction
              implements Index
      {
         @Create
      
         public void create()
         {
            this.doIndex();
         }
         ...
         @TransactionTimeout( 1800 )
         public void doIndex()
         {
           ....
      }



      In components.xml



      <!-- Install the QuartzDispatcher -->
       <async:quartz-dispatcher/>



      In application.xml


      <module>
              <ejb>lib/quartz.jar</ejb>
      </module>