xmlBlaster 2.2.0 API

org.xmlBlaster.client
Class PluginLoader

java.lang.Object
  extended by org.xmlBlaster.client.PluginLoader

public class PluginLoader
extends java.lang.Object

PluginLoader is responsible for loading and initialization of client secuirty plugins. Either the client application chooses an appropriate plugin, or the

xmlBlaster.properties
file states, which plugin has to be used, by using the Security.Client.DefaultPlugin-Option. Syntax: Security.Client.DefaultPlugin=PluginType,PluginVersion Hint: Type and version must be the type and version of a valid and declared plugin. Example: Security.Client.DefaultPlugin=gui,1.0 Security.Client.Plugin[gui][1.0]=org.xmlBlaster.authentication.ClientSecurityHelper If neither the application, nor the config enforce a specific plugin, the Dummy-Plugin is used (old xmlBlaster behavior).


Field Summary
private  Global glob
           
private static java.util.logging.Logger log
           
private static java.lang.String ME
           
private  I_ClientPlugin plugin
           
private  java.lang.String pluginMechanism
           
private  java.lang.String pluginVersion
           
 
Constructor Summary
PluginLoader(Global glob)
           
 
Method Summary
private  java.lang.String[] fetchClassnameAndParam(java.lang.String mechanism, java.lang.String version)
          Resolve a class name of a plugin, specified by its type (mechanism) and version.
 I_ClientPlugin getClientPlugin(java.lang.String mechanism, java.lang.String version)
          Load another plugin.
 I_ClientPlugin getCurrentClientPlugin()
          Get the currently used plugin
 java.lang.String getType()
          Get the type of the currently used plugin
 java.lang.String getVersion()
          Get the Version of the currently used plugin
private  I_ClientPlugin loadPlugin(java.lang.String[] param)
          Handels the process of loading a plugin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ME

private static final java.lang.String ME
See Also:
Constant Field Values

glob

private final Global glob

log

private static java.util.logging.Logger log

pluginMechanism

private java.lang.String pluginMechanism

pluginVersion

private java.lang.String pluginVersion

plugin

private I_ClientPlugin plugin
Constructor Detail

PluginLoader

public PluginLoader(Global glob)
Method Detail

getType

public java.lang.String getType()
Get the type of the currently used plugin

Returns:
String

getVersion

public java.lang.String getVersion()
Get the Version of the currently used plugin

Returns:
String

getCurrentClientPlugin

public I_ClientPlugin getCurrentClientPlugin()
                                      throws XmlBlasterException
Get the currently used plugin

Returns:
I_ClientPlugin
Throws:
XmlBlasterException

getClientPlugin

public I_ClientPlugin getClientPlugin(java.lang.String mechanism,
                                      java.lang.String version)
                               throws XmlBlasterException
Load another plugin.

Parameters:
String - The type of the plugin, e.g. "ldap"
String - The version of the plugin, e.g. "1.0"
Returns:
I_ClientPlugin
Throws:
XmlBlasterException - Thrown if the plugin wasn't loadable or initializable

loadPlugin

private I_ClientPlugin loadPlugin(java.lang.String[] param)
                           throws XmlBlasterException
Handels the process of loading a plugin.

Parameters:
String[] - The first element of this array contains the class name. Following elements are arguments for the plugin. (Like in c/c++ the command-line arguments.)
Returns:
I_Manager
Throws:
XmlBlasterException - Thrown if loading or initializing failed.

fetchClassnameAndParam

private java.lang.String[] fetchClassnameAndParam(java.lang.String mechanism,
                                                  java.lang.String version)
                                           throws XmlBlasterException
Resolve a class name of a plugin, specified by its type (mechanism) and version.

The plugin is read from xmlBlaster.properties if mechanism==version==null
If non is specified there, we return null

Parameters:
String - The type
String - The version
Returns:
String[] The name of the class and some parameters
Throws:
XmlBlasterException

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.