Skip to content

Instantly share code, notes, and snippets.

@abhirockzz
Created January 3, 2015 07:58
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/289a2750cd98826cdfc7 to your computer and use it in GitHub Desktop.
Save abhirockzz/289a2750cd98826cdfc7 to your computer and use it in GitHub Desktop.
Lifecycle Callback interceptors @PostConstruct
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