Package org.apache.axis.transport.http
Class AxisServletBase
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.apache.axis.transport.http.AxisServletBase
-
- All Implemented Interfaces:
java.io.Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
- Direct Known Subclasses:
AdminServlet
,AutoRegisterServlet
,AxisServlet
public class AxisServletBase extends javax.servlet.http.HttpServlet
Base class for servlets used in axis, has common methods to get and save the engine to a common location, currently the webapp's context, though some alternate persistence mechanism is always possible. Also has a load counter shared by all servlets; tracks the # of active http requests open to any of the subclasses.- Author:
- Steve Loughran
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
ATTR_AXIS_ENGINE
name of the axis engine to use in the servlet contextprotected AxisServer
axisServer
per-instance cache of the axis server
-
Constructor Summary
Constructors Constructor Description AxisServletBase()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static void
decLockCounter()
thread safe lock counter decrementvoid
destroy()
Destroy method is called when the servlet is going away.AxisServer
getEngine()
get the engine for this servlet from cache or contextstatic AxisServer
getEngine(javax.servlet.http.HttpServlet servlet)
This is a uniform method of initializing AxisServer in a servlet context.protected static java.util.Map
getEngineEnvironment(javax.servlet.http.HttpServlet servlet)
extract information from the servlet configuration filesprotected java.lang.String
getHomeDir()
what is the root dir of the applet?static int
getLoadCounter()
get a count of the # of services running.protected java.lang.String
getOption(javax.servlet.ServletContext context, java.lang.String param, java.lang.String dephault)
Retrieve option, in order of precedence: (Managed) System property (see discovery.ManagedProperty), servlet init param, context init param.javax.servlet.ServletContext
getServletContext()
what is the servlet contextprotected java.lang.String
getWebappBase(javax.servlet.http.HttpServletRequest request)
extract the base of our webapp from an inbound requestprotected java.lang.String
getWebInfPath()
accessor to webinfprotected static void
incLockCounter()
thread safe lock counter incrementvoid
init()
our initialize routine; subclasses should call this if they override itboolean
isDevelopment()
probe for the system being 'production'protected void
service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
subclass of service method that tracks entry count; calls the parent's implementation to have the http method cracked and delegated to the doGet, doPost method.-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
-
-
-
-
Field Detail
-
axisServer
protected AxisServer axisServer
per-instance cache of the axis server
-
ATTR_AXIS_ENGINE
protected static final java.lang.String ATTR_AXIS_ENGINE
name of the axis engine to use in the servlet context- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init() throws javax.servlet.ServletException
our initialize routine; subclasses should call this if they override it- Overrides:
init
in classjavax.servlet.GenericServlet
- Throws:
javax.servlet.ServletException
-
destroy
public void destroy()
Destroy method is called when the servlet is going away. Pass this down to the AxisEngine to let it clean up... But don't create the engine if it hasn't already been created.- Specified by:
destroy
in interfacejavax.servlet.Servlet
- Overrides:
destroy
in classjavax.servlet.GenericServlet
-
getEngine
public AxisServer getEngine() throws AxisFault
get the engine for this servlet from cache or context- Returns:
- Throws:
AxisFault
-
getEngine
public static AxisServer getEngine(javax.servlet.http.HttpServlet servlet) throws AxisFault
This is a uniform method of initializing AxisServer in a servlet context.- Throws:
AxisFault
-
getEngineEnvironment
protected static java.util.Map getEngineEnvironment(javax.servlet.http.HttpServlet servlet)
extract information from the servlet configuration files- Parameters:
servlet
-- Returns:
-
getLoadCounter
public static int getLoadCounter()
get a count of the # of services running. This is only ever an approximate number in a busy system- Returns:
- The TotalServiceCount value
-
incLockCounter
protected static void incLockCounter()
thread safe lock counter increment
-
decLockCounter
protected static void decLockCounter()
thread safe lock counter decrement
-
service
protected void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
subclass of service method that tracks entry count; calls the parent's implementation to have the http method cracked and delegated to the doGet, doPost method.- Overrides:
service
in classjavax.servlet.http.HttpServlet
- Parameters:
req
- requestresp
- response- Throws:
javax.servlet.ServletException
- something went wrongjava.io.IOException
- something different went wrong
-
getWebappBase
protected java.lang.String getWebappBase(javax.servlet.http.HttpServletRequest request)
extract the base of our webapp from an inbound request- Parameters:
request
- request containing http://foobar/axis/services/something- Returns:
- some URL like http://foobar:8080/axis/
-
getServletContext
public javax.servlet.ServletContext getServletContext()
what is the servlet context- Specified by:
getServletContext
in interfacejavax.servlet.ServletConfig
- Overrides:
getServletContext
in classjavax.servlet.GenericServlet
- Returns:
- get the context from the servlet config
-
getWebInfPath
protected java.lang.String getWebInfPath()
accessor to webinf- Returns:
- path to WEB-INF/ in the local filesystem
-
getHomeDir
protected java.lang.String getHomeDir()
what is the root dir of the applet?- Returns:
- path of root dir
-
getOption
protected java.lang.String getOption(javax.servlet.ServletContext context, java.lang.String param, java.lang.String dephault)
Retrieve option, in order of precedence: (Managed) System property (see discovery.ManagedProperty), servlet init param, context init param. Use of system properties is discouraged in production environments, as it overrides everything else.
-
isDevelopment
public boolean isDevelopment()
probe for the system being 'production'- Returns:
- true for a dev system.
-
-