Class ServerCacheInterceptor
- java.lang.Object
-
- org.jboss.resteasy.plugins.cache.server.ServerCacheInterceptor
-
- All Implemented Interfaces:
javax.ws.rs.ext.WriterInterceptor
,AsyncWriterInterceptor
@ConstrainedTo(SERVER) public class ServerCacheInterceptor extends Object implements javax.ws.rs.ext.WriterInterceptor, AsyncWriterInterceptor
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
-
Field Summary
Fields Modifier and Type Field Description protected ServerCache
cache
protected HttpRequest
request
protected javax.ws.rs.core.Request
validation
-
Constructor Summary
Constructors Constructor Description ServerCacheInterceptor(ServerCache cache)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
aroundWriteTo(javax.ws.rs.ext.WriterInterceptorContext context)
CompletionStage<Void>
asyncAroundWriteTo(AsyncWriterInterceptorContext context)
Interceptor method wrapping calls toAsyncMessageBodyWriter.asyncWriteTo(T, java.lang.Class<?>, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String, java.lang.Object>, org.jboss.resteasy.spi.AsyncOutputStream)
method.static String
byteArrayToHexString(byte[] bytes)
protected String
createHash(byte[] entity)
-
-
-
Field Detail
-
cache
protected ServerCache cache
-
request
@Context protected HttpRequest request
-
validation
@Context protected javax.ws.rs.core.Request validation
-
-
Constructor Detail
-
ServerCacheInterceptor
public ServerCacheInterceptor(ServerCache cache)
-
-
Method Detail
-
byteArrayToHexString
public static String byteArrayToHexString(byte[] bytes)
-
createHash
protected String createHash(byte[] entity)
-
aroundWriteTo
public void aroundWriteTo(javax.ws.rs.ext.WriterInterceptorContext context) throws IOException, javax.ws.rs.WebApplicationException
- Specified by:
aroundWriteTo
in interfacejavax.ws.rs.ext.WriterInterceptor
- Throws:
IOException
javax.ws.rs.WebApplicationException
-
asyncAroundWriteTo
public CompletionStage<Void> asyncAroundWriteTo(AsyncWriterInterceptorContext context)
Description copied from interface:AsyncWriterInterceptor
Interceptor method wrapping calls toAsyncMessageBodyWriter.asyncWriteTo(T, java.lang.Class<?>, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String, java.lang.Object>, org.jboss.resteasy.spi.AsyncOutputStream)
method. The parameters of the wrapped method called are available fromcontext
. Implementations of this method SHOULD explicitly callAsyncWriterInterceptorContext.asyncProceed()
to invoke the next interceptor in the chain, and ultimately the wrappedAsyncMessageBodyWriter.asyncWriteTo
method.- Specified by:
asyncAroundWriteTo
in interfaceAsyncWriterInterceptor
- Parameters:
context
- invocation context.- Returns:
- a
CompletionStage
indicating completion
-
-