Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JBTM-3360 ServerLRAFilter is relying on the wrong RESTEasy behavior #1674

Merged
merged 1 commit into from Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -21,6 +21,7 @@
*/
package io.narayana.lra.client.internal.proxy.nonjaxrs;

import io.narayana.lra.AnnotationResolver;
import io.narayana.lra.logging.LRALogger;
import org.eclipse.microprofile.lra.annotation.AfterLRA;
import org.eclipse.microprofile.lra.annotation.Compensate;
Expand Down
Expand Up @@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package io.narayana.lra.client.internal.proxy.nonjaxrs;
package io.narayana.lra;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
Expand Down
Expand Up @@ -21,6 +21,7 @@
*/
package io.narayana.lra.filter;

import io.narayana.lra.AnnotationResolver;
import io.narayana.lra.Current;
import io.narayana.lra.client.NarayanaLRAClient;
import io.narayana.lra.client.internal.proxy.nonjaxrs.LRAParticipant;
Expand Down Expand Up @@ -117,7 +118,7 @@ public void filter(ContainerRequestContext containerRequestContext) {
Method method = resourceInfo.getResourceMethod();
MultivaluedMap<String, String> headers = containerRequestContext.getHeaders();
LRA.Type type = null;
LRA transactional = method.getDeclaredAnnotation(LRA.class);
LRA transactional = AnnotationResolver.resolveAnnotation(LRA.class, method);
URI lraId;
URI newLRA = null;
Long timeout = null;
Expand Down Expand Up @@ -151,11 +152,11 @@ public void filter(ContainerRequestContext containerRequestContext) {
}
}

boolean endAnnotation = method.isAnnotationPresent(Complete.class)
|| method.isAnnotationPresent(Compensate.class)
|| method.isAnnotationPresent(Leave.class)
|| method.isAnnotationPresent(Status.class)
|| method.isAnnotationPresent(Forget.class);
boolean endAnnotation = AnnotationResolver.isAnnotationPresent(Complete.class, method)
|| AnnotationResolver.isAnnotationPresent(Compensate.class, method)
|| AnnotationResolver.isAnnotationPresent(Leave.class, method)
|| AnnotationResolver.isAnnotationPresent(Status.class, method)
|| AnnotationResolver.isAnnotationPresent(Forget.class, method);

if (headers.containsKey(LRA_HTTP_CONTEXT_HEADER)) {
try {
Expand All @@ -168,7 +169,7 @@ public void filter(ContainerRequestContext containerRequestContext) {
}
}

if (method.isAnnotationPresent(Leave.class)) {
if (AnnotationResolver.isAnnotationPresent(Leave.class, method)) {
// leave the LRA
String compensatorId = getCompensatorId(incommingLRA, containerRequestContext.getUriInfo(), timeout);

Expand Down