Created
January 3, 2015 07:58
-
-
Save abhirockzz/289a2750cd98826cdfc7 to your computer and use it in GitHub Desktop.
Lifecycle Callback interceptors @PostConstruct
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 PostConstructInterceptor{ | |
@PostConstruct | |
public void interceptorMethod(InvocationContext ictx) throws Exception{ | |
//logic goes here | |
} | |
} | |
@Interceptors(PostConstructInterceptor.class) | |
public class APOJO{ | |
@PostConstruct | |
public void bizMethod(){ | |
//any calls to this method will be intercepted by PostConstructInterceptor.interceptorMethod() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment