Skip to content

Instantly share code, notes, and snippets.

@csadilek
Last active August 29, 2015 14:00
Show Gist options
  • Save csadilek/ee8cd941cd3d0520f9c6 to your computer and use it in GitHub Desktop.
Save csadilek/ee8cd941cd3d0520f9c6 to your computer and use it in GitHub Desktop.
@Dependent
@InterceptsRemoteCall({ MyRemoteInterface.class, MyOtherRemoteInterface.class })
public class MyCacheInterceptor implements RpcInterceptor {
@Inject
private MyAppCache cache;
@Override
public void aroundInvoke(final RemoteCallContext context) {
// e.g check if the result is cached and carry out
// the actual call only in case it's not.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment