Created
January 3, 2015 08:01
-
-
Save abhirockzz/89a5ffb20edc4d63dcd0 to your computer and use it in GitHub Desktop.
Intercerptor Binding
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
@InterceptorBinding | |
@Target({TYPE, METHOD, CONSTRUCTOR}) | |
@Retention(RUNTIME) | |
public @interface @Auditable { | |
} | |
@Auditable | |
@Interceptor | |
public class AuditInterceptor { | |
@AroundInvoke | |
public Object audit(InvocationContext ictx) throws Exception{ | |
//logic goes here | |
} | |
} | |
@Stateless | |
@Auditable | |
public class AnEJB{ | |
public void bizMethod(){ | |
//any calls to this method will be intercepted by AuditInterceptor.audit() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment