xmlBlaster 2.2.0 API

javaclients
Class ClientPlugin

java.lang.Object
  extended by javaclients.ClientPlugin
All Implemented Interfaces:
I_Plugin

public class ClientPlugin
extends java.lang.Object
implements I_Plugin

This client is loaded by xmlBlaster as a plugin on startup, it then connects to xmlBlaster and gets synchronous a message and disconnects.

You need to add this plugin to xmlBlasterPlugins.xml, for example:

  <plugin id='ClientPlugin' className='javaclients.ClientPlugin'>
     <action do='LOAD' onStartupRunlevel='9'/>
     <action do='STOP' onShutdownRunlevel='6'/>
  </plugin>
 

See Also:
run level requirement, run level howto requirement

Constructor Summary
ClientPlugin()
           
 
Method Summary
private  void doSomething()
          We login to xmlBlaster and check the free memory
 java.lang.String getType()
           
 java.lang.String getVersion()
           
 void init(Global glob, PluginInfo pluginInfo)
          This method is called by the PluginManager.
 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

ClientPlugin

public ClientPlugin()
Method Detail

init

public void init(Global glob,
                 PluginInfo pluginInfo)
          throws XmlBlasterException
Description copied from interface: I_Plugin
This method is called by the PluginManager.

Example how options are evaluated:

   // 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");
 

Specified by:
init in interface I_Plugin
Throws:
XmlBlasterException

getType

public java.lang.String getType()
Specified by:
getType in interface I_Plugin

getVersion

public java.lang.String getVersion()
Specified by:
getVersion in interface I_Plugin

shutdown

public void shutdown()
              throws XmlBlasterException
Description copied from interface: I_Plugin
Cleans up the resource.

Specified by:
shutdown in interface I_Plugin
Throws:
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.


doSomething

private final void doSomething()
We login to xmlBlaster and check the free memory


xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.