ClientInterceptorRepositoryImpl interceptors = clientRequestFactory
.getPrefixInterceptors();
interceptors.registerInterceptor(new LoggingExecutionInterceptor());
interceptors.registerInterceptor(new CacheInterceptor(
new LightweightBrowserCache()));
interceptors.registerInterceptor(new ForceCachingExecutionInterceptor(
10));
// create a proxy using the JAX-RS annotation
photoResource = clientRequestFactory.createProxy(PhotoResource.class);