xmlBlaster 2.2.0 API

org.xmlBlaster.engine
Class StartupTasks

java.lang.Object
  extended by org.xmlBlaster.engine.StartupTasks
All Implemented Interfaces:
I_Plugin

public class StartupTasks
extends java.lang.Object
implements I_Plugin

This plugin is loaded on xmlBlaster startup and executes the script file xmlBlasterStartup.xml.

The file xmlBlasterStartup.xml follows the syntax rules of XmlScriptInterpreter.

This StartupTasks plugin is started with the run level manager as configured in xmlBlasterPlugins.xml, for example:

  <plugin id='StartupTasks' className='org.xmlBlaster.engine.StartupTasks'>
     <action do='LOAD' onStartupRunlevel='7' sequence='1'
                          onFail='resource.configuration.pluginFailed'/>
     <action do='STOP' onShutdownRunlevel='6' sequence='1'/>
     <attribute id='loginName'>_StartupTasks</attribute>
     <attribute id='password'>secret</attribute>
     <attribute id='scriptFileName'>xmlBlasterStartup.xml</attribute>
     <attribute id='directoryName'>${user.home}</attribute>
     <attribute id='outFileName'></attribute>
  </plugin>
 

The script file name defaults to $HOME/xmlBlasterStartup.xml.

We use the LOCAL protocol driver to talk to xmlBlaster, therefor this plugin works only if the client and server is in the same virtual machine (JVM).

Since:
1.0.1
Author:
Marcel Ruff
See Also:
The admin.startupTasks requirement, The engine.runlevel.howto requirement, The client.script requirement

Field Summary
private  I_XmlBlasterAccess connection
           
private  ConnectQos connectQos
           
private  java.lang.String directoryName
           
private  boolean doConnect
           
private  boolean doDisconnect
           
private  Global global
           
private static java.util.logging.Logger log
           
private static java.lang.String ME
           
private  java.lang.String outFileName
           
private  PluginInfo pluginInfo
           
private  java.lang.String scriptFileName
           
private  java.net.URL scriptFileUrl
           
 
Constructor Summary
StartupTasks()
           
 
Method Summary
private  void excuteStartupTasks()
          On startup execute given script.
 java.lang.String getType()
           
 java.lang.String getVersion()
           
 void init(Global glob, PluginInfo pluginInfo)
          Initializes the plugin
 void shutdown()
          Shutdown the plugin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ME

private static final java.lang.String ME

pluginInfo

private PluginInfo pluginInfo

global

private Global global

log

private static java.util.logging.Logger log

connection

private I_XmlBlasterAccess connection

directoryName

private java.lang.String directoryName

scriptFileName

private java.lang.String scriptFileName

scriptFileUrl

private java.net.URL scriptFileUrl

outFileName

private java.lang.String outFileName

doConnect

private boolean doConnect

doDisconnect

private boolean doDisconnect

connectQos

private ConnectQos connectQos
Constructor Detail

StartupTasks

public StartupTasks()
Method Detail

init

public void init(Global glob,
                 PluginInfo pluginInfo)
          throws XmlBlasterException
Initializes the plugin

Specified by:
init in interface I_Plugin
Throws:
XmlBlasterException
See Also:
I_Plugin.init(org.xmlBlaster.util.Global, org.xmlBlaster.util.plugin.PluginInfo)

getType

public java.lang.String getType()
Specified by:
getType in interface I_Plugin
Returns:
the plugin type, defaults to "StartupTasks"
See Also:
I_Plugin.getType()

getVersion

public java.lang.String getVersion()
Specified by:
getVersion in interface I_Plugin
Returns:
the plugin version, defaults to "1.0"
See Also:
I_Plugin.getVersion()

shutdown

public void shutdown()
              throws XmlBlasterException
Shutdown the plugin

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.

See Also:
I_Plugin.shutdown()

excuteStartupTasks

private void excuteStartupTasks()
                         throws XmlBlasterException
On startup execute given script.

Throws:
XmlBlasterException

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.