![JAR search and dependency download from the Maven repository](/logo.png)
org.infinispan.server.resp.CacheRespRequestHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infinispan-server-resp Show documentation
Show all versions of infinispan-server-resp Show documentation
Infinispan Resp Protocol Server
package org.infinispan.server.resp;
import org.infinispan.AdvancedCache;
import org.infinispan.commons.dataconversion.MediaType;
public class CacheRespRequestHandler extends RespRequestHandler {
protected AdvancedCache cache;
protected CacheRespRequestHandler(RespServer respServer) {
super(respServer);
setCache(respServer.getCache()
.withMediaType(MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_OCTET_STREAM));
}
public AdvancedCache cache() {
return cache;
}
@SuppressWarnings("unchecked")
public AdvancedCache typedCache(MediaType valueMediaType) {
AdvancedCache c = cache;
if (cache.getValueDataConversion().getRequestMediaType().match(valueMediaType)) {
return (AdvancedCache) c;
}
return cache.withMediaType(RespServer.RESP_KEY_MEDIA_TYPE, valueMediaType);
}
protected void setCache(AdvancedCache cache) {
this.cache = cache;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy