All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.resteasy.client.jaxrs.cache.BrowserCacheFeature Maven / Gradle / Ivy

There is a newer version: 7.0.0.Alpha4
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy