xmlBlaster 2.2.0 API

org.xmlBlaster.util.plugin
Class PluginInfo

java.lang.Object
  extended by org.xmlBlaster.util.plugin.PluginInfo
All Implemented Interfaces:
I_PluginConfig

public class PluginInfo
extends java.lang.Object
implements I_PluginConfig

Holds data about a plugin (immutable).

Author:
Konrad Krafft, Marcel Ruff

Field Summary
private  java.lang.String className
          e.g.
private  Global glob
           
static java.lang.String KEY_CLASSPATH
          The key into params for the classpath
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
private  java.util.Properties params
          key/values from "org.xmlBlaster.protocol.soap.SoapDriver,classpath=xerces.jar:soap.jar,MAXSIZE=100"
private  java.lang.String propertyKey
          e.g.
private  java.lang.String propertyName
          e.g.
private  java.lang.String type
          e.g.
private  java.lang.Object userData
           
private  java.lang.String version
          e.g.
 
Constructor Summary
PluginInfo(Global glob, I_PluginManager manager, java.lang.String typeVersion)
           
PluginInfo(Global glob, I_PluginManager manager, java.lang.String typeVersion, ContextNode contextNode)
           
PluginInfo(Global glob, I_PluginManager manager, java.lang.String type, java.lang.String version)
           
PluginInfo(Global glob, I_PluginManager manager, java.lang.String type, java.lang.String version, ContextNode contextNode)
          From pluginEnvClass and instanceId we build a string to lookup the key in the environment e.g.
PluginInfo(Global glob, java.lang.String type, java.lang.String className, java.util.Properties params)
           
 
Method Summary
 java.lang.String dumpPluginParameters()
          Dumps the parameters passed to the plugin.
 java.lang.String getClassName()
           
 java.lang.String getId()
           
private  java.lang.String[] getParameterArr()
           
 java.util.Properties getParameters()
           
 java.lang.String getPrefix()
          Gets the prefix for the implementing plugin.
 java.lang.String getType()
           
 java.lang.String getTypeVersion()
           
 java.lang.Object getUserData()
           
 java.lang.String getVersion()
           
 boolean ignorePlugin()
          Check if the plugin is marked with "undef", such configurations are not loaded
private  void init(Global glob, I_PluginManager manager, java.lang.String type_, java.lang.String version_, ContextNode contextNode)
          see javadoc of constructor
private  void parsePropertyValue(java.lang.String rawString)
           
 void setUserData(java.lang.Object userData)
          Use this setUserData() / getUserData() pair to transport some user specific data to postInitialize() if needed
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

glob

private Global glob

log

private static java.util.logging.Logger log

ME

private java.lang.String ME

propertyName

private java.lang.String propertyName
e.g. "ProtocolPlugin"


propertyKey

private java.lang.String propertyKey
e.g. "ProtocolPlugin[IOR][1.0]"


type

private java.lang.String type
e.g. "IOR"


version

private java.lang.String version
e.g. "1.0"


className

private java.lang.String className
e.g. "org.xmlBlaster.protocol.soap.SoapDriver"


KEY_CLASSPATH

public static java.lang.String KEY_CLASSPATH
The key into params for the classpath


params

private java.util.Properties params
key/values from "org.xmlBlaster.protocol.soap.SoapDriver,classpath=xerces.jar:soap.jar,MAXSIZE=100"


userData

private java.lang.Object userData
Constructor Detail

PluginInfo

public PluginInfo(Global glob,
                  java.lang.String type,
                  java.lang.String className,
                  java.util.Properties params)

PluginInfo

public PluginInfo(Global glob,
                  I_PluginManager manager,
                  java.lang.String typeVersion)
           throws XmlBlasterException
Parameters:
manager - can be null if you only want to parse typeVersion
typeVersion - null: Choose default plugin pluginManager.getDefaultPluginName()
"undef": Don't load the plugin else: Load the given plugin or throw exception Example: "SOCKET,1.0" or "RAM,1.0"
Throws:
XmlBlasterException

PluginInfo

public PluginInfo(Global glob,
                  I_PluginManager manager,
                  java.lang.String typeVersion,
                  ContextNode contextNode)
           throws XmlBlasterException
Parameters:
manager - can be null if you only want to parse typeVersion
typeVersion - null: Choose default plugin pluginManager.getDefaultPluginName()
"undef": Don't load the plugin else: Load the given plugin or throw exception Example: "SOCKET,1.0" or "RAM,1.0"
Throws:
XmlBlasterException

PluginInfo

public PluginInfo(Global glob,
                  I_PluginManager manager,
                  java.lang.String type,
                  java.lang.String version,
                  ContextNode contextNode)
           throws XmlBlasterException
From pluginEnvClass and instanceId we build a string to lookup the key in the environment e.g. "/xmlBlaster/node/heron/persistence/topicStore/PersistencePlugin[JDBC][1.0]"

Parameters:
manager - can be null if you only wanted to parse typeVersion
type - null: Choose default plugin pluginManager.getDefaultPluginName()
"undef": Don't load the plugin else: Load the given plugin or throw exception
pluginEnvClass - The classname for environment lookup e.g. "queue" or "persistence"
instanceId - The instance name of the plugin e.g. "history" or "topicStore"
Throws:
XmlBlasterException

PluginInfo

public PluginInfo(Global glob,
                  I_PluginManager manager,
                  java.lang.String type,
                  java.lang.String version)
           throws XmlBlasterException
Parameters:
type - null: Choose default plugin pluginManager.getDefaultPluginName()
"undef": Don't load the plugin else: Load the given plugin or throw exception
Throws:
XmlBlasterException
Method Detail

getId

public java.lang.String getId()

setUserData

public void setUserData(java.lang.Object userData)
Use this setUserData() / getUserData() pair to transport some user specific data to postInitialize() if needed


getUserData

public java.lang.Object getUserData()

init

private void init(Global glob,
                  I_PluginManager manager,
                  java.lang.String type_,
                  java.lang.String version_,
                  ContextNode contextNode)
           throws XmlBlasterException
see javadoc of constructor

Throws:
XmlBlasterException

parsePropertyValue

private void parsePropertyValue(java.lang.String rawString)
                         throws XmlBlasterException
Parameters:
rawString - e.g. "org.xmlBlaster.protocol.soap.SoapDriver,classpath=xerces.jar:soap.jar,MAXSIZE=100"
Throws:
XmlBlasterException

ignorePlugin

public boolean ignorePlugin()
Check if the plugin is marked with "undef", such configurations are not loaded


getClassName

public java.lang.String getClassName()
Returns:
For example "org.xmlBlaster.protocol.soap.SoapDriver"

getParameters

public java.util.Properties getParameters()
Specified by:
getParameters in interface I_PluginConfig
Returns:
The configuration, never null

getParameterArr

private java.lang.String[] getParameterArr()

getType

public java.lang.String getType()
Specified by:
getType in interface I_PluginConfig

getVersion

public java.lang.String getVersion()
Specified by:
getVersion in interface I_PluginConfig

getTypeVersion

public java.lang.String getTypeVersion()

dumpPluginParameters

public java.lang.String dumpPluginParameters()
Dumps the parameters passed to the plugin. So if you defined a property in the property file like this:
QueuePlugin[CACHE][1.0]=org.xmlBlaster.util.queue.cache.CacheQueueInterceptorPlugin,\
                        persistentQueue=JDBC,\
                        transientQueue=RAM
It will be returnes as a string:
org.xmlBlaster.util.queue.cache.CacheQueueInterceptorPlugin,persistentQueue=JDBC,transientQueue=RAM
This method can be used to partially change a plugin property like in the following example:
  PluginInfo pluginInfo = new PluginInfo(glob, glob.getQueuePluginManager(), "JDBC", "1.0");
  Properties p = pluginInfo.getParameters();
  p.setProperty("tablePrefix", "test_");
  glob.getProperty().set("QueuePlugin[JDBC][1.0]", pluginInfo.dumpPluginParameters());


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
for example "ProtocolPlugin[IOR][1.0]"

getPrefix

public java.lang.String getPrefix()
Description copied from interface: I_PluginConfig
Gets the prefix for the implementing plugin. Suppose you have two plugins ('pluginA1' and 'pluginB2') both containing an attribute called 'directoryName'. Then without a context there is now way to distinguish between them. This method returns the prefix (the context). For example 'plugin/${pluginType}/' which would be 'plugin/pluginA1/'

Specified by:
getPrefix in interface I_PluginConfig
Returns:

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.