Last active
August 29, 2015 14:12
-
-
Save abhirockzz/2bffe68d085d57778835 to your computer and use it in GitHub Desktop.
Method Interceptors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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