jet.servlet
Class JetMashupProxy

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by jet.servlet.JetMashupProxy
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class JetMashupProxy
extends javax.servlet.http.HttpServlet

The servlet - the core class of the jet turbine

Author:
Markus.Meisters@web.de
See Also:
Serialized Form

Field Summary
protected  net.sf.ehcache.Cache cache
          Simple Cache for filessmaller than 40960 bytes
private  java.util.HashMap debug
          Holds the regex which hosts etc. are allowed to use debug
private  java.util.concurrent.locks.Lock lock
           
private  org.apache.log4j.Logger log
          logger object
private  java.util.HashMap rights
          Holds the regex which hosts etc. are allowed to use status
private  javax.servlet.ServletContext servletContext
          the servlet context object
private  java.util.HashMap status
          Holds the regex which hosts etc. are allowed to use status
 
Constructor Summary
JetMashupProxy()
           
 
Method Summary
 void destroy()
           
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.
 javax.servlet.ServletContext getServletContext()
           
 java.lang.String getServletInfo()
          Returns a short description of the servlet.
 void init(javax.servlet.ServletConfig config)
          Method to initialize the jet resouce provider servlet
protected  void initCache()
          Method to initialize the ehcache - initialze only if not aready done
 boolean isDebug(java.lang.String key)
          indicates if the servlet allows debug modus in jetcontext
 boolean isRights(java.lang.String url)
          indicates if the servlet allows status modus in jetcontext
 boolean isStatus(java.lang.String host)
          indicates if the servlet allows status modus in jetcontext
protected  void processRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Processes requests for both HTTP GET and POST methods.
 void refresh()
          Refresh the resource cache
private  void setDebug(java.lang.String regex)
          Set if debug is allowed
private  void setRights(java.lang.String regex)
          Set which class regex are fetchable
private  void setStatus(java.lang.String regex)
          Set if status is allowed
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lock

private java.util.concurrent.locks.Lock lock

cache

protected net.sf.ehcache.Cache cache
Simple Cache for filessmaller than 40960 bytes


log

private org.apache.log4j.Logger log
logger object


debug

private java.util.HashMap debug
Holds the regex which hosts etc. are allowed to use debug


status

private java.util.HashMap status
Holds the regex which hosts etc. are allowed to use status


rights

private java.util.HashMap rights
Holds the regex which hosts etc. are allowed to use status


servletContext

private javax.servlet.ServletContext servletContext
the servlet context object

Constructor Detail

JetMashupProxy

public JetMashupProxy()
Method Detail

initCache

protected void initCache()
Method to initialize the ehcache - initialze only if not aready done


processRequest

protected final void processRequest(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response)
                             throws javax.servlet.ServletException,
                                    java.io.IOException
Processes requests for both HTTP GET and POST methods.

Parameters:
request - servlet request
response - servlet response
Throws:
javax.servlet.ServletException
java.io.IOException

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Method to initialize the jet resouce provider servlet

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
config - servlet config
Throws:
javax.servlet.ServletException

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     java.io.IOException
Handles the HTTP GET method.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - servlet request
response - servlet response
Throws:
javax.servlet.ServletException
java.io.IOException

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      java.io.IOException
Handles the HTTP POST method.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
request - servlet request
response - servlet response
Throws:
javax.servlet.ServletException
java.io.IOException

getServletInfo

public java.lang.String getServletInfo()
Returns a short description of the servlet.

Specified by:
getServletInfo in interface javax.servlet.Servlet
Overrides:
getServletInfo in class javax.servlet.GenericServlet

refresh

public void refresh()
             throws java.io.IOException
Refresh the resource cache

Throws:
java.io.IOException

isDebug

public final boolean isDebug(java.lang.String key)
indicates if the servlet allows debug modus in jetcontext

Returns:
boolean debug allowed?

setDebug

private final void setDebug(java.lang.String regex)
Set if debug is allowed


isStatus

public final boolean isStatus(java.lang.String host)
indicates if the servlet allows status modus in jetcontext

Returns:
boolean status allowed?

isRights

public final boolean isRights(java.lang.String url)
indicates if the servlet allows status modus in jetcontext

Returns:
boolean status allowed?

setStatus

private final void setStatus(java.lang.String regex)
Set if status is allowed


setRights

private final void setRights(java.lang.String regex)
Set which class regex are fetchable


destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet

getServletContext

public javax.servlet.ServletContext getServletContext()
Specified by:
getServletContext in interface javax.servlet.ServletConfig
Overrides:
getServletContext in class javax.servlet.GenericServlet