|
||||||||||
| 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(java.lang.String label,
javax.servlet.Servlet plugin,
org.osgi.framework.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 java.lang.String[] |
getCssReferences()
Returns the CSS references from the felix.webconsole.css
service registration property of the plugin. |
java.lang.String |
getLabel()
Returns the label of this plugin page as defined in the constructor. |
protected java.lang.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. |
java.lang.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(javax.servlet.ServletConfig config)
Initializes this servlet as well as the plugin servlet. |
protected boolean |
isHtmlRequest(javax.servlet.http.HttpServletRequest request)
Detects whether this request is intended to have the headers and footers of this plugin be rendered or not. |
protected void |
renderContent(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Call the plugin servlet's service method to render the content of this page. |
void |
service(javax.servlet.ServletRequest req,
javax.servlet.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(java.lang.String label,
javax.servlet.Servlet plugin,
org.osgi.framework.ServiceReference serviceReference)
label - the labelplugin - the plugin itselfserviceReference - reference to the plugin| Method Detail |
|---|
public java.lang.String getLabel()
getLabel in class AbstractWebConsolePluginAbstractWebConsolePlugin.getLabel()public java.lang.String getTitle()
WebConsoleConstants.PLUGIN_TITLE service registration attribute
which is exposed as the servlet name in the servlet configuration.
getTitle in class AbstractWebConsolePluginAbstractWebConsolePlugin.getTitle()protected java.lang.String[] getCssReferences()
felix.webconsole.css
service registration property of the plugin.
getCssReferences in class AbstractWebConsolePluginnull if no such CSS files are required.AbstractWebConsolePlugin.getCssReferences()
protected void renderContent(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
java.io.IOException
renderContent in class AbstractWebConsolePluginreq - the HTTP request send from the userres - the HTTP response object, where to render the plugin data.
javax.servlet.ServletException - if the request for the GET
could not be handled
java.io.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 java.lang.Object getResourceProvider()
getResource() method on that object for this plugin to
provide additional resources.
getResourceProvider in class AbstractWebConsolePluginnull if no
resources will be provided by this plugin.AbstractWebConsolePlugin.getResourceProvider()
public void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
init in interface javax.servlet.Servletinit in class javax.servlet.GenericServletjavax.servlet.ServletExceptionGenericServlet.init(javax.servlet.ServletConfig)protected boolean isHtmlRequest(javax.servlet.http.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 AbstractWebConsolePluginrequest - 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(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse resp)
throws javax.servlet.ServletException,
java.io.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 javax.servlet.Servletservice in class javax.servlet.http.HttpServletjavax.servlet.ServletException
java.io.IOExceptionHttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)public void destroy()
destroy in interface javax.servlet.Servletdestroy in class javax.servlet.GenericServletGenericServlet.destroy()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||