org.jboss.resteasy.client.jaxrs.cache.BrowserCacheFeature Maven / Gradle / Ivy
package org.jboss.resteasy.client.jaxrs.cache;
import jakarta.ws.rs.core.Feature;
import jakarta.ws.rs.core.FeatureContext;
/**
* @author Bill Burke
* @version $Revision: 1 $
*/
public class BrowserCacheFeature implements Feature {
protected BrowserCache cache;
public BrowserCache getCache() {
return cache;
}
public void setCache(BrowserCache cache) {
this.cache = cache;
}
@Override
public boolean configure(FeatureContext configuration) {
if (cache == null)
cache = new LightweightBrowserCache();
configuration.property(BrowserCache.class.getName(), cache);
configuration.register(new CacheInterceptor(cache));
return true;
}
}