tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gurkan Erdogdu <cgurkanerdo...@gmail.com>
Subject Interceptors in Tomcat
Date Wed, 15 Jul 2009 16:10:21 GMT
Hi;

I am trying to getting work of interceptors in Tomcat installation.

I have a simple stateless Bean

@Stateless
@Interceptors(value={MyInterceptor.class})
public class HelloBean implements Hello
{
    public String sayHello()
    {
        return "Hello";
    }
}

This is MyInterceptor

public class MyInterceptor
{
    @PostConstruct
    public void afterConstruct(InvocationContext context) throws Exception
    {
        Object object = context.getTarget();

        System.out.println(object);

    }

    @AroundInvoke
    public Object arounfInvoke(InvocationContext context) throws Exception
    {
        return context.proceed();
    }
}

But interceptors are not called. If I debug, in DeploymentInfo instance,
InterceptorData exist with class MyInterceptor, but its post construct and
around invoke method lists are empty.

Is there anything that I missed?

Thanks;

--Gurkan

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message