xmlBlaster 2.2.0 API

org.xmlBlaster.engine.msgstore
Class StoragePluginManager

java.lang.Object
  extended by org.xmlBlaster.util.plugin.PluginManagerBase
      extended by org.xmlBlaster.engine.msgstore.StoragePluginManager
All Implemented Interfaces:
I_PluginManager

public class StoragePluginManager
extends PluginManagerBase

StoragePluginManager loads the I_Map implementation plugins.

Usage examples:

 // xmlBlaster.properties or on command line
 #------------------------------------------------------------------------------
 # Declare existing queue implementation plugins
 # SEE: http://www.xmlBlaster.org/xmlBlaster/doc/requirements/engine.message.lifecycle.html
 StoragePlugin[JDBC][1.0]=org.xmlBlaster.util.queue.jdbc.JdbcQueuePlugin
 StoragePlugin[RAM][1.0]=org.xmlBlaster.engine.msgstore.ram.MapPlugin
 StoragePlugin[CACHE][1.0]=org.xmlBlaster.engine.msgstore.cache.PersistenceCachePlugin,transientMap=RAM,persistentMap=JDBC

 # Choose the plugin (each publisher can overwrite this in its publish topic-QoS)
 persistence/defaultPlugin=CACHE,1.0
 persistence/topicStore/defaultPlugin=JDBC,1.0
 persistence/msgUnitStore/defaultPlugin=CACHE,1.0

 # If you choose CACHE as defaultPlugin configure the CACHE plugin:
 persistence.cache.persistentQueue=JDBC,1.0
 persistence.cache.transientQueue=RAM,1.0
 #------------------------------------------------------------------------------
 

Author:
Michele Laghi., Marcel Ruff.
See Also:
engine.queue, engine.message.lifecycle

Field Summary
private static java.lang.String[][] defaultPluginNames
           
private  java.util.Map eventHandlerMap
           
private  ServerScope glob
           
private static java.util.logging.Logger log
           
private  java.lang.String pluginEnvClass
           
static java.lang.String pluginPropertyName
           
private static boolean REGISTER
           
private static boolean REMOVE
           
private  java.util.Map storagesMap
           
 
Fields inherited from class org.xmlBlaster.util.plugin.PluginManagerBase
NO_PLUGIN_TYPE
 
Constructor Summary
StoragePluginManager(ServerScope glob)
           
 
Method Summary
 void cleanup(I_Storage storage)
           
 java.lang.String getDefaultPluginName(java.lang.String type, java.lang.String version)
           
 StorageEventHandler getEventHandler(java.lang.String key)
           
 I_Map getPlugin(PluginInfo pluginInfo, StorageId storageId, QueuePropertyBase props)
           
 I_Map getPlugin(java.lang.String typeVersion, StorageId storageId, QueuePropertyBase props)
           
 I_Map getPlugin(java.lang.String type, java.lang.String version, StorageId storageId, QueuePropertyBase props)
          Return a new created storage plugin.
protected  java.lang.String getPluginPropertyName()
          Enforced by PluginManagerBase.
protected  void postInstantiate(I_Plugin plugin, PluginInfo pluginInfo)
          Is called after a plugin in instantiated, allows the base class to do specific actions.
private  void registerOrRemovePlugin(I_Storage plugin, boolean register)
          Not synchronized since invoked inside the synchronized(this.storagesMap)
 boolean setEventHandler(java.lang.String key, StorageEventHandler handler)
          Set an EventHandler singleton
 
Methods inherited from class org.xmlBlaster.util.plugin.PluginManagerBase
createPluginPropertyKey, getDummyPlugin, getFromPluginCache, getGlobal, getName, getPluginObject, getPluginObject, getPluginObject, ignorePlugin, instantiatePlugin, instantiatePlugin, removeFromPluginCache, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

glob

private final ServerScope glob

log

private static java.util.logging.Logger log

pluginEnvClass

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

defaultPluginNames

private static final java.lang.String[][] defaultPluginNames

pluginPropertyName

public static final java.lang.String pluginPropertyName
See Also:
Constant Field Values

storagesMap

private java.util.Map storagesMap

eventHandlerMap

private java.util.Map eventHandlerMap

REMOVE

private static final boolean REMOVE
See Also:
Constant Field Values

REGISTER

private static final boolean REGISTER
See Also:
Constant Field Values
Constructor Detail

StoragePluginManager

public StoragePluginManager(ServerScope glob)
Method Detail

getPlugin

public I_Map getPlugin(java.lang.String typeVersion,
                       StorageId storageId,
                       QueuePropertyBase props)
                throws XmlBlasterException
Throws:
XmlBlasterException
See Also:
getPlugin(String, String, StorageId, QueuePropertyBase)

getPlugin

public I_Map getPlugin(java.lang.String type,
                       java.lang.String version,
                       StorageId storageId,
                       QueuePropertyBase props)
                throws XmlBlasterException
Return a new created storage plugin.

Parameters:
String - The type of the requested plugin, pass 'undef' to suppress using a storage.
String - The version of the requested plugin.
fn - The file name for persistence or null (will be generated or ignored if RAM based)
Returns:
The plugin for this type and version or null if none is specified or type=="undef"
Throws:
XmlBlasterException

registerOrRemovePlugin

private void registerOrRemovePlugin(I_Storage plugin,
                                    boolean register)
                             throws XmlBlasterException
Not synchronized since invoked inside the synchronized(this.storagesMap)

Parameters:
plugin -
register -
Throws:
XmlBlasterException

getPlugin

public I_Map getPlugin(PluginInfo pluginInfo,
                       StorageId storageId,
                       QueuePropertyBase props)
                throws XmlBlasterException
Throws:
XmlBlasterException

getPluginPropertyName

protected java.lang.String getPluginPropertyName()
Enforced by PluginManagerBase.

Overrides:
getPluginPropertyName in class PluginManagerBase
Returns:
The name of the property in xmlBlaster.property "StoragePlugin" for "StoragePlugin[JDBC][1.0]"

postInstantiate

protected void postInstantiate(I_Plugin plugin,
                               PluginInfo pluginInfo)
Description copied from class: PluginManagerBase
Is called after a plugin in instantiated, allows the base class to do specific actions. Is NOT called when plugin got from cache.

Overrides:
postInstantiate in class PluginManagerBase

getDefaultPluginName

public java.lang.String getDefaultPluginName(java.lang.String type,
                                             java.lang.String version)
Specified by:
getDefaultPluginName in interface I_PluginManager
Overrides:
getDefaultPluginName in class PluginManagerBase
Parameters:
type - can be null
version - can be null
Returns:
please return your default plugin class name or null if not specified

setEventHandler

public boolean setEventHandler(java.lang.String key,
                               StorageEventHandler handler)
                        throws XmlBlasterException
Set an EventHandler singleton

Parameters:
handler - null resets an existing handler
Returns:
if false another one existed already and your handler is not set
Throws:
XmlBlasterException

getEventHandler

public StorageEventHandler getEventHandler(java.lang.String key)

cleanup

public void cleanup(I_Storage storage)

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.