[jboss-jira] [JBoss JIRA] (WFLY-4461) CDI Interceptor is not called in EJB Schedule

Janario Oliveira (JIRA) issues at jboss.org
Tue Mar 24 14:49:19 EDT 2015


Janario Oliveira created WFLY-4461:
--------------------------------------

             Summary: CDI Interceptor is not called in EJB Schedule
                 Key: WFLY-4461
                 URL: https://issues.jboss.org/browse/WFLY-4461
             Project: WildFly
          Issue Type: Bug
          Components: CDI / Weld
    Affects Versions: 8.2.0.Final
            Reporter: Janario Oliveira
            Assignee: Stuart Douglas


I have defined a CDI interceptor as following:

@Interceptor
@MyIntercept
public class MyInterceptor {
    @AroundInvoke
    public Object intercept(InvocationContext context) throws Exception {
        LOG.info("Call {}.{}", 
		context.getMethod().getDeclaringClass().getName(), context.getMethod().getName());
        return context.proceed();
    }
}

@InterceptorBinding
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE})
public @interface MyIntercept {}


And declared it in MyService
@Singleton
@MyIntercept
public class MyService {
    @Schedule(second = "0/10", minute = "*", hour = "*", persistent = false)
    public void schedule() {
	//... do something
    }

    public void manualCall() {
	//... do something
    }
}



The interceptor was never called to schedule method but when call the manualCall method the interceptor was invoked.

I've also tested with weld-core-impl 2.2.9.Final and it didn't work.



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the jboss-jira mailing list