Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-974

Allow callback invocation for multiple business method invocations

    XMLWordPrintable

    Details

    • Type: Feature Request
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Out of Date
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Compensations
    • Labels:

      Description

      By setting the 'single' attribute on a Lifecycle Handler Annotation (such as @Prepare or @Compensate) identifies whether more than one callback can be registered for the lifecycle method in response to multiple invocations of the ServiceRequest method. If it is true then the lifecycle method will be called once to the ServiceRequest method. If it is false then the lifecycle method will be called once in response to each (non-read only) call to the ServiceRequest method. The default is 'false'.

      Annotation:

      @Retention(RetentionPolicy.RUNTIME)
      @Target(ElementType.METHOD)
      public @interface Compensate
      {
          public boolean single() default false;
      }
      

      Example:

      @ServiceRequest
      public void addToBasket()
      {
        //Add another item to the basket.
      }
      
      @Compensate(single=true)
      public void emptyBasket()
      {
        //Empty every item from the basket
      }
      

      In this example the @ServiceRequest may be invoked many times to add many items to the basket. The @Compensate method is only needed to be invoked once as the basket can be emptied in one operation.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                paul.robinson Paul Robinson
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: