The LRA object is used to mark the participant endpoint that will be used to participate in an LRA. LRA object defines the LRA context. When the endpoint method that is set to the lraURI in an LRA object finishes execution, the LRA is closed by default. That can be suppressed by setting the end attribute to false, which ensures that the LRA is not closed at the end of a method. Then the LRA can be closed in a different method. The LRA object provides a similar behavior as the LRA annotation in the Microprofile LRA specification.

Hierarchy

  • LRA

Constructors

  • Initialize a LRA object

    Parameters

    • lraURI: string

      The LRA URI is the endpoint URI that will be used to participate in an LRA by creating a new LRA Context or joining an existing one as determined by the type attribute value

    • type: LRAType

      The type attribute of an LRA indicates whether a resource method is to be executed within the context of an LRA. The value must be one of the LRAType

    Returns LRA

Properties

cancelOn: string[] = ...

The cancelOn element can be set to indicate which HTTP response codes will cause the current LRA to cancel. If the LRA has already been closed when the method returns then this element is silently ignored. Cancelling an LRA means that all participants will eventually be asked to compensate (by having their (inLRAConfig) method invoked)

cancelOnFamily: string[] = ...

The cancelOnFamily element can be set to indicate which families of HTTP response codes will cause the current LRA to cancel. If the LRA has already been closed when the method returns then this element is silently ignored. Cancelling an LRA means that all participants will eventually be asked to compensate (by having their (in LRAConfig) method invoked)

end: boolean = true

If the method runs with an LRA context then this attribute determines whether or not it is closed when the method returns. If the attribute has the value true then the LRA will be ended and all participants that have the (in LRAConfig) MUST eventually be asked to complete. If the attribute has the value false then the LRA will not be ended when the method finishes. If the end value is set to false but the method finishes with a status code that matches any of the values specified in the cancelOn or cancelOnFamily attributes then the LRA will be cancelled. In other words the cancelOn and cancelOnFamily elements take precedence over the end element.

lraURI: string

The LRA URI is the endpoint URI that will be used to participate in an LRA by creating a new LRA Context or joining an existing one as determined by the type attribute value

timeLimitInMilliSeconds: number = 30000

If the method runs with an LRA context then this attribute determines the period (in MilliSeconds) for which the LRA will remain valid. When this period has elapsed the LRA becomes eligible for cancellation. A value of zero indicates that the LRA will always remain valid

type: LRAType = LRAType.REQUIRED

The type attribute of an LRA indicates whether a resource method is to be executed within the context of an LRA. The value must be one of the LRAType

Copyright © 2022, 2024, Oracle and/or its affiliates.