Hello,
I've introduced a superclass to deal with interceptors for a kind of session 
beans. If I define a @AroundInvoke method on the superclass, it's successfully 
invoked for all the subclasses. But if I define a @Interceptors  annotation on 
the superclass, it is ignored by the subclasses. I don't think this is correct 
according to the spec...
I've tested that with a true Stateless Session superclass, annotated with 
@Stateless @Remote({ CPageFacade.class }), or with an annotated POJO and the 
result is the same.
Greetings.

Here's the code :

@Interceptors({ CPageSecurityInterceptor.class })
// this one is never invoked for the subclasses
public abstract class CPageFacadeBean implements CPageFacade {

  @AroundInvoke
  public Object intercept(InvocationContext invocationContext) throws Exception 
{
    // this one is ok !
    return invocationContext.proceed();
  }
}

____________________________________________________

@Stateless
@Remote(HelloFacade.class)
public class HelloFacadeBean extends CPageFacadeBean implements HelloFacade {

  public String sayHello(String who) {
    // do the stuff here
    return "hello " + who;
  }
}

____________________________________________________

public class CPageSecurityInterceptor {

  @Resource
  private SessionContext sessionContext;

 @AroundInvoke
  public Object authorize(InvocationContext invocationContext) throws Exception 
{
    // this one is never called for the subclasses
    return invocationContext.proceed();
  }

____________________________________________________

public interface HelloFacade extends CPageFacade {
  String sayHello(String who);
}

____________________________________________________

public interface CPageFacade {
  // no-op
}


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3950652#3950652

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3950652


_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to