xmlBlaster 2.2.0 API

org.xmlBlaster.engine.runlevel
Class PluginConfig

java.lang.Object
  extended by org.xmlBlaster.engine.runlevel.PluginConfig
All Implemented Interfaces:
PluginConfigMBean, I_AdminUsage, I_AttributeUser

public class PluginConfig
extends java.lang.Object
implements PluginConfigMBean, I_AttributeUser

This class contains the information on how to configure a certain pluginand 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  java.util.Vector actions
           
private  java.util.Properties attributes
          the properties for the plugin
private  java.lang.String className
          the complete class name for the plugin to be loaded
private  ContextNode contextNode
           
private  boolean create
          Shall this plugin be instantiated?
static boolean DEFAULT_CREATE
           
private  RunLevelAction downAction
          stores the action for the down going run level (if none it will be null)
private  Global glob
           
private  java.lang.String id
          the id specifying a given plugin configuration
private  java.lang.String jarPath
          the coloumn separated list of jar files on which to look for the class
private static java.util.logging.Logger log
           
private  JmxMBeanHandle mbeanHandle
          My JMX registration
(package private)  Timestamp uniqueTimestamp
          timestamp used to get uniquity (since runlevel + sequeuence is not unique)
private  RunLevelAction upAction
          stores the action for the upgoing run level (if none it will be null)
private  java.util.HashSet wrappedAttributes
           
 
Constructor Summary
PluginConfig(Global glob)
          Really minimal constructor
PluginConfig(Global glob, java.lang.String id, boolean create, java.lang.String className)
          Minimal constructor
PluginConfig(Global glob, java.lang.String id, boolean create, java.lang.String className, java.util.Properties attributes)
          Construtor where we can define attributes (no need to define actions)
PluginConfig(Global glob, java.lang.String id, boolean create, java.lang.String className, java.lang.String jar, java.util.Properties attributes, java.util.Vector actions)
          This constructor takes all parameters needed
 
Method Summary
 void addAction(RunLevelAction action)
           
 void addAttribute(java.lang.String key, java.lang.String value)
           
 void addAttribute(java.lang.String key, java.lang.String value, boolean replacePlaceHolder)
           
 RunLevelAction[] getActions()
           
 java.lang.String getClassName()
           
 RunLevelAction getDownAction()
           
 java.lang.String getId()
           
 PluginInfo getPluginInfo()
          returns the PluginInfo object out of this configuration
 RunLevelAction getUpAction()
           
 java.lang.String getUsageUrl()
           
 boolean isCreate()
          Shall the plugin be created?
 void registerMBean()
           
 void setClassName(java.lang.String className)
           
 void setCreate(boolean create)
          Shall the plugin be created?
Called from JMX (jconsole)
 void setCreateInternal(boolean create)
          Shall the plugin be created?
Called from SAX parser
 void setId(java.lang.String id)
           
 void setJar(java.lang.String jar)
           
 void setUsageUrl(java.lang.String url)
           
 void shutdown()
           
 java.lang.String toString()
           
 java.lang.String toXml()
           
 java.lang.String toXml(java.lang.String extraOffset)
          returns an xml litteral string representing this object.
 void unwrapAttributeFromCDATA(java.lang.String attributeKey)
          When the attribute is written to a string in the toXml methods it is wrapped inside a CDATA.
 java.lang.String usage()
           
 void wrapAttributeInCDATA(java.lang.String attributeKey)
          When the attribute is written to a string in the toXml methods it is wrapped inside a CDATA in case you pass 'true' here.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

glob

private final Global glob

log

private static java.util.logging.Logger log

id

private java.lang.String id
the id specifying a given plugin configuration


className

private java.lang.String className
the complete class name for the plugin to be loaded


DEFAULT_CREATE

public static boolean DEFAULT_CREATE

create

private boolean create
Shall this plugin be instantiated?


jarPath

private java.lang.String jarPath
the coloumn separated list of jar files on which to look for the class


actions

private java.util.Vector actions

upAction

private RunLevelAction upAction
stores the action for the upgoing run level (if none it will be null)


downAction

private RunLevelAction downAction
stores the action for the down going run level (if none it will be null)


attributes

private java.util.Properties attributes
the properties for the plugin


wrappedAttributes

private java.util.HashSet wrappedAttributes

uniqueTimestamp

Timestamp uniqueTimestamp
timestamp used to get uniquity (since runlevel + sequeuence is not unique)


mbeanHandle

private JmxMBeanHandle mbeanHandle
My JMX registration


contextNode

private ContextNode contextNode
Constructor Detail

PluginConfig

public PluginConfig(Global glob,
                    java.lang.String id,
                    boolean create,
                    java.lang.String className,
                    java.lang.String jar,
                    java.util.Properties attributes,
                    java.util.Vector actions)
This constructor takes all parameters needed


PluginConfig

public PluginConfig(Global glob,
                    java.lang.String id,
                    boolean create,
                    java.lang.String className,
                    java.util.Properties attributes)
Construtor where we can define attributes (no need to define actions)


PluginConfig

public PluginConfig(Global glob,
                    java.lang.String id,
                    boolean create,
                    java.lang.String className)
Minimal constructor


PluginConfig

public PluginConfig(Global glob)
Really minimal constructor

Method Detail

getId

public java.lang.String getId()

isCreate

public boolean isCreate()
Shall the plugin be created?

Specified by:
isCreate in interface PluginConfigMBean
Returns:
true if create

setCreate

public void setCreate(boolean create)
Shall the plugin be created?
Called from JMX (jconsole)

Specified by:
setCreate in interface PluginConfigMBean
Parameters:
create - true/false

setCreateInternal

public void setCreateInternal(boolean create)
Shall the plugin be created?
Called from SAX parser

Parameters:
create - true/false

getClassName

public java.lang.String getClassName()

addAction

public void addAction(RunLevelAction action)

getUpAction

public RunLevelAction getUpAction()

getDownAction

public RunLevelAction getDownAction()

addAttribute

public void addAttribute(java.lang.String key,
                         java.lang.String value)
Specified by:
addAttribute in interface I_AttributeUser
value - ${xy} are replaced since xmlBlaster v2.2

addAttribute

public void addAttribute(java.lang.String key,
                         java.lang.String value,
                         boolean replacePlaceHolder)
Specified by:
addAttribute in interface I_AttributeUser
replacePlaceHolder - if true ${xy} are replaced

getActions

public RunLevelAction[] getActions()

setId

public void setId(java.lang.String id)

registerMBean

public void registerMBean()

shutdown

public void shutdown()

setClassName

public void setClassName(java.lang.String className)

setJar

public void setJar(java.lang.String jar)

getPluginInfo

public PluginInfo getPluginInfo()
returns the PluginInfo object out of this configuration


wrapAttributeInCDATA

public void wrapAttributeInCDATA(java.lang.String attributeKey)
When the attribute is written to a string in the toXml methods it is wrapped inside a CDATA in case you pass 'true' here.

Specified by:
wrapAttributeInCDATA in interface I_AttributeUser

unwrapAttributeFromCDATA

public void unwrapAttributeFromCDATA(java.lang.String attributeKey)
When the attribute is written to a string in the toXml methods it is wrapped inside a CDATA. This can be undone if you pass 'true' here.

Specified by:
unwrapAttributeFromCDATA in interface I_AttributeUser

toXml

public java.lang.String toXml(java.lang.String extraOffset)
returns an xml litteral string representing this object.


toXml

public java.lang.String toXml()

usage

public java.lang.String usage()
Specified by:
usage in interface I_AdminUsage
Returns:
a human readable usage help string

getUsageUrl

public java.lang.String getUsageUrl()
Specified by:
getUsageUrl in interface I_AdminUsage
Returns:
A link on javadoc for JMX usage

setUsageUrl

public void setUsageUrl(java.lang.String url)
Specified by:
setUsageUrl in interface I_AdminUsage

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.