XmlBlaster Logo

REQUIREMENT

admin.startupTasks

XmlBlaster Logo


Type NEW
Priority LOW
Status CLOSED
Topic On xmlBlaster startup you can execute a script for administrative tasks
Des
cription

The xmlBlaster plugin StartupTasks starts a given scripting file on xmlBlaster startup. You can for example register predefined topics on startup.

Example
ANY

StartupTasks

First activate the StartupTasks plugin in xmlBlasterPlugins.xml:

<plugin id='StartupTasks' className='org.xmlBlaster.engine.StartupTasks'>
   <action do='LOAD' onStartupRunlevel='7' sequence='5'
                        onFail='resource.configuration.pluginFailed'/>
   <action do='STOP' onShutdownRunlevel='6' sequence='5'/>
   <attribute id='loginName'>_StartupTasks</attribute>
   <attribute id='password'>secret</attribute>
   <attribute id='directoryName'></attribute>
   <attribute id='scriptFileName'>xmlBlasterStartup.xml</attribute>
   <attribute id='outFileName'>${java.io.tmpdir}${file.separator}xmlBlasterStartupOut.txt</attribute>
</plugin>
     

If the directoryName is missing or empty the classical xmlBlaster file lookup strategy is used, including looking into the CLASSPATH. For details read the util.property requirement.

The scripting file xmlBlasterStartup.xml must conform to the xmlBlaster scripting framework as described in requirement client.script, here is an example:

<xmlBlaster>
  <publish>
    <key oid="test"><airport name="london" /></key>
    <content>This is a simple script test</content>
    <qos/>
  </publish>
</xmlBlaster>
   

Note that you don't need to connect or disconnect explicitly as this is done by the plugin already.

Configure

These parameters allow to configure the error handling.

Property Default Description Impl
directoryName - The directory containing the script file given with scriptFileName. If directoryName is missing or empty the classical xmlBlaster file lookup strategy is used, including looking into the CLASSPATH. For details read the util.property requirement. yes
scriptFileName xmlBlasterStartup.xml The script to be executed yes
outFileName - If specified the output of the script is dumped to this file. If empty, the output is send to System.out. yes

NOTE: Configuration parameters are specified on command line (-someValue 17) or in the xmlBlaster.properties file (someValue=17). See requirement "util.property" for details.
Columns named Impl tells you if the feature is implemented.
Columns named Hot tells you if the configuration is changeable in hot operation.

Todo
See API org.xmlBlaster.engine.StartupTasks
See REQ client.script
See REQ util.property

This page is generated from the requirement XML file xmlBlaster/doc/requirements/admin.startupTasks.xml

Back to overview