• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Query rgd Base class interceptor

 
Satya Maheshwari
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quoting from EJB spec:
If a bean class has superclasses, any AroundInvoke methods defined on those superclasses are invoked, most general superclass first.

To practically test this, I created a plain java class



And then made my session bean extend this class


But on caling any method in BSessionBean, there is no interceptor being invoked. Could somebody point me if I am missing somethig here? :roll:
 
Benoît de Chateauvieux
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Satya,

In order to test this point of the specification, you need to create an EJB:

@Stateless
public class BSessionBean extends Base implements BSessionRemote {
public void hello() {
System.out.println("Hello World!");
}
}

With his superclass wich have an @AroundInvoke method:

public class Base {
@AroundInvoke
public void message1(InvocationContext ctx){
System.out.println("Super");
}
}

In this case, the output is:
Super

It works !

Beno�t
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic