|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet com.saxonica.deploy.CompiledQueryServlet
public abstract class CompiledQueryServlet
This abstract class acts as a superclass for every query generated by the Saxon code generator in servlet mode. In this mode the generated code is thread-safe: it is possible to have a single instance of the class running in multiple threads concurrently.
It is possible to define a user-defined subclass of this class that specializes the behaviour of the init() and service() methods. When a query is compiled, the -superclass option on the command line determines the immediate superclass of the compiled code. Such a class will be needed, for example, if different queries are to share access to the same in-memory documents.
During servlet initialization, the init() method attempts to determine whether the servlet context
includes an attribute named com.saxonica.servlet.applicationdata
that is an instance of the
interface SharedApplicationDataHandler
. If this object exists, it is called on each servlet request, at which
point it has the opportunity to configure the Controller
for the query execution, for example by supplying
parameter values, setting a URIResolver, or otherwise.
If no SharedApplicationDataHandler
object is available, external variables for the query can be specified
as query parameters in the request URL. The names of query parameters are taken as local names of no-namespace
variables, and the values are treated as UntypedAtomic strings (which will be converted to the declared type
of the variable if necessary). Any query parameters that do not correspond to declared external variables in
the query will be ignored.
Constructor Summary | |
---|---|
CompiledQueryServlet()
|
Method Summary | |
---|---|
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Run the query as a servlet |
Configuration |
getConfiguration()
Get the Configuration. |
Executable |
getExecutable()
Get the Executable. |
void |
init()
Servlet initialization method |
abstract void |
initializeGlobals()
Run the query-specific initialization code. |
abstract void |
process(XPathContext context)
Run the query, sending the results to the current output destination. |
void |
setConfiguration(Configuration config)
Supply the configuration in which the query will be executed. |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
service |
Methods inherited from class javax.servlet.GenericServlet |
---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, init, log, log |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CompiledQueryServlet()
Method Detail |
---|
public void init() throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
public abstract void initializeGlobals() throws XPathException
XPathException
public final void setConfiguration(Configuration config)
This method should be called during initialization by the init() method. If a user-defined subclass
of CompiledQueryServlet
is in use, the subclass may call this method directly. In the absence
of such a class, the default implementation will call the SharedApplicationDataHandler
to supply a
Configuration; and in the absence of SharedApplicationDataHandler
it will construct a Configuration
specific to this servlet instance.
config
- the Configuration to be used. If the query is schema-aware, this must be an instance
of SchemaAwareConfiguration
public void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, IOException
doGet
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
IOException
public final Configuration getConfiguration()
public Executable getExecutable()
public abstract void process(XPathContext context) throws XPathException
XPathException
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |