|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.apache.jcs.auxiliary.remote.http.server.RemoteHttpCacheServlet
public class RemoteHttpCacheServlet
This servlet simply reads and writes objects. The requests are packaged in a general wrapper. The processor works on the wrapper object and returns a response wrapper.
| Constructor Summary | |
|---|---|
RemoteHttpCacheServlet()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class javax.servlet.http.HttpServlet |
|---|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service |
| Methods inherited from class javax.servlet.GenericServlet |
|---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RemoteHttpCacheServlet()
| Method Detail |
|---|
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 Servletinit in class GenericServletconfig -
ServletException
public void service(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
IOException
service in class HttpServletrequest - response -
ServletException
IOExceptionprotected 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 Servletdestroy in class GenericServletpublic String getServletInfo()
getServletInfo in interface ServletgetServletInfo in class GenericServletpublic void setRemoteHttpCacheServiceAdaptor(RemoteCacheServiceAdaptor<Serializable,Serializable> remoteHttpCacheProcessor)
remoteHttpCacheProcessor - the remoteHttpCacheProcessor to setpublic RemoteCacheServiceAdaptor<Serializable,Serializable> getRemoteHttpCacheServiceAdaptor()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||