[jboss-cvs] jboss-seam/doc/reference/en/modules ...

Gavin King gavin.king at jboss.com
Tue Oct 24 11:18:17 EDT 2006


  User: gavin   
  Date: 06/10/24 11:18:17

  Modified:    doc/reference/en/modules   annotations.xml jms.xml
  Log:
  @Async belongs on interface
  
  Revision  Changes    Path
  1.47      +18 -0     jboss-seam/doc/reference/en/modules/annotations.xml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: annotations.xml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/doc/reference/en/modules/annotations.xml,v
  retrieving revision 1.46
  retrieving revision 1.47
  diff -u -b -r1.46 -r1.47
  --- annotations.xml	16 Oct 2006 13:13:16 -0000	1.46
  +++ annotations.xml	24 Oct 2006 15:18:17 -0000	1.47
  @@ -891,6 +891,12 @@
                               default to the exception message.
                           </para>
                           </listitem>
  +                        <listitem>
  +                        <para>
  +                            <literal>end</literal> &mdash; specifies that the long-running
  +                            conversation should end, default to <literal>false</literal>.
  +                        </para>
  +                        </listitem>
                       </itemizedlist>
                   </listitem>
               </varlistentry>
  @@ -916,6 +922,12 @@
                               default to the exception message.
                           </para>
                           </listitem>
  +                        <listitem>
  +                        <para>
  +                            <literal>end</literal> &mdash; specifies that the long-running
  +                            conversation should end, default to <literal>false</literal>.
  +                        </para>
  +                        </listitem>
                       </itemizedlist>
                   </listitem>
               </varlistentry>
  @@ -940,6 +952,12 @@
                               with the HTTP error, default to the exception message.
                           </para>
                           </listitem>
  +                        <listitem>
  +                        <para>
  +                            <literal>end</literal> &mdash; specifies that the long-running
  +                            conversation should end, default to <literal>false</literal>.
  +                        </para>
  +                        </listitem>
                       </itemizedlist>
                   </listitem>
               </varlistentry>
  
  
  
  1.7       +38 -16    jboss-seam/doc/reference/en/modules/jms.xml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: jms.xml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/doc/reference/en/modules/jms.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- jms.xml	16 Oct 2006 11:51:11 -0000	1.6
  +++ jms.xml	24 Oct 2006 15:18:17 -0000	1.7
  @@ -31,24 +31,47 @@
           <title>Asynchronous methods</title>
           
           <para>
  -            In simplest form, an asycnhronous call just lets a method call be processed asynchronously 
  +            In simplest form, an asynchronous call just lets a method call be processed asynchronously 
               (in a different thread) from the caller. We usually use an asynchronous call when we want 
               to return an immediate response to the client, and let some expensive work be processed in
               the background. This pattern works very well in applications which use AJAX, where the
               client can automatically poll the server for the result of the work.
           </para>
           
  +        <para>
  +            For EJB components, we annotate the local interface to specify that a method is processed
  +            asynchronously.
  +        </para>
  +        
  +        <programlisting><![CDATA[@Local
  +public interface PaymentHandler
  +{
  +    @Asynchronous
  +    public void processPayment(Payment payment);
  +}]]></programlisting>
  +
  +        <para>
  +            (For JavaBean components we can annotate the component implementation class if we like.)
  +        </para>
  +        
  +        <para>
  +            The use of asynchronicity is transparent to the bean class:
  +        </para>
  +        
           <programlisting><![CDATA[@Stateless
   @Name("paymentHandler")
  -public class PaymentHandler
  +public class PaymentHandlerBean implements PaymentHandler
   {
  -    @Asynchronous
       public void processPayment(Payment payment)
       {
           //do some work!
       }
   }]]></programlisting>
           
  +        <para>
  +            And also transparent to the client:
  +        </para>
  +        
           <programlisting><![CDATA[@Stateful
   @Name("paymentAction")
   public class CreatePaymentAction
  @@ -75,21 +98,14 @@
               <literal>@IntervalDuration</literal> annotations.
           </para>
           
  -        <programlisting><![CDATA[@Stateless
  - at Name("paymentHandler")
  -public class PaymentHandler
  +        <programlisting><![CDATA[@Local
  +public interface PaymentHandler
   {
       @Asynchronous
  -    public void processScheduledPayment(Payment payment, @Expiration Date date)
  -    {
  -        //do some work!
  -    }
  +    public void processScheduledPayment(Payment payment, @Expiration Date date);
   
       @Asynchronous
  -    public void processRecurringPayment(Payment payment, @Expiration Date date, @IntervalDuration Date interval)
  -    {
  -        //do some work!
  -    }
  +    public void processRecurringPayment(Payment payment, @Expiration Date date, @IntervalDuration Date interval)'
   }]]></programlisting>
           
           <programlisting><![CDATA[@Stateful
  @@ -117,13 +133,19 @@
               the invocation.
           </para>
   
  +        <programlisting><![CDATA[@Local
  +public interface PaymentHandler
  +{
  +    @Asynchronous
  +    public Timer processScheduledPayment(Payment payment, @Expiration Date date);
  +}]]></programlisting>
  +        
           <programlisting><![CDATA[@Stateless
   @Name("paymentHandler")
  -public class PaymentHandler
  +public class PaymentHandlerBean implements PaymentHandler
   {
       @In Timer timer;
       
  -    @Asynchronous
       public Timer processScheduledPayment(Payment payment, @Expiration Date date)
       {
           //do some work!
  
  
  



More information about the jboss-cvs-commits mailing list