[jbossts-issues] [JBoss JIRA] (JBTM-974) Allow many ServiceRequest methods to have a single set of Lifecycle methods

Paul Robinson (Updated) (JIRA) jira-events at lists.jboss.org
Mon Nov 28 07:02:40 EST 2011


     [ https://issues.jboss.org/browse/JBTM-974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Robinson updated JBTM-974:
-------------------------------

    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:

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

Example:

{code}
@ServiceRequest
public void addToBasket()
{
  //Add another item to the basket.
}

@Compensate(single=true)
public void emptyBasket()
{
  //Empty every item from the basket
}
{code}

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. 



  was:
The lifecycleClass attribute on @ServiceRequest and @ParticipantService needs to support remote services, such as EJB or Web services. This allows the events to be handled in a remote container. 

We need to decide how and what context is passed to the remote service. Clearly the remote service needs some context to know what action to take. However, simply flowing the TX context may not be appropriate as the lifecycle methods will be invoked during termination of the protocol.



    
> Allow many ServiceRequest methods to have a single set of Lifecycle methods
> ---------------------------------------------------------------------------
>
>                 Key: JBTM-974
>                 URL: https://issues.jboss.org/browse/JBTM-974
>             Project: JBoss Transaction Manager
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: TxBridge
>            Reporter: Paul Robinson
>            Assignee: Paul Robinson
>             Fix For: 5.0.0.M2
>
>
> 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:
> {code}
> @Retention(RetentionPolicy.RUNTIME)
> @Target(ElementType.METHOD)
> public @interface Compensate
> {
>     public boolean single() default false;
> }
> {code}
> Example:
> {code}
> @ServiceRequest
> public void addToBasket()
> {
>   //Add another item to the basket.
> }
> @Compensate(single=true)
> public void emptyBasket()
> {
>   //Empty every item from the basket
> }
> {code}
> 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. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbossts-issues mailing list