public class RemoteHttpCacheServlet extends HttpServlet
Constructor and Description |
---|
RemoteHttpCacheServlet() |
Modifier and Type | Method and Description |
---|---|
protected ICacheEventLogger |
configureCacheEventLogger(Properties props)
Tries to get the event logger.
|
protected RemoteHttpCacheServerAttributes |
configureRemoteHttpCacheServerAttributes(Properties prop)
Configure.
|
protected <K,V> RemoteHttpCacheService<K,V> |
createRemoteHttpCacheService(ICompositeCacheManager cacheManager)
Configures the attributes and the event logger and constructs a service.
|
void |
destroy()
Release the cache manager.
|
String |
getServletInfo()
Get servlet information
|
void |
init(ServletConfig config)
Initializes the cache.
|
protected RemoteCacheResponse<Object> |
processRequest(RemoteCacheRequest<Serializable,Serializable> request)
Processes the request.
|
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.
|
protected void |
setRemoteCacheService(ICacheServiceNonLocal<Serializable,Serializable> rcs) |
protected void |
writeResponse(HttpServletResponse response,
RemoteCacheResponse<Object> 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 RemoteHttpCacheServlet()
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<Object> cacheResponse)
response
- cacheResponse
- protected RemoteCacheResponse<Object> processRequest(RemoteCacheRequest<Serializable,Serializable> request)
request
- protected <K,V> RemoteHttpCacheService<K,V> createRemoteHttpCacheService(ICompositeCacheManager cacheManager)
cacheManager
- protected ICacheEventLogger configureCacheEventLogger(Properties props)
props
- protected RemoteHttpCacheServerAttributes configureRemoteHttpCacheServerAttributes(Properties prop)
jcs.remotehttpcache.serverattributes.ATTRIBUTENAME=ATTRIBUTEVALUE
prop
- protected void setRemoteCacheService(ICacheServiceNonLocal<Serializable,Serializable> rcs)
rcs
- the remoteCacheService to setpublic void destroy()
destroy
in interface Servlet
destroy
in class GenericServlet
public String getServletInfo()
getServletInfo
in interface Servlet
getServletInfo
in class GenericServlet
Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.