Skip to content

Instantly share code, notes, and snippets.

@abhirockzz
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhirockzz/2bffe68d085d57778835 to your computer and use it in GitHub Desktop.
Save abhirockzz/2bffe68d085d57778835 to your computer and use it in GitHub Desktop.
Method Interceptors
public class MethodInterceptor{
@AroundInvoke
public Object interceptorMethod(InvocationContext ictx) throws Exception{
//logic goes here
}
}
@Stateless
public class AnEJB{
@Interceptors(MethodInterceptor.class)
public void bizMethod(){
//any calls to this method will be intercepted by MethodInterceptor.interceptorMethod()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment