public class ModjyJServlet
extends javax.servlet.http.HttpServlet
Modifier and Type | Field and Description |
---|---|
protected PythonInterpreter |
interp |
protected static java.lang.String |
LIB_PYTHON |
protected static java.lang.String |
LOAD_SITE_PACKAGES_PARAM |
protected static java.lang.String |
MODJY_PYTHON_CLASSNAME |
protected javax.servlet.http.HttpServlet |
modjyServlet |
protected static java.lang.String |
PTH_FILE_EXTENSION |
protected static java.lang.String |
PYTHON_HOME_PARAM |
Constructor and Description |
---|
ModjyJServlet() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkSitePackages(java.util.Properties props)
Check if the user has requested to initialise the jython installation "site-packages".
|
void |
destroy()
Close down the modjy servlet.
|
void |
init()
Initialise the modjy servlet.
|
protected void |
processPthFile(PythonInterpreter interp,
PySystemState systemState,
java.lang.String pythonLibPath,
java.lang.String pthFilename)
Process an individual file .pth file in the lib-python directory
|
protected void |
processPythonLib(PythonInterpreter interp,
PySystemState systemState)
Do all processing in relation to the lib-python subdirectory of WEB-INF
|
protected java.util.Properties |
readConfiguration()
Read configuration
1.
|
void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Actually service the incoming request.
|
protected void |
setupEnvironment(PythonInterpreter interp,
java.util.Properties props,
PySystemState systemState)
Setup the modjy environment, i.e.
|
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
protected static final java.lang.String MODJY_PYTHON_CLASSNAME
protected static final java.lang.String LIB_PYTHON
protected static final java.lang.String PTH_FILE_EXTENSION
protected static final java.lang.String LOAD_SITE_PACKAGES_PARAM
protected static final java.lang.String PYTHON_HOME_PARAM
protected PythonInterpreter interp
protected javax.servlet.http.HttpServlet modjyServlet
protected java.util.Properties readConfiguration()
public void init() throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
public void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
service
in class javax.servlet.http.HttpServlet
req
- - The incoming HttpServletRequestresp
- - The outgoing HttpServletResponsejavax.servlet.ServletException
java.io.IOException
public void destroy()
destroy
in interface javax.servlet.Servlet
destroy
in class javax.servlet.GenericServlet
protected void setupEnvironment(PythonInterpreter interp, java.util.Properties props, PySystemState systemState) throws PyException
interp
- - The PythonInterpreter used to service requestsprops
- - The properties from which config options are foundsystemState
- - The PySystemState corresponding to the interpreter servicing requestsPyException
protected void checkSitePackages(java.util.Properties props) throws PyException
props
- - The properties from which config options are foundPyException
protected void processPythonLib(PythonInterpreter interp, PySystemState systemState)
interp
- - The PythonInterpreter used to service requestssystemState
- - The PySystemState whose path should be updatedprotected void processPthFile(PythonInterpreter interp, PySystemState systemState, java.lang.String pythonLibPath, java.lang.String pthFilename)
interp
- - The PythonInterpreter which will execute importssystemState
- - The PySystemState whose path should be updatedpythonLibPath
- - The actual path to the lib-python directorypthFilename
- - The PySystemState whose path should be updated