tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cocorossello <cocorosse...@gmail.com>
Subject Re: CDI Interceptors to intercept all EJB @Schedule methods
Date Thu, 20 Sep 2018 21:21:11 GMT
Sorry, I made a mistake (I made the interceptor without parameters and didn't
read the tomee warnings)

It works with an ejb-jar.xml

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         version="3.2"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd">
    <assembly-descriptor>
        <interceptor-binding>
            <ejb-name>*</ejb-name>
            <interceptor-class>com.ScheduleInterceptor</interceptor-class>
        </interceptor-binding>
    </assembly-descriptor>
</ejb-jar>

and


public class ScheduleInterceptor {

    @AroundTimeout
    public Object intercept(InvocationContext ctx) throws Exception {
        System.out.println("hi");
        return super.intercept(ctx);
    }
}






--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html

Mime
View raw message