public class RemoteHttpCacheServlet extends HttpServlet
Constructor and Description |
---|
RemoteHttpCacheServlet() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Release the cache manager.
|
protected void |
ensureCacheManager()
Make sure we have a cache manager.
|
RemoteCacheServiceAdaptor<Serializable,Serializable> |
getRemoteHttpCacheServiceAdaptor() |
String |
getServletInfo()
Get servlet information
|
void |
init(ServletConfig config)
Initializes the cache.
|
protected RemoteCacheRequest<Serializable,Serializable> |
readRequest(HttpServletRequest request)
Read the request from the input stream.
|
protected RemoteCacheRequest<Serializable,Serializable> |
readRequestFromStream(InputStream inputStream)
Reads the response from the stream and then closes it.
|
void |
service(HttpServletRequest request,
HttpServletResponse response)
Read the request, call the processor, write the response.
|
void |
setRemoteHttpCacheServiceAdaptor(RemoteCacheServiceAdaptor<Serializable,Serializable> remoteHttpCacheProcessor) |
protected void |
writeResponse(HttpServletResponse response,
RemoteCacheResponse<Serializable> cacheResponse)
Write the response to the output stream.
|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
public void init(ServletConfig config) throws ServletException
This provides an easy extension point. Simply extend this servlet and override the init method to change the way the properties are loaded.
init
in interface Servlet
init
in class GenericServlet
config
- ServletException
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
service
in class HttpServlet
request
- response
- ServletException
IOException
protected RemoteCacheRequest<Serializable,Serializable> readRequest(HttpServletRequest request)
request
- protected RemoteCacheRequest<Serializable,Serializable> readRequestFromStream(InputStream inputStream) throws IOException, ClassNotFoundException
inputStream
- IOException
ClassNotFoundException
protected void writeResponse(HttpServletResponse response, RemoteCacheResponse<Serializable> cacheResponse)
response
- cacheResponse
- protected void ensureCacheManager() throws CacheException
CacheException
- if the configuration cannot be loadedpublic void destroy()
destroy
in interface Servlet
destroy
in class GenericServlet
public String getServletInfo()
getServletInfo
in interface Servlet
getServletInfo
in class GenericServlet
public void setRemoteHttpCacheServiceAdaptor(RemoteCacheServiceAdaptor<Serializable,Serializable> remoteHttpCacheProcessor)
remoteHttpCacheProcessor
- the remoteHttpCacheProcessor to setpublic RemoteCacheServiceAdaptor<Serializable,Serializable> getRemoteHttpCacheServiceAdaptor()
Copyright © 2002–2015 The Apache Software Foundation. All rights reserved.