Skip to content

Commit

Permalink
Merge pull request #3454 from rdebusscher/PAYARA-3316
Browse files Browse the repository at this point in the history
PAYARA-3316 : Fix method selection with @AroundInvoke and @AroundTimeout
  • Loading branch information
arjantijms authored Dec 4, 2018
2 parents a5b9826 + 9f1d6a7 commit dee9ecb
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2018] [Payara Foundation and/or its affiliates]

package org.glassfish.ejb.deployment.annotation.handlers;

Expand Down Expand Up @@ -159,16 +160,16 @@ private void processInterceptorClass(Class interceptorClass,
ComponentDefinition cdef = new ComponentDefinition(interceptorClass);
for(Method m : cdef.getMethods()) {
if( m.getAnnotation(AroundInvoke.class) != null ) {
aroundInvokeDescriptors.add(getLifecycleCallbackDescriptor(m));
aroundInvokeDescriptors.add(getLifecycleCallbackDescriptor(m, true));
}
if( m.getAnnotation(AroundTimeout.class) != null ) {
aroundTimeoutDescriptors.add(getLifecycleCallbackDescriptor(m));
aroundTimeoutDescriptors.add(getLifecycleCallbackDescriptor(m, true));
}
if( m.getAnnotation(PostActivate.class) != null ) {
postActivateDescriptors.add(getLifecycleCallbackDescriptor(m));
postActivateDescriptors.add(getLifecycleCallbackDescriptor(m, false));
}
if( m.getAnnotation(PrePassivate.class) != null ) {
prePassivateDescriptors.add(getLifecycleCallbackDescriptor(m));
prePassivateDescriptors.add(getLifecycleCallbackDescriptor(m, false));
}
}

Expand Down Expand Up @@ -218,10 +219,11 @@ public Class<? extends Annotation>[] getTypeDependencies() {
return getEjbAnnotationTypes();
}

private LifecycleCallbackDescriptor getLifecycleCallbackDescriptor(Method m) {
private LifecycleCallbackDescriptor getLifecycleCallbackDescriptor(Method m, boolean requiresInvocationContextArgument) {
LifecycleCallbackDescriptor lccDesc = new LifecycleCallbackDescriptor();
lccDesc.setLifecycleCallbackClass(m.getDeclaringClass().getName());
lccDesc.setLifecycleCallbackMethod(m.getName());
lccDesc.setRequiresInvocationContextArgument(requiresInvocationContextArgument);
return lccDesc;
}
}

0 comments on commit dee9ecb

Please sign in to comment.