<!--
# Name:      xmlBlasterPlugins.xml
# Project:   xmlBlaster.org
# Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
# Comment:   Plugins to load/unload on xmlBlaster startup/shutdown or with JMX (jconsole)
# See:       http://www.xmlblaster.org/xmlBlaster/doc/requirements/engine.runlevel.html
#            http://www.xmlBlaster.org/xmlBlaster/doc/requirements/engine.runlevel.howto.html
# Configure: Attributes added to plugins are used as default settings, see
#            http://www.xmlblaster.org/xmlBlaster/doc/requirements/util.property.env.html
#            You can activate/disactivate plugins with comments
#            or with the attribute create='true' or 'false'
# Replacement: Since xmlBlaster v2.2 attribute values with ${VARIABLEKEY} are replaced by
#            xmlBlaster.properties setting or command line argument or JVM environment setting if found.
#            If the key is not found, the key itself is used and a log.warning is written
#            You can switch replacement off with:
#            <attribute id='port' replace='false'>${socketPort}</attribute>
-->
<xmlBlaster>

   <!--========== SubscriptionPersistencePlugin =============-->
   <plugin create='true' id='subPersistence' className='org.xmlBlaster.engine.SessionPersistencePlugin'>
      <action do='LOAD' onStartupRunlevel='4' sequence='10' />
      <action do='STOP' onShutdownRunlevel='3' sequence='60'/>
   </plugin>

   <!--============= PROTOCOL PLUGINS ================-->
   <plugin create='true' id='SOCKET' className='org.xmlBlaster.protocol.socket.SocketDriver'>
      <action do='LOAD' onStartupRunlevel='4' sequence='20' 
              onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='3' sequence='50'/>   
      <!-- attribute id='port'>7607</attribute -->
      <attribute id='compress/type'></attribute>  <!-- Default: no compression for python,php,perl access -->
   </plugin>

   <!-- Example to start a second SOCKET plugin with different listener port -->
   <plugin create='false' id='SOCKET_UDP' className='org.xmlBlaster.protocol.socket.SocketDriver'>
      <action do='LOAD' onStartupRunlevel='4' sequence='20' 
              onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='3' sequence='50'/>   
      <attribute id='startUdpListener'>true</attribute>
      <attribute id='useUdpForOneway'>true</attribute>
      <attribute id='port'>7608</attribute>
      <attribute id='threadPrio'>3</attribute>
      <attribute id='compress/type'>zlib:stream</attribute>
   </plugin>

   <!-- Example to start a SOCKET plugin with compression support on different listener port -->
   <plugin create='false' id='socket_z' className='org.xmlBlaster.protocol.socket.SocketDriver'>
      <action do='LOAD' onStartupRunlevel='4' sequence='20' 
              onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='3' sequence='50'/>   
      <attribute id='port'>7606</attribute>
      <attribute id='compress/type'>zlib:stream</attribute>
   </plugin>

   <!-- Example to start a second SOCKET plugin with SSL and compression support on different listener port -->
   <!-- Read: http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html#SSL -->
   <plugin create='false' id='socket_ssl' className='org.xmlBlaster.protocol.socket.SocketDriver'>
      <action do='LOAD' onStartupRunlevel='4' sequence='20' 
              onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='3' sequence='50'/>   
      <attribute id='SSL'>true</attribute>
      <attribute id='trustStore'>testStore</attribute>
      <attribute id='trustStorePassword'>testtest</attribute>
      <attribute id='keyStore'>testStore</attribute>
      <attribute id='keyStorePassword'>testtest</attribute>
      <attribute id='findStoreInXmlBlasterSearchPath'>false</attribute>
      <attribute id='needClientAuth'>false</attribute>
      <attribute id='port'>7609</attribute>
      <attribute id='compress/type'>zlib:stream</attribute>
      <attribute id='startUdpListener'>false</attribute>
   </plugin>

   <!-- Example to use the XML script parser with raw socket delivery (to easy develop php,python,perl,... access) -->
   <!-- Read: http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.socket.html#script -->
   <plugin create='false' id='socket_script' className='org.xmlBlaster.protocol.socket.SocketDriver'>
      <action do='LOAD' onStartupRunlevel='4' sequence='20' 
              onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='3' sequence='50'/>   
      <attribute id='compress/type'></attribute>
      <attribute id='isNullTerminated'>true</attribute>
      <attribute id='parserClass'>org.xmlBlaster.util.xbformat.XmlScriptParser</attribute>
      <attribute id='port'>7601</attribute>
   </plugin>

   <!-- ProtocolPlugin[IOR][1.0]=org.xmlBlaster.protocol.corba.CorbaDriver -->
   <plugin create='false' id='IOR' className='org.xmlBlaster.protocol.corba.CorbaDriver'>
      <action do='LOAD' onStartupRunlevel='4' sequence='30'
              onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='3' sequence='40'/>   
   </plugin>

   <!-- ProtocolPlugin[STOMP][1.0] for iPad and iPhone, port: 61613 -->
   <plugin create='false' id='STOMP' className='org.xmlBlaster.protocol.stomp.XbStompDriver'>
      <action do='LOAD' onStartupRunlevel='4' sequence='35'
              onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='3' sequence='35'/>
      <attribute id='port'>61613</attribute>
   </plugin>

   <!-- ProtocolPlugin[XMLRPC][1.0]=org.xmlBlaster.protocol.xmlrpc.XmlRpcDriver -->
   <plugin create='true' id='XMLRPC' className='org.xmlBlaster.protocol.xmlrpc.XmlRpcDriver'>
      <action do='LOAD' onStartupRunlevel='4' sequence='40'/> 
      <action do='STOP' onShutdownRunlevel='3' sequence='30'/>   
   </plugin>

   <!-- ProtocolPlugin[RMI][1.0]=org.xmlBlaster.protocol.rmi.RmiDriver -->
<!--
   <plugin create='true' id='RMI' className='org.xmlBlaster.protocol.rmi.RmiDriver'>
      <action do='LOAD' onStartupRunlevel='4' sequence='50' />
      <action do='STOP' onShutdownRunlevel='3' sequence='20'/>   
   </plugin>
-->

   <!-- General EMAIL SMTP client service, see http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.email.html -->
   <!-- needed by 'email' plugin and 'CbProtocolPlugin[email][1.0]' plugin -->
   <plugin create='false' id='smtp' className='org.xmlBlaster.util.protocol.email.SmtpClient'>
      <action do='LOAD' onStartupRunlevel='4' sequence='7' 
              onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='4' sequence='9'/>
      <attribute id='mail.smtp.timeout'>3600000</attribute> <!-- 1 h -->
      <attribute id='mail.smtp.connectiontimeout'>600000</attribute> <!-- 10 min -->
      <attribute id='mail.smtp.url'>smtp://xmlBlaster:xmlBlaster@localhost:25</attribute>
   </plugin>

   <!-- General EMAIL POP3 polling service, see http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.email.html -->
   <!-- needed by 'email' plugin and 'CbProtocolPlugin[email][1.0]' plugin -->
   <plugin create='false' id='pop3' className='org.xmlBlaster.util.protocol.email.Pop3Driver'>
      <action do='LOAD' onStartupRunlevel='4' sequence='9' 
              onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='4' sequence='7'/>   
      <attribute id='mail.pop3.url'>pop3://xmlBlaster:xmlBlaster@localhost:110/INBOX</attribute>
      <attribute id='pop3PollingInterval'>500</attribute>
   </plugin>

   <!-- EMAIL protocol driver (please activate 'pop3' and 'smtp' service at an earlier runlevel) -->
   <!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/protocol.email.html -->
   <plugin create='false' id='email' className='org.xmlBlaster.protocol.email.EmailDriver'>
      <action do='LOAD' onStartupRunlevel='7' sequence='10' 
              onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='7' sequence='10'/>
      <attribute id='mail.smtp.from'>xmlBlaster@localhost</attribute>   
      <attribute id='compress/type'>zlib</attribute>
      <attribute id='compress/minSize'>2000</attribute>
      <attribute id='parserClass'>org.xmlBlaster.util.xbformat.XmlScriptParser</attribute>
      <attribute id='mail.subject'>XmlBlaster generated mail</attribute>
   </plugin>

   <!-- The cluster manager must be started after the protocol plugins it wants to use for communication -->
   <plugin create='true' id='cluster' className='org.xmlBlaster.engine.cluster.ClusterManager'>
      <action do='LOAD' onStartupRunlevel='5' sequence='5' />
      <action do='STOP' onShutdownRunlevel='4' sequence='5'/>   
   </plugin>

   <!-- See demo plugin xmlBlaster/demo/javaclients/HelloWorldNative.java -->
   <plugin create='false' id='HelloWorldNative' className='javaclients.HelloWorldNative'>
      <action do='LOAD' onStartupRunlevel='9' sequence='5' onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='6' sequence='4'/>
   </plugin>

   <!-- See demo plugin xmlBlaster/demo/javaclients/HelloWorldNative2.java -->
   <plugin create='false' id='HelloWorldNative2' className='javaclients.HelloWorldNative2'>
      <attribute id='loginName'>nativeClient2</attribute>
      <attribute id='topicName'>aNativeTopic2</attribute>
      <action do='LOAD' onStartupRunlevel='9' sequence='6' onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='6' sequence='5'/>
   </plugin>

<!--
   <plugin create='true' id='SOAP' className='org.xmlBlaster.protocol.soap.SoapDriver'>
      <attribute id='classpath'>soap/jdom.jar:soap/log4j-core.jar:soap/log4j.jar:soap/saw.jar:soap/soap.jar:soap/xerces.jar</attribute>
      <action do='LOAD' onStartupRunlevel='3' sequence='6' 
              onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='2' sequence='6'/>   
   </plugin>
-->
   <!--===============================================-->


   <!--========== NATIVE SERVICE PLUGINS =============-->

   <!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/admin.jmx.html#mx4j -->
   <!-- Comment out the xsltProcessor attribute to receive the raw xml for debugging -->
   <!-- Start  java org.xmlBlaster.Main -xmlBlaster/jmx/HtmlAdaptor true -->
   <plugin create='false' id='MX4JAdaptorPlugin' className='org.xmlBlaster.contrib.jmx.MX4JAdaptor'>
      <attribute id="xsltProcessor">XSLTProcessor</attribute>
      <attribute id="host">localhost</attribute>
      <attribute id="port">9999</attribute>
      <attribute id="adaptorName">HttpAdaptorMX4J</attribute>
      <attribute id="xsltPath">org/xmlBlaster/contrib/replication/monitor</attribute>
      <attribute  id="xsltCache">false</attribute>
      <attribute id="authenticationMethod">basic</attribute>
      <attribute id="replication.monitor.user.user">somepwd:user</attribute>
      <attribute id="replication.monitor.user.initiator">otherpwd:initiator</attribute>
      <attribute id="replication.monitor.user.admin">importantpwd:admin</attribute>

      <action do='LOAD' onStartupRunlevel='4' sequence='4' onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='3' sequence='66'/>
   </plugin>
      <!-- <attribute id="xsltPathInJar"></attribute>  -->
      <!-- <attribute id="xsltLocale"></attribute> -->

   <!-- REPLICATION MANAGER PLUGIN http://www.xmlblaster.org/xmlBlaster/doc/requirements/contrib.replication.html -->
   <plugin create='false' id='ReplManagerPlugin' className='org.xmlBlaster.contrib.replication.impl.ReplManagerPlugin'>
      <action do='LOAD' onStartupRunlevel='4' sequence='5' onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='3' sequence='65'/>
   </plugin>

   <!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/admin.checkpoint.html -->
   <plugin create='false' id='Checkpoint' className='org.xmlBlaster.util.checkpoint.Checkpoint'>
      <action do='LOAD' onStartupRunlevel='1' sequence='1'
                           onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='0' sequence='1'/>
      <attribute id='filterClientPropertyKey'>wfguid</attribute>
      <attribute id='showAllMessages'>true</attribute>
      <attribute id='excludeIfClientPropertyKey'></attribute>
      <attribute id='xmlStyle'>true</attribute>
      <attribute id='showAllClientProperties'>false</attribute>
      <attribute id='log4j.configuration'>log4j.properties</attribute>
      <attribute id='log4j.debug'>false</attribute>
   </plugin>

   <!-- ProtocolPlugin[JDBC][1.0]=org.xmlBlaster.protocol.jdbc.JdbcDriver -->
   <plugin create='true' id='JDBC' className='org.xmlBlaster.protocol.jdbc.JdbcDriver'>
      <action do='LOAD' onStartupRunlevel='5' sequence='5' />
      <action do='STOP' onShutdownRunlevel='4' sequence='1'/>   
   </plugin>

   <!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/admin.errorHandling.html -->
   <plugin create='false' id='DeadMessageDumper' className='org.xmlBlaster.engine.DeadMessageDumper'>
      <action do='LOAD' onStartupRunlevel='5' sequence='4' onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='4' sequence='4'/>
      <attribute id='loginName'>_DeadMessageDumper</attribute>
      <attribute id='directoryName'>${java.io.tmpdir}${file.separator}xmlBlaster-deadMessages</attribute>
      <attribute id='password'>secret</attribute>
      <attribute id='forceBase64'>false</attribute>
   </plugin>

   <!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/admin.events.html -->
   <plugin create='false' id='coreEvents' className='org.xmlBlaster.engine.EventPlugin'>
      <action do='LOAD' onStartupRunlevel='8' sequence='4'/>
      <action do='STOP' onShutdownRunlevel='7' sequence='4'/>
      <attribute id='eventTypes'>
         logging/severe/*,
         logging/warning/*,
         service/RunlevelManager/event/startupRunlevel9,
         service/RunlevelManager/event/shutdownRunlevel8
      </attribute>
      <attribute id='destination.smtp'>
         mail.smtp.from=xmlBlaster@localhost,
         mail.smtp.to=demo@localhost,
         mail.collectMillis=360000
      </attribute>
   </plugin>

   <!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/admin.events.html -->
   <!-- Small and only the most important. Useful if email is forwarded as SMS -->
   <!-- Configure the SmtpClient plugin on an earlier run level as well -->
   <plugin create='false' id='smallEmergencyEvents' className='org.xmlBlaster.engine.EventPlugin'>
      <action do='LOAD' onStartupRunlevel='8' sequence='9'/>
      <action do='STOP' onShutdownRunlevel='7' sequence='9'/>
      <attribute id='eventTypes'>logging/severe/*,service/RunlevelManager/event/shutdownRunlevel8</attribute>
      <attribute id='destination.smtp'>
         mail.subject=[XmlBlaster event: $_{eventType}] $_{nodeId},
         mail.content=$_{datetime} $_{id} $_{errorCode} $_{summary},
         mail.contentSeparator=${line.separator}${line.separator},
         mail.smtp.from=xmlBlaster@somecompany.com,
         mail.smtp.to=admin@somecompany.com,
         "mail.smtp.cc=xmlBlaster@et.universe,somebody@somewhere.xx",
         mail.collectMillis=360000
      </attribute>
   </plugin>

   <!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/admin.events.html -->
   <!-- Send an XML formatted heartbeat email, one per day -->
   <plugin create='false' id='heartbeatEvents' className='org.xmlBlaster.engine.EventPlugin'>
      <action do='LOAD' onStartupRunlevel='8' sequence='4'/>
      <action do='STOP' onShutdownRunlevel='7' sequence='4'/>
      <attribute id='eventTypes'>
         heartbeat.72000000,
         logging/severe/*,
         service/RunlevelManager/event/shutdownRunlevel8
      </attribute>
      <attribute id='destination.smtp'>
         mail.smtp.from=xmlBlaster@localhost,
         mail.smtp.to=demo@localhost,
         mail.content=$_{xml},
         mail.collectMillis=0
      </attribute>
   </plugin>

   <!-- In cluster environment only: Observes the client connection status of cluster slaves -->
   <plugin create='false' id='clusterEvents' className='org.xmlBlaster.engine.EventPlugin'>
      <action do='LOAD' onStartupRunlevel='8' sequence='4'/>
      <action do='STOP' onShutdownRunlevel='7' sequence='4'/>
      <attribute id='eventTypes'>
         client/*/session/1/event/connectionState
      </attribute>
      <attribute id='destination.smtp'>
         mail.subject=[XmlBlaster event: $_{eventType}] $_{nodeId} - $_{clusterId},
         mail.smtp.from=xmlBlaster@localhost,
         mail.smtp.to=demo@localhost,
         mail.collectMillis=2000
      </attribute>
   </plugin>

   <!-- Get event before a callback queue runs full -->
   <!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/admin.events.html -->
   <plugin create='false' id='thresholdEventsCbQueue' className='org.xmlBlaster.engine.EventPlugin'>
      <action do='LOAD' onStartupRunlevel='8' sequence='4'/>
      <action do='STOP' onShutdownRunlevel='7' sequence='4'/>
      <attribute id='eventTypes'>client/*/session/*/queue/callback/event/threshold.90%</attribute>
      <attribute id='destination.publish'>
         "publish.key=<key oid='__queueFillingUp'><__sys__internal/></key>",
         "publish.qos=<qos><expiration lifeTime='0'/><topic destroyDelay='30000'><persistence relating='msgUnitStore' type='RAM'/><queue relating='history' type='RAM'/></topic></qos>"
      </attribute>
   </plugin>

   <!-- Get event before a msgUnitStore runs full -->
   <!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/admin.events.html -->
   <plugin create='false' id='thresholdEventsMsgUnitStore' className='org.xmlBlaster.engine.EventPlugin'>
      <action do='LOAD' onStartupRunlevel='8' sequence='4'/>
      <action do='STOP' onShutdownRunlevel='7' sequence='4'/>
      <attribute id='eventTypes'>topic/*/persistence/msgUnitStore/event/threshold.80%</attribute>
      <attribute id='destination.publish'>
         "publish.key=<key oid='__msgUnitStoreFillingUp'><__sys__internal/></key>",
         "publish.qos=<qos><expiration lifeTime='0'/><topic destroyDelay='30000'><persistence relating='msgUnitStore' type='RAM'/><queue relating='history' type='RAM'/></topic></qos>"
      </attribute>
   </plugin>

   <!-- Get event when a client logs in, send to topic '__sys__Login' -->
   <!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/admin.events.html -->
   <plugin create='false' id='connectEvent' className='org.xmlBlaster.engine.EventPlugin'>
      <action do='LOAD' onStartupRunlevel='8' sequence='4'/>
      <action do='STOP' onShutdownRunlevel='7' sequence='4'/>
      <attribute id='eventTypes'>client/*/session/*/event/connect</attribute>
      <attribute id='destination.publish'>
         "publish.key=<key oid='__sys__Login'><__sys__internal/></key>",
         "publish.qos=<qos><expiration lifeTime='0'/><topic destroyDelay='30000'><persistence relating='msgUnitStore' type='RAM'/><queue relating='history' type='RAM'/></topic></qos>"
      </attribute>
   </plugin>

   <!-- Get event when a client logs out, send to topic '__sys__Logout' -->
   <!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/admin.events.html -->
   <plugin create='false' id='disconnectEvent' className='org.xmlBlaster.engine.EventPlugin'>
      <action do='LOAD' onStartupRunlevel='8' sequence='4'/>
      <action do='STOP' onShutdownRunlevel='7' sequence='4'/>
      <attribute id='eventTypes'>client/*/session/*/event/disconnect</attribute>
      <attribute id='destination.publish'>
         "publish.key=<key oid='__sys__Logout'><__sys__internal/></key>",
         "publish.qos=<qos><expiration lifeTime='0'/><topic destroyDelay='30000'><persistence relating='msgUnitStore' type='RAM'/><queue relating='history' type='RAM'/></topic></qos>"
      </attribute>
   </plugin>

   <!-- Get event when a client logs in or out, send comma separated list of login names to topic '__sys__UserList' -->
   <!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/admin.events.html -->
   <plugin create='false' id='clientListEvent' className='org.xmlBlaster.engine.EventPlugin'>
      <action do='LOAD' onStartupRunlevel='8' sequence='4'/>
      <action do='STOP' onShutdownRunlevel='7' sequence='4'/>
      <attribute id='eventTypes'>client/*/session/*/event/connect,client/*/session/*/event/disconnect</attribute>
      <attribute id='destination.publish'>
         "publish.key=<key oid='__sys__UserList'><__sys__internal/></key>",
         "publish.content=$_{clientList}",
         "publish.qos=<qos><expiration lifeTime='0'/><topic destroyDelay='30000'><persistence relating='msgUnitStore' type='RAM'/><queue relating='history' type='RAM'/></topic></qos>"
      </attribute>
   </plugin>

   <!-- Get event when a clients susbcribe/unSubscribe on all topics, send to topic '__sys__Subscribe' -->
   <!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/admin.events.html -->
   <plugin create='false' id='subscriptionSpecificEvents' className='org.xmlBlaster.engine.EventPlugin'>
      <action do='LOAD' onStartupRunlevel='8' sequence='4'/>
      <action do='STOP' onShutdownRunlevel='7' sequence='4'/>
      <attribute id='eventTypes'>topic/*/event/subscribe,topic/*/event/unSubscribe</attribute>
      <attribute id='destination.publish'>
         "publish.key=<key oid='__sys__Subscribe'><__sys__internal/></key>",
         "publish.qos=<qos><expiration lifeTime='0'/><topic destroyDelay='30000'><persistence relating='msgUnitStore' type='RAM'/><queue relating='history' type='RAM'/></topic></qos>"
      </attribute>
   </plugin>

   <!--
   Example which executes a shell command 
   Attributes:
        String "command"           : for example "cmd /c dir"
        String[] "envp" optionally : for example "user:jack;amount:200" will produce environment variable user=jack and amount=200
        execution "dir" optionally : for example "/home/xmlblaster"
        activationDelayAfterStartupSec optionally: for example 30 to wait 30 seconds after plugin creation to get active
        "waitFor" defaults to false: If set to true the xmlBlaster executing thread blocks during command execution and stdout/stderr are displayed synchronously
   Example /tmp/dummy.sh (the echo is shown in the xmlBlaster logging output)
	#!/bin/bash
	echo "$0 is executing ..."
	rm /tmp/dummy.txt
	echo "my name is $0" >> /tmp/dummy.txt
	echo "execution dir is `pwd`" >> /tmp/dummy.txt
	echo "waitFor is $waitFor" >> /tmp/dummy.txt
	echo "summary is $summary" >> /tmp/dummy.txt
	echo "description is $description" >> /tmp/dummy.txt
	echo "eventType is $eventType" >> /tmp/dummy.txt
	echo "errorCode is $errorCode" >> /tmp/dummy.txt
	echo "sessionName is $sessionName" >> /tmp/dummy.txt
	# jvmPid is known to work with SUN JVM and Linux, others are not tested
	echo "The JVM parent PID is $jvmPid" >> /tmp/dummy.txt
	echo "KEY1 is $KEY1" >> /tmp/dummy.txt
	echo "KEY2 is $KEY2" >> /tmp/dummy.txt
	if [[ "$KEY1" == "killMe" && "$jvmPid" != "" ]]; then
	   echo "we kill the parent Java machine $jvmPid after $1 seconds" >> /tmp/dummy.txt
	   sleep $1
	   echo "killing now the parent Java machine $jvmPid" >> /tmp/dummy.txt
	   echo "Bye parent, KEY1=$KEY1"
	   kill $jvmPid
	else
	   echo "my sleep argument is $1, we are sleeping now for $1 seconds ..." >> /tmp/dummy.txt
	   sleep $1
	   echo "we are done, bye" >> /tmp/dummy.txt
	fi
	echo "Bye"
	exit 0
   -->
   <plugin create='false' id='execEvents' className='org.xmlBlaster.engine.EventPlugin'>
      <action do='LOAD' onStartupRunlevel='8' sequence='4'/>
      <action do='STOP' onShutdownRunlevel='7' sequence='4'/>
      <attribute id='eventTypes'>
         service/RunlevelManager/event/startupRunlevel9,
         service/RunlevelManager/event/shutdownRunlevel8
      </attribute>
      <attribute id='destination.exec'>
         command=/bin/bash /tmp/dummy.sh 3,
	 envp=KEY1:killMe;KEY2:theValue2,
	 dir=/tmp,
         waitFor=false
      </attribute>
   </plugin>

   <!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/admin.startupTasks.html -->
   <plugin create='false' id='StartupTasks' className='org.xmlBlaster.engine.StartupTasks'>
      <action do='LOAD' onStartupRunlevel='6' sequence='5'
                           onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='5' sequence='5'/>
      <attribute id='loginName'>_StartupTasks</attribute>
      <attribute id='password'>secret</attribute>
      <attribute id='doConnect'>true</attribute>
      <attribute id='doDisconnect'>true</attribute>
      <attribute id='directoryName'></attribute>
      <attribute id='scriptFileName'>xmlBlasterStartup.xml</attribute>
      <attribute id='outFileName'>${java.io.tmpdir}${file.separator}xmlBlasterStartupOut.txt</attribute>
   </plugin>

   <!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/contrib.filewatcher.html -->
   <plugin create="false" id='FileWatcherPlugin' className='org.xmlBlaster.contrib.filewatcher.FileWatcherPlugin'>
      <attribute id='filewatcher.directoryName'>/tmp/fileWatcher</attribute>
      <attribute id='mom.topicName'>watcher.test</attribute>
      <attribute id='mom.publishKey'><key oid='watcher.test'><watcher><test/></watcher></key></attribute>
      <attribute id='mom.publishQos'><qos><persistent/></qos></attribute>
      <attribute id='mom.loginName'>watcher01/1</attribute>
      <attribute id='mom.password'>secret</attribute>
      <attribute id='filewatcher.maximumFileSize'>1000000000</attribute>
      <attribute id='filewatcher.maximumChunkSize'>2560000</attribute>
      <attribute id='filewatcher.delaySinceLastFileChange'>30000</attribute>
      <attribute id='filewatcher.pollInterval'>2000</attribute>
      <attribute id='filewatcher.sent'>Sent</attribute>
      <attribute id='filewatcher.discarded'>Discarded</attribute>
      <attribute id='filewatcher.lockExtention'>*.lck</attribute>
      <attribute id='filewatcher.filterType'>simple</attribute>
      <attribute id='replication.prefix'>files</attribute>
      <attribute id='replication.version'>0.5</attribute>
      <attribute id='replication.countSingleMsg'>true</attribute>
      <action do='LOAD' onStartupRunlevel='9' sequence='6' onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='8' sequence='5'/>
</plugin>

<!-- This is the counterpart of the filewatcher plugin -->
<plugin create="false" id='FileWriter' className='org.xmlBlaster.contrib.filewriter.FileWriter'>
      <attribute id='mom.administered'>true</attribute>
      <attribute id='mom.loginName'>writer01/1</attribute>
      <attribute id='mom.password'>secret</attribute>
      <attribute id='filewriter.directoryName'>${user.home}/writerDirName</attribute>
      <attribute id='filewriter.tmpDirectoryName'>${user.home}/writerDirName/tmp</attribute>
      <attribute id='filewriter.overwrite'>true</attribute>
      <attribute id='filewriter.lockExtention'>.lck</attribute>
      <!--      <attribute id='__useNativeCfg'>false</attribute> -->
      <action do='LOAD' onStartupRunlevel='9' sequence='4' onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='8' sequence='6'/>
</plugin>

<!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/contrib.scheduler.html -->
<plugin create='false' id='SchedulerPlugin' className='org.xmlBlaster.contrib.scheduler.SchedulerPlugin'>
      <!-- The given class must implement org.quartz.Job, syntax see http://www.opensymphony.com/quartz/ -->
      <!--
      <attribute id="scheduler.open0">0 0 1 MON * org.xmlBlaster.contrib.replication.impl.ReplManagerPlugin startDispatcher</attribute>
      <attribute id="scheduler.close0">0 0 1 MON * org.xmlBlaster.contrib.replication.impl.ReplManagerPlugin stopDispatcher</attribute>
      -->
      <attribute id="scheduler.close">02 * * * * org.xmlBlaster.contrib.replication.impl.ReplManagerPlugin stopDispatcher</attribute>
      <attribute id="scheduler.open">03 * * * * org.xmlBlaster.contrib.replication.impl.ReplManagerPlugin startDispatcher</attribute>
      <action do='LOAD' onStartupRunlevel='9' sequence='10' onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='8' sequence='1'/>
</plugin>

<!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/contrib.dbwatcher.html -->
   <plugin create='false' id='DbWatcherPlugin.testPollMD5' 
           className='org.xmlBlaster.contrib.dbwatcher.plugin.DbWatcherPlugin'>
      <attribute id='jdbc.drivers'>oracle.jdbc.driver.OracleDriver</attribute>
      <attribute id='db.url'>jdbc:oracle:thin:@localhost:1521:orcl</attribute>
      <attribute id='db.user'>system</attribute>
      <attribute id='db.password'>secret</attribute>
      <attribute id='mom.loginName'>DbWatcherPlugin.testPoll/1</attribute>
      <attribute id='mom.topicName'>db.test_poll.event.${groupColValue}</attribute>
      <attribute id='alertScheduler.pollInterval'>2000</attribute>
      <attribute id='changeDetector.class'>
         org.xmlBlaster.contrib.dbwatcher.detector.MD5ChangeDetector
      </attribute>
      <attribute id='changeDetector.groupColName'>CAR</attribute>
      <attribute id='changeDetector.detectStatement'>
         SELECT color, car from TEST_POLL order by CAR
      </attribute>
         <attribute id='db.queryMeatStatement'>
         SELECT * FROM TEST_POLL WHERE CAR = '${groupColValue}'
      </attribute>
      <attribute id='mom.eraseOnDelete'>true</attribute>
      <attribute id='mom.eraseOnDrop'>true</attribute>
      <action do='LOAD' onStartupRunlevel='6' sequence='6'
                 onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='5' sequence='6'/>
   </plugin>

   <!-- See xmlBlaster/src/java/org/xmlBlaster/contrib/filewriter/Receiver.java -->
   <plugin create='false' id='FileWriter' 
           className='org.xmlBlaster.contrib.filewriter.Receiver'>
      <attribute id='mom.topicName'>file.writer</attribute>
      <!-- attribute id='mom.loginName'>FileWriter/1</attribute> -->
      <attribute id='connectQos'><![CDATA[
           <qos>
              <securityService type='htpasswd' version='1.0'>
                <user>FileWriter</user>
                <passwd>secret</passwd>
              </securityService>
              <session name='client/FileWriter/session/1' timeout='0' maxSessions='1'
                          clearSessions='true' reconnectSameClientOnly='false'/>
           </qos>
           ]]>
      </attribute>
      <attribute id='directoryName'>${user.home}${file.separator}J2meTestResults</attribute>
      <action do='LOAD' onStartupRunlevel='6' sequence='6'
                 onFail='resource.configuration.pluginFailed'/>
      <action do='STOP' onShutdownRunlevel='5' sequence='6'/>
   </plugin>

   <!-- See http://www.xmlblaster.org/xmlBlaster/doc/requirements/admin.http.html -->
   <plugin create='true' id='HtmlMonitorPlugin.default' className='org.xmlBlaster.contrib.htmlmonitor.HtmlMonitorPlugin'>
      <attribute id='documentRoot'>${user.home}${file.separator}html</attribute>
      <attribute id='urlPath'>/monitor</attribute>
      <attribute id='urlPath.CLASSPATH'>/status.html</attribute>
      <action do='LOAD' onStartupRunlevel='9' sequence='6' onFail=''/>
      <action do='STOP' onShutdownRunlevel='6' sequence='5'/>
   </plugin>
   <!--===============================================-->


   <!--========== DISPATCHER PLUGINS =================-->
   <plugin create='true' id='dispatchPriority'
           className='org.xmlBlaster.util.dispatch.plugins.prio.PriorizedDispatchPlugin'
           jar='/tmp/my.jar'>
      <attribute id='config'>
         <![CDATA[
         <msgDispatch defaultStatus='64k' defaultAction='send'>
         <onStatus oid='_bandwidth.status' content='64k' defaultAction='destroy'>
            <action do='send'  ifPriority='7-9'/>
            <action do='queue'  ifPriority='2-6'/>
         </onStatus>
         <onStatus oid='_bandwidth.status' content='2M'>
            <action do='send'  ifPriority='0-9'/>
         </onStatus>
         </msgDispatch>
         ]]>
      </attribute>
   </plugin>
   <!--===============================================-->

</xmlBlaster>

