com.caucho.quercus.servlet
Class QuercusServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.caucho.quercus.servlet.QuercusServlet
All Implemented Interfaces:
java.io.Serializable, Servlet, ServletConfig
Direct Known Subclasses:
GoogleQuercusServlet

public class QuercusServlet
extends HttpServlet

Servlet to call PHP through javax.script.

See Also:
Serialized Form

Nested Class Summary
static class QuercusServlet.PhpIni
           
static class QuercusServlet.ServerEnv
           
 
Constructor Summary
QuercusServlet()
           
 
Method Summary
 void addClass(PhpClassConfig classConfig)
          Adds a quercus class.
 void addImplClass(PhpClassConfig classConfig)
          Adds a quercus class.
 void addModule(QuercusModule module)
          Adds a quercus module.
 QuercusServlet.PhpIni createPhpIni()
          Adds a quercus.ini configuration
 QuercusServlet.ServerEnv createServerEnv()
          Adds a $_SERVER configuration
 void destroy()
          Closes the servlet instance.
protected  QuercusServletImpl getQuercusServlet(boolean isResin)
           
 void init(ServletConfig config)
          Initializes the servlet.
 void service(HttpServletRequest request, HttpServletResponse response)
          Service.
 void setCompile(java.lang.String isCompile)
          Set true if quercus should be compiled into Java.
 void setCompileFailover(java.lang.String isCompileFailover)
          Set true interpreted pages should be used for pages that fail to compile.
 void setConnectionPool(boolean isEnable)
          Turns connection pooling on or off.
 void setDatabase(javax.sql.DataSource database)
          Set the default data source.
 void setDependencyCheckInterval(long ms)
           
 void setIniFile(java.lang.String relPath)
          Sets a php.ini file.
protected  void setInitParam(java.lang.String paramName, java.lang.String paramValue)
          Sets a named init-param to the passed value.
 void setLooseParse(boolean isLooseParse)
          Sets the strict mode.
 void setMysqlVersion(java.lang.String version)
          Sets the version of the client mysql library to report as.
 void setPageCacheEntries(int entries)
          Sets the max size of the page cache.
 void setPageCacheSize(int size)
          Sets the max size of the page cache.
 void setPhpVersion(java.lang.String version)
          Sets the php version that Quercus should report itself as.
 void setProfileProbability(double probability)
          Sets the frequency of profiling, expressed as a probability.
 void setRegexpCacheSize(int size)
          Sets the max size of the regexp cache.
 void setRequireSource(boolean isRequireSource)
          Set true if the source php is required
 void setScriptEncoding(java.lang.String encoding)
          Sets the script encoding.
 void setStrict(boolean isStrict)
          Sets the strict mode.
 
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, getServletInfo, getServletName, init, log, log, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QuercusServlet

public QuercusServlet()
Method Detail

getQuercusServlet

protected QuercusServletImpl getQuercusServlet(boolean isResin)

setCompile

public void setCompile(java.lang.String isCompile)
                throws ConfigException
Set true if quercus should be compiled into Java.

Throws:
ConfigException

setCompileFailover

public void setCompileFailover(java.lang.String isCompileFailover)
                        throws ConfigException
Set true interpreted pages should be used for pages that fail to compile.

Throws:
ConfigException

setProfileProbability

public void setProfileProbability(double probability)
                           throws ConfigException
Sets the frequency of profiling, expressed as a probability.

Throws:
ConfigException

setRequireSource

public void setRequireSource(boolean isRequireSource)
Set true if the source php is required


setDependencyCheckInterval

public void setDependencyCheckInterval(long ms)

setDatabase

public void setDatabase(javax.sql.DataSource database)
                 throws ConfigException
Set the default data source.

Throws:
ConfigException

setStrict

public void setStrict(boolean isStrict)
Sets the strict mode.


setLooseParse

public void setLooseParse(boolean isLooseParse)
Sets the strict mode.


setPageCacheEntries

public void setPageCacheEntries(int entries)
Sets the max size of the page cache.


setPageCacheSize

public void setPageCacheSize(int size)
Sets the max size of the page cache.


setRegexpCacheSize

public void setRegexpCacheSize(int size)
Sets the max size of the regexp cache.


setConnectionPool

public void setConnectionPool(boolean isEnable)
Turns connection pooling on or off.


addModule

public void addModule(QuercusModule module)
               throws ConfigException
Adds a quercus module.

Throws:
ConfigException

addClass

public void addClass(PhpClassConfig classConfig)
              throws ConfigException
Adds a quercus class.

Throws:
ConfigException

addImplClass

public void addImplClass(PhpClassConfig classConfig)
                  throws ConfigException
Adds a quercus class.

Throws:
ConfigException

createPhpIni

public QuercusServlet.PhpIni createPhpIni()
                                   throws ConfigException
Adds a quercus.ini configuration

Throws:
ConfigException

createServerEnv

public QuercusServlet.ServerEnv createServerEnv()
                                         throws ConfigException
Adds a $_SERVER configuration

Throws:
ConfigException

setIniFile

public void setIniFile(java.lang.String relPath)
Sets a php.ini file.


setScriptEncoding

public void setScriptEncoding(java.lang.String encoding)
                       throws ConfigException
Sets the script encoding.

Throws:
ConfigException

setMysqlVersion

public void setMysqlVersion(java.lang.String version)
Sets the version of the client mysql library to report as.


setPhpVersion

public void setPhpVersion(java.lang.String version)
Sets the php version that Quercus should report itself as.


init

public void init(ServletConfig config)
          throws ServletException
Initializes the servlet.

Specified by:
init in interface Servlet
Overrides:
init in class GenericServlet
Parameters:
config - the servlet's configuration
Throws:
ServletException

setInitParam

protected void setInitParam(java.lang.String paramName,
                            java.lang.String paramValue)
                     throws ServletException
Sets a named init-param to the passed value.

Throws:
ServletException - if the init-param is not recognized

service

public void service(HttpServletRequest request,
                    HttpServletResponse response)
             throws ServletException,
                    java.io.IOException
Service.

Overrides:
service in class HttpServlet
Parameters:
request - request information
response - response object for returning data to the client.
Throws:
ServletException
java.io.IOException

destroy

public void destroy()
Closes the servlet instance.

Specified by:
destroy in interface Servlet
Overrides:
destroy in class GenericServlet