Class BridgeServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.adempiere.eclipse.equinox.http.servlet.BridgeServlet
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
- Direct Known Subclasses:
BridgeFilter
public class BridgeServlet
extends javax.servlet.http.HttpServlet
Adapted from org.eclipse.equinox.servletbridge.BridgeServlet
The BridgeServlet provides a means to bridge the servlet and OSGi
runtimes. This class has 3 main responsibilities:
1) Control the lifecycle of the associated FrameworkLauncher in line with its own lifecycle
2) Provide a servlet "hook" that allows all servlet requests to be delegated to the registered servlet
3) Provide means to manually control the framework lifecycle
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()destroy() is called by the Servlet Container and used to first stop and then destroy the framework.voidinit()init() is called by the Servlet Container and used to instantiate the frameworkLauncher which MUST be an instance of FrameworkLauncher.protected voidprocess(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, javax.servlet.FilterChain chain) Search from OSGi registry the servlet, resources... to execute according to the path of the HTTP request.protected voidservice(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) service is called by the Servlet Container and will first determine if the request is a framework control and will otherwise try to delegate to the registered servlet delegateMethods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, serviceMethods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
BridgeServlet
public BridgeServlet()
-
-
Method Details
-
init
public void init() throws javax.servlet.ServletExceptioninit() is called by the Servlet Container and used to instantiate the frameworkLauncher which MUST be an instance of FrameworkLauncher. After instantiating the framework init, deploy, and start are called.- Overrides:
initin classjavax.servlet.GenericServlet- Throws:
javax.servlet.ServletException
-
destroy
public void destroy()destroy() is called by the Servlet Container and used to first stop and then destroy the framework.- Specified by:
destroyin interfacejavax.servlet.Servlet- Overrides:
destroyin classjavax.servlet.GenericServlet
-
service
protected void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException service is called by the Servlet Container and will first determine if the request is a framework control and will otherwise try to delegate to the registered servlet delegate- Overrides:
servicein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
process
protected void process(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, javax.servlet.FilterChain chain) throws javax.servlet.ServletException, IOException Search from OSGi registry the servlet, resources... to execute according to the path of the HTTP request. If no services are found :- if
FilterChainis not null :FilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse)is called. - otherwise throw 404 error.
- Parameters:
req-resp-chain-- Throws:
javax.servlet.ServletExceptionIOException
- if
-