xmlBlaster 2.2.0 API

org.xmlBlaster.engine.runlevel
Class PluginHolder

java.lang.Object
  extended by org.xmlBlaster.engine.runlevel.PluginHolder

public class PluginHolder
extends java.lang.Object

This class contains the information on how to configure a certain plugin and when a certain plugin is invoked by the run level manager

Author:
Michele Laghi, Marcel Ruff
See Also:
engine.runlevel requirement

  <plugin id='storage:CACHE' className='org.xmlBlaster.engine.msgstore.cache.PersistenceCachePlugin'>
     <attribute id='transientQueue'>storage:RAM</attribute>
     <attribute id='persistentQueue'>storage:JDBC</attribute>
  </plugin>

 

Field Summary
private  Global glob
           
private static java.util.logging.Logger log
           
private  java.util.Hashtable pluginConfigsDefault
           
private  java.util.Hashtable pluginConfigsNodes
          This is a double Hashtable: an Hashtable containing one hashtable for every node found.
 
Constructor Summary
PluginHolder(Global glob)
          Minimal constructor
PluginHolder(Global glob, java.util.Hashtable pluginConfigsDefault, java.util.Hashtable pluginConfigsNodes)
          This constructor takes all parameters needed
 
Method Summary
 PluginConfig addDefaultPluginConfig(PluginConfig pluginConfig)
           
 PluginConfig addPluginConfig(java.lang.String node, PluginConfig pluginConfig)
          Adds a pluginConfig object to the specified node.
 PluginConfig[] getAllPluginConfig(java.lang.String node)
          returns all PluginConfig found for the specified node (and the default)
 PluginConfig getPluginConfig(java.lang.String node, java.lang.String id)
          returns the plugin specified with the given id and the given node.
 java.util.TreeSet getShutdownSequence(java.lang.String nodeId, int lowRunlevel, int highRunlevel)
          Returns a hashset containing all plugins which have a shutdown level defined.
 java.util.TreeSet getStartupSequence(java.lang.String nodeId, int lowRunlevel, int highRunlevel)
          Returns a hashset containing all plugins which have a startup level defined.
 PluginConfig removePluginConfig(java.lang.String node, java.lang.String id)
          Remove the given pluginConfig instance.
 java.lang.String toXml()
           
 java.lang.String toXml(java.lang.String extraOffset)
          returns an xml litteral string representing all entries found in the configuration file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

glob

private final Global glob

log

private static java.util.logging.Logger log

pluginConfigsDefault

private java.util.Hashtable pluginConfigsDefault

pluginConfigsNodes

private java.util.Hashtable pluginConfigsNodes
This is a double Hashtable: an Hashtable containing one hashtable for every node found. Every one of these node specific Hashtables contains all PluginConfig objects defined in the corresponding node section.

Constructor Detail

PluginHolder

public PluginHolder(Global glob,
                    java.util.Hashtable pluginConfigsDefault,
                    java.util.Hashtable pluginConfigsNodes)
This constructor takes all parameters needed


PluginHolder

public PluginHolder(Global glob)
Minimal constructor

Method Detail

addDefaultPluginConfig

public PluginConfig addDefaultPluginConfig(PluginConfig pluginConfig)
Returns:
The previous one or null

addPluginConfig

public PluginConfig addPluginConfig(java.lang.String node,
                                    PluginConfig pluginConfig)
Adds a pluginConfig object to the specified node.

If node is null it is put to default scope.

Parameters:
node - the node to which to add the pluginConfig object
pluginConfig - the object to add to the holder.
Returns:
The previous one or null

getPluginConfig

public PluginConfig getPluginConfig(java.lang.String node,
                                    java.lang.String id)
returns the plugin specified with the given id and the given node. If a plugin configuration is not found in the specified node, then it is searched in the defaults. If none is found there either, then a null is returned.

Parameters:
node - the nodeId scope on which to do the request or null
id - the unique string identifying the plugin

removePluginConfig

public PluginConfig removePluginConfig(java.lang.String node,
                                       java.lang.String id)
Remove the given pluginConfig instance.

Parameters:
node -
id -
Returns:
Can be null if not found

getAllPluginConfig

public PluginConfig[] getAllPluginConfig(java.lang.String node)
returns all PluginConfig found for the specified node (and the default)

Parameters:
node - the node for which to search.

toXml

public java.lang.String toXml(java.lang.String extraOffset)
returns an xml litteral string representing all entries found in the configuration file.


toXml

public java.lang.String toXml()

getStartupSequence

public java.util.TreeSet getStartupSequence(java.lang.String nodeId,
                                            int lowRunlevel,
                                            int highRunlevel)
Returns a hashset containing all plugins which have a startup level defined. The returns are already in the right sequence.

Parameters:
nodeId - the id of the node to retrieve
lowRunlevel - the runlevel from which to start retreive (inclusive)
highRunlevel - the runlevel to which to retrieve (inclusive)

getShutdownSequence

public java.util.TreeSet getShutdownSequence(java.lang.String nodeId,
                                             int lowRunlevel,
                                             int highRunlevel)
Returns a hashset containing all plugins which have a shutdown level defined. The returns are already in the right sequence.

Parameters:
nodeId - the id of the node to retrieve
lowRunlevel - the runlevel from which to start retreive (inclusive)
highRunlevel - the runlevel to which to retrieve (inclusive)

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.