xmlBlaster 2.2.0 client 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
static java.lang.String KEY_CLASSPATH
          The key into params for the classpath
 
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()
           
 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
 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

KEY_CLASSPATH

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

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()

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

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 client API

Copyright © 1999-2014 The xmlBlaster.org contributers.