|
|||||||||
| 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.hd.d.pg2k.webSvr.util.JavadocBundleServlet
public final class JavadocBundleServlet
This is the servlet that serves the content of the (latest) Gallery javadoc bundle. Essentially this does what the default WAR container support would do if the javadoc files were simply laid out in WAR as static data, though giving us the option to tune cacheing and similar behaviour.
We only respond to GET (and possibly HEAD) requests.
| Field Summary | |
|---|---|
private static DataSourceBean.AEPLinkedKey |
dirKey
Private key for cache of ZIP directory against current AEP instance; never null. |
private static DataSourceBean.AEPLinkedKey |
fffKey
Cache key for most frequently-fetched (small) files; never null. |
private static int |
MAX_FFF_BYTES
Maximum uncompressed size in bytes of a file to be considered for the fff cache; strictly positive. |
private static int |
MAX_FFF_BYTES_COMPRESSED
Maximum compressed size in bytes of a file to be considered for the fff cache; strictly positive. |
private static int |
MAX_FFF_ENTRIES
Maximum number of entries to hold in FFF cache; strictly positive. |
private static int |
MIN_FFF_ENTRIES
Minimum number of entries ('working set') to try to hold in FFF cache; strictly positive. |
private static long |
serialVersionUID
Unique serialisation ID. |
| Constructor Summary | |
|---|---|
JavadocBundleServlet()
|
|
| Method Summary | |
|---|---|
private void |
doAction(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
boolean isHEAD)
Respond to a GET or HEAD request for the content served by this servlet. |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Respond to a GET request for the content served by this servlet. |
void |
doHead(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Respond to a HEAD request for the content served by this servlet. |
private static Name.ExhibitFull |
getBundleExhibitName(DataSourceBean dsb)
Get full exhibit name of the latest javadoc bundle; null if none. |
private static DataSourceBean |
getDataSource(javax.servlet.ServletConfig config,
javax.servlet.http.HttpServletRequest request)
Get singleton (per-servlet-context) data pipeline/cache instance. |
long |
getLastModified(javax.servlet.http.HttpServletRequest request)
Get `last-modified' time for the entire bundle. |
private static java.util.SortedMap<java.lang.CharSequence,FileTools.ZE> |
getZIPEntryOffsets(DataSourceBean dsb)
Get ZIP directory/offsets; null if none. |
| Methods inherited from class javax.servlet.http.HttpServlet |
|---|
doDelete, doOptions, doPost, doPut, doTrace, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
|---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final DataSourceBean.AEPLinkedKey fffKey
private static final int MAX_FFF_BYTES
private static final int MAX_FFF_BYTES_COMPRESSED
private static final int MIN_FFF_ENTRIES
private static final int MAX_FFF_ENTRIES
private static final DataSourceBean.AEPLinkedKey dirKey
private static final long serialVersionUID
| Constructor Detail |
|---|
public JavadocBundleServlet()
| Method Detail |
|---|
private void doAction(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
boolean isHEAD)
throws java.io.IOException
request - The servlet request we are processingresponse - The servlet response we are producing
java.io.IOException - if an input/output error occurs
public void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException
doGet in class javax.servlet.http.HttpServletrequest - The servlet request we are processingresponse - The servlet response we are producing
java.io.IOException - if an input/output error occurs
public void doHead(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException
doHead in class javax.servlet.http.HttpServletrequest - The servlet request we are processingresponse - The servlet response we are producing
java.io.IOException - if an input/output error occurspublic final long getLastModified(javax.servlet.http.HttpServletRequest request)
If returning a last-modified value causes difficulty (eg with Tomcat 4.0.1) then we return -1.
getLastModified in class javax.servlet.http.HttpServletrequest - The servlet request we are processing
private static DataSourceBean getDataSource(javax.servlet.ServletConfig config,
javax.servlet.http.HttpServletRequest request)
private static final Name.ExhibitFull getBundleExhibitName(DataSourceBean dsb)
private static java.util.SortedMap<java.lang.CharSequence,FileTools.ZE> getZIPEntryOffsets(DataSourceBean dsb)
Each value is the (non-negative) offset from the start of the ZIP file to the start of its entry as can be read with ZipInputStream.
This is cached against the AEP instance for efficiency. (We might have to go back across the network to the master to fetch this if we don't have the entire bundle cached locally, for example, which is slow.)
On successfully cacheing this we read the first byte of the archive to try to trigger (pre)cacheing of at least an enclosing early chunk.
|
DHD Multimedia Gallery V1.57.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||