|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.apache.felix.webconsole.AbstractWebConsolePlugin
org.apache.felix.webconsole.internal.WebConsolePluginAdapter
public class WebConsolePluginAdapter
The WebConsolePluginAdapter
is an adapter to the
AbstractWebConsolePlugin
for regular servlets registered with the
WebConsoleConstants.PLUGIN_TITLE
service attribute.
Field Summary |
---|
Fields inherited from class org.apache.felix.webconsole.AbstractWebConsolePlugin |
---|
ATTR_FILEUPLOAD, GET_RESOURCE_METHOD_NAME |
Constructor Summary | |
---|---|
WebConsolePluginAdapter(String label,
Servlet plugin,
ServiceReference serviceReference)
Creates a new wrapper for a Web Console Plugin |
Method Summary | |
---|---|
void |
destroy()
Destroys this servlet as well as the plugin servlet. |
protected String[] |
getCssReferences()
Returns the CSS references from the felix.webconsole.css
service registration property of the plugin. |
String |
getLabel()
Returns the label of this plugin page as defined in the constructor. |
protected Object |
getResourceProvider()
Returns the registered plugin class to be able to call the getResource() method on that object for this plugin to
provide additional resources. |
String |
getTitle()
Returns the title of this plugin page as defined by the WebConsoleConstants.PLUGIN_TITLE service registration attribute
which is exposed as the servlet name in the servlet configuration. |
void |
init(ServletConfig config)
Initializes this servlet as well as the plugin servlet. |
protected boolean |
isHtmlRequest(HttpServletRequest request)
Detects whether this request is intended to have the headers and footers of this plugin be rendered or not. |
protected void |
renderContent(HttpServletRequest req,
HttpServletResponse res)
Call the plugin servlet's service method to render the content of this page. |
void |
service(ServletRequest req,
ServletResponse resp)
Directly refer to the plugin's service method unless the request method is GET in which case we defer the call into the service method
until the abstract web console plugin calls the
renderContent(HttpServletRequest, HttpServletResponse)
method. |
Methods inherited from class org.apache.felix.webconsole.AbstractWebConsolePlugin |
---|
activate, deactivate, doGet, endResponse, getBrandingPlugin, getBundle, getBundleContext, getParameter, getServletName, log, log, readTemplateFile, renderTopNavigation, sendRedirect, setBrandingPlugin, setLogLevel, startResponse |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebConsolePluginAdapter(String label, Servlet plugin, ServiceReference serviceReference)
label
- the labelplugin
- the plugin itselfserviceReference
- reference to the pluginMethod Detail |
---|
public String getLabel()
getLabel
in class AbstractWebConsolePlugin
AbstractWebConsolePlugin.getLabel()
public String getTitle()
WebConsoleConstants.PLUGIN_TITLE
service registration attribute
which is exposed as the servlet name in the servlet configuration.
getTitle
in class AbstractWebConsolePlugin
AbstractWebConsolePlugin.getTitle()
protected String[] getCssReferences()
felix.webconsole.css
service registration property of the plugin.
getCssReferences
in class AbstractWebConsolePlugin
null
if no such CSS files are required.AbstractWebConsolePlugin.getCssReferences()
protected void renderContent(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
renderContent
in class AbstractWebConsolePlugin
req
- the HTTP request send from the userres
- the HTTP response object, where to render the plugin data.
ServletException
- if the request for the GET
could not be handled
IOException
- if an input or output error is
detected when the servlet handles the requestAbstractWebConsolePlugin.renderContent(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
protected Object getResourceProvider()
getResource()
method on that object for this plugin to
provide additional resources.
getResourceProvider
in class AbstractWebConsolePlugin
null
if no
resources will be provided by this plugin.AbstractWebConsolePlugin.getResourceProvider()
public void init(ServletConfig config) throws ServletException
init
in interface Servlet
init
in class GenericServlet
config
- the ServletConfig
object
that contains configutation
information for this servlet
ServletException
- if an exception occurs that
interrupts the servlet's normal
operationGenericServlet.init(javax.servlet.ServletConfig)
protected boolean isHtmlRequest(HttpServletRequest request)
.html
, the request
is assumed to be rendered with header and footer. Otherwise the
headers and footers are omitted and the
renderContent(HttpServletRequest, HttpServletResponse)
method is called without any decorations and without setting any
response headers.
isHtmlRequest
in class AbstractWebConsolePlugin
request
- the original request passed from the HTTP server
true
if the page should have headers and footers renderedAbstractWebConsolePlugin.isHtmlRequest(javax.servlet.http.HttpServletRequest)
public void service(ServletRequest req, ServletResponse resp) throws ServletException, IOException
GET
in which case we defer the call into the service method
until the abstract web console plugin calls the
renderContent(HttpServletRequest, HttpServletResponse)
method.
service
in interface Servlet
service
in class HttpServlet
req
- the HttpServletRequest
object that
contains the request the client made of
the servletresp
- the HttpServletResponse
object that
contains the response the servlet returns
to the client
ServletException
- if the request for the
TRACE cannot be handled
IOException
- if an input or output error occurs
while the servlet is handling the
TRACE requestHttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
public void destroy()
destroy
in interface Servlet
destroy
in class GenericServlet
GenericServlet.destroy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |