|
xmlBlaster 2.2.0 contributions API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.contrib.htmlmonitor.HtmlMonitorPlugin
public class HtmlMonitorPlugin
HtmlMonitorPlugin is a native plugin to build simple HTML monitoring pages.
The HTML pages are available over the tiny xmlBlaster HTTP server. This plugin needs to be registered in xmlBlasterPlugins.xml to be available on xmlBlaster server startup.<plugin id='HtmlMonitorPlugin.MyCompany' className='org.xmlBlaster.contrib.htmlmonitor.HtmlMonitorPlugin'> <attribute id='urlPath'>/monitor</attribute> <attribute id='documentRoot'>${user.home}${file.separator}html</attribute> <attribute id='urlPath.CLASSPATH'>/status.html</attribute> <action do='LOAD' onStartupRunlevel='9' sequence='6' onFail='resource.configuration.pluginFailed'/> <action do='STOP' onShutdownRunlevel='6' sequence='5'/> </plugin>
Setting urlPath to /monitor and documentRoot to /home/xmlblast/html and invoking in the browser http://localhost:3412/monitor/x.html will lookup /home/xmlblast/html/x.html
This plugin uses java.util.logging and redirects the logging to xmlBlasters default logging framework. You can switch this off by setting the attribute xmlBlaster/jdk14loggingCapture to false.
Constructor Summary | |
---|---|
HtmlMonitorPlugin()
Default constructor, you need to call init() thereafter. |
Method Summary | |
---|---|
java.lang.String |
get(java.lang.String key,
java.lang.String def)
Access a property. |
java.lang.String |
getType()
The plugin name as configured im xmlBlasterPlugins.xml |
java.lang.String |
getVersion()
The plugin version as configured in xmlBlasterPlugins.xml |
void |
init(org.xmlBlaster.util.Global global_,
org.xmlBlaster.util.plugin.PluginInfo pluginInfo)
This method is called by the PluginManager. |
org.xmlBlaster.util.http.HttpResponse |
service(java.lang.String urlPath,
java.util.Map properties)
A HTTP request needs to be processed |
void |
shutdown()
Cleans up the resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HtmlMonitorPlugin()
Method Detail |
---|
public void init(org.xmlBlaster.util.Global global_, org.xmlBlaster.util.plugin.PluginInfo pluginInfo) throws org.xmlBlaster.util.XmlBlasterException
org.xmlBlaster.util.plugin.I_Plugin
// An entry in xmlBlaster.properties (in one line): MimeSubscribePlugin[ContentLenFilter][1.0]=\ org.xmlBlaster.engine.mime.demo.ContentLenFilter,\ DEFAULT_MAX_LEN=200,DEFAULT_MIN_LEN=20 // Access it like this: java.util.Properties props = pluginInfo.getParameters(); String maxLen = (String)props.get("DEFAULT_MAX_LEN"); String throwLen = (String)props.get("THROW_EXCEPTION_FOR_LEN");
init
in interface org.xmlBlaster.util.plugin.I_Plugin
org.xmlBlaster.util.XmlBlasterException
I_Plugin.init(org.xmlBlaster.util.Global, org.xmlBlaster.util.plugin.PluginInfo)
public java.lang.String getType()
getType
in interface org.xmlBlaster.util.plugin.I_Plugin
I_Plugin.getType()
public java.lang.String getVersion()
getVersion
in interface org.xmlBlaster.util.plugin.I_Plugin
I_Plugin.getVersion()
public org.xmlBlaster.util.http.HttpResponse service(java.lang.String urlPath, java.util.Map properties)
service
in interface org.xmlBlaster.util.http.I_HttpRequest
urlPath
- The url path like "/monitor/show.html" or "/status.html" which triggered this call
contains the real file name as given in the browser window including the
leading slash '/'.properties
- The key values from the browser
public void shutdown() throws org.xmlBlaster.util.XmlBlasterException
org.xmlBlaster.util.plugin.I_Plugin
shutdown
in interface org.xmlBlaster.util.plugin.I_Plugin
org.xmlBlaster.util.XmlBlasterException
- if an exception occurs. The exception is
handled by the RunLevelManager depending on how the plugin has been
configured with the action:
<action do='STOP' onShutdownRunlevel='2' sequence='5'
onFail='resource.configuration.pluginFailed'>
If onFail is defined to something, the RunLevelManager will stop.I_Plugin.shutdown()
public java.lang.String get(java.lang.String key, java.lang.String def)
key
- The key to lookupdef
- The default to return if key is not found
|
xmlBlaster 2.2.0 contributions API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |