|
||||||||||
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
jet.servlet.JetServlet
public class JetServlet
The servlet - the core class of the jet turbine
Field Summary | |
---|---|
protected ObjectPool |
actionpool
The jet definitions from config file |
protected net.sf.ehcache.Cache |
cache
|
private java.lang.String |
contextPath
the context path of the webapp |
private java.util.HashMap |
debug
|
private static JetInjector |
defaultInjector
|
private java.lang.String |
encoding
|
static java.lang.String |
INCOMING_FILTERNAME
|
protected ObjectPool |
jetInternalObjectPool
Holds the object pool for jetcontext |
private java.util.concurrent.locks.Lock |
lock
|
private java.lang.String[] |
locs
Localizer files/urls readed - you can specify more than one in config |
private org.apache.log4j.Logger |
log
logger object |
private MessageProvider |
provider
Localizer provider used |
private FilteredQueue<QueuedAction> |
queue
Queue for incoming requests |
private java.util.concurrent.locks.Lock |
queueLock
|
private java.util.HashMap |
refresh
Holds the regex which hosts etc. are allowed to use refresh |
private java.util.concurrent.locks.Lock |
refreshLock
|
private javax.servlet.ServletConfig |
servletConfig
the servlet config object |
private javax.servlet.ServletContext |
servletContext
the servlet context object |
private freemarker.ext.servlet.ServletContextHashModel |
servletContextHashModel
freemarker servletcontexthashmodel |
protected Jetdefs |
servletjetdefs
The jet definitions from config file |
private java.util.HashMap |
status
Holds the regex which hosts etc. are allowed to use status |
private freemarker.ext.jsp.TaglibFactory |
taglibs
freemarker taglib support |
private freemarker.template.Configuration |
templateEngine
The template engine used |
private java.lang.ThreadGroup |
workerthreadgroup
|
Constructor Summary | |
---|---|
JetServlet()
|
Method Summary | |
---|---|
private static java.lang.String |
createID(javax.servlet.http.HttpServletRequest request,
boolean sessionAware)
|
void |
destroy()
This method is called if the servlet/server shut down here we have to cleanup resources etc. |
protected void |
doDelete(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the HTTP DELETE method. |
private void |
doFirstQueuedAction(JetContext context,
QueuedAction qaction)
|
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the HTTP GET method. |
protected void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the HTTP POST method. |
protected void |
doPut(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the HTTP PUT method. |
private void |
doQueuedActions(JetContext context,
javax.servlet.http.HttpServletResponse response,
QueuedAction qaction)
|
java.lang.String |
getContextPath()
Method to return the context path |
java.lang.String |
getEncoding()
Returns the encoding to use |
Jetdefs |
getJetdefs()
Returns the Jetdefs readed from config |
java.util.TreeMap |
getLocalizedMessagesFor(java.util.Locale locale)
Method to retriev localized messages as hashmap |
static java.lang.String |
getMapAsLocaliser(java.lang.String parentKey,
java.util.Map map)
Method to get debug print for localiser |
byte[] |
getResource(java.lang.String resourceName)
gets the a file/resource |
javax.servlet.ServletConfig |
getServletConfig()
|
javax.servlet.ServletContext |
getServletContext()
|
freemarker.ext.servlet.ServletContextHashModel |
getServletContextHashModel()
Method returning a hashstructur needed for taglb support in freemarker templates |
java.lang.String |
getServletInfo()
Returns a short description of the servlet. |
freemarker.ext.jsp.TaglibFactory |
getTaglibs()
Method returning the tagib support object from freemarkers |
freemarker.template.Configuration |
getTemplateEngine()
returns the template engine |
static java.lang.String |
getTimeStamp()
returns a simple timestamp - used for debug prints |
void |
init(javax.servlet.ServletConfig config)
Method to initialize the jet turbine |
protected void |
initCache()
Method to initialize the ehcache - initialze only if not aready done |
boolean |
isDebug(java.lang.String host)
indicates if the servlet allows debug modus in jetcontext |
boolean |
isRefresh(java.lang.String host)
indicates if the servlet allows refresh modus in jetcontext |
boolean |
isStatus(java.lang.String host)
indicates if the servlet allows status modus in jetcontext |
private void |
printStatusInformation(javax.servlet.http.HttpServletResponse response)
Method du print status information about the jet caches and pools |
protected void |
processRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Processes requests for both HTTP GET and POST methods. |
protected void |
refreshAll()
refreshs all caches etc. |
protected void |
refreshLocalizers()
refreshs the localizer cache |
protected void |
refreshResourceCache()
refresh resource cache |
protected void |
refreshTemplateEngine()
refreshs template engine. |
private void |
setContextPath(java.lang.String val)
Method to set the context path |
private void |
setDebug(java.lang.String regex)
Set if debug is allowed |
private void |
setJetdefs(Jetdefs jetdefs)
Set the Jetdefs to use |
private void |
setRefresh(java.lang.String regex)
Set if refrsh is allowed |
private void |
setStatus(java.lang.String regex)
Set if status is allowed |
private void |
setTemplateEngine(freemarker.template.Configuration aTemplateEngine)
Set the template engine to use |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doHead, doOptions, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private org.apache.log4j.Logger log
protected ObjectPool jetInternalObjectPool
private freemarker.template.Configuration templateEngine
protected Jetdefs servletjetdefs
protected ObjectPool actionpool
private FilteredQueue<QueuedAction> queue
public static final java.lang.String INCOMING_FILTERNAME
private java.lang.ThreadGroup workerthreadgroup
private java.util.HashMap debug
private java.util.HashMap status
private java.util.HashMap refresh
private javax.servlet.ServletContext servletContext
private javax.servlet.ServletConfig servletConfig
private java.lang.String[] locs
private MessageProvider provider
private java.lang.String contextPath
private freemarker.ext.jsp.TaglibFactory taglibs
private freemarker.ext.servlet.ServletContextHashModel servletContextHashModel
private java.util.concurrent.locks.Lock lock
private java.util.concurrent.locks.Lock refreshLock
private java.util.concurrent.locks.Lock queueLock
private java.lang.String encoding
protected net.sf.ehcache.Cache cache
private static final JetInjector defaultInjector
Constructor Detail |
---|
public JetServlet()
Method Detail |
---|
private final void setContextPath(java.lang.String val)
public final java.lang.String getContextPath()
protected final void processRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
GET
and POST
methods.
request
- servlet requestresponse
- servlet response
javax.servlet.ServletException
java.io.IOException
private void doFirstQueuedAction(JetContext context, QueuedAction qaction) throws java.io.IOException
java.io.IOException
private void doQueuedActions(JetContext context, javax.servlet.http.HttpServletResponse response, QueuedAction qaction) throws java.io.IOException
java.io.IOException
private static final java.lang.String createID(javax.servlet.http.HttpServletRequest request, boolean sessionAware)
private void printStatusInformation(javax.servlet.http.HttpServletResponse response) throws java.io.IOException
java.io.IOException
public javax.servlet.ServletContext getServletContext()
getServletContext
in interface javax.servlet.ServletConfig
getServletContext
in class javax.servlet.GenericServlet
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
config
- servlet config
javax.servlet.ServletException
public java.util.TreeMap getLocalizedMessagesFor(java.util.Locale locale)
locale
- the locale to localizepublic static java.lang.String getMapAsLocaliser(java.lang.String parentKey, java.util.Map map)
parentKey
- parent keymap
- map
protected final void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
GET
method.
doGet
in class javax.servlet.http.HttpServlet
request
- servlet requestresponse
- servlet response
javax.servlet.ServletException
java.io.IOException
protected final void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
POST
method.
doPost
in class javax.servlet.http.HttpServlet
request
- servlet requestresponse
- servlet response
javax.servlet.ServletException
java.io.IOException
protected final void doDelete(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
DELETE
method.
doDelete
in class javax.servlet.http.HttpServlet
request
- servlet requestresponse
- servlet response
javax.servlet.ServletException
java.io.IOException
protected final void doPut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
PUT
method.
doPut
in class javax.servlet.http.HttpServlet
request
- servlet requestresponse
- servlet response
javax.servlet.ServletException
java.io.IOException
public java.lang.String getServletInfo()
getServletInfo
in interface javax.servlet.Servlet
getServletInfo
in class javax.servlet.GenericServlet
public final Jetdefs getJetdefs()
private void setJetdefs(Jetdefs jetdefs)
jetdefs
- jetdefspublic java.lang.String getEncoding()
public final freemarker.template.Configuration getTemplateEngine()
private void setTemplateEngine(freemarker.template.Configuration aTemplateEngine)
public static final java.lang.String getTimeStamp()
public final boolean isDebug(java.lang.String host)
private final void setDebug(java.lang.String regex)
public final boolean isStatus(java.lang.String host)
private final void setStatus(java.lang.String regex)
public final boolean isRefresh(java.lang.String host)
private final void setRefresh(java.lang.String regex)
protected void refreshAll() throws java.io.IOException
java.io.IOException
protected void refreshTemplateEngine()
protected void refreshLocalizers()
protected void refreshResourceCache() throws java.io.IOException
java.io.IOException
public byte[] getResource(java.lang.String resourceName) throws java.io.IOException, javax.servlet.ServletException
resourceName
- file name
java.io.IOException
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
public freemarker.ext.servlet.ServletContextHashModel getServletContextHashModel()
public freemarker.ext.jsp.TaglibFactory getTaglibs()
protected void initCache()
public javax.servlet.ServletConfig getServletConfig()
getServletConfig
in interface javax.servlet.Servlet
getServletConfig
in class javax.servlet.GenericServlet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |