xmlBlaster 2.1.0 API

org.xmlBlaster.engine.mime
Class AccessPluginManager

java.lang.Object
  extended by org.xmlBlaster.util.plugin.PluginManagerBase
      extended by org.xmlBlaster.engine.mime.AccessPluginManager
All Implemented Interfaces:
java.util.EventListener, I_RunlevelListener, I_PluginManager

public class AccessPluginManager
extends PluginManagerBase
implements I_RunlevelListener

Loads subscribe()/get() filter plugin depending on message MIME type. Please register your plugins in xmlBlaster.properties, for example:

 MimeAccessPlugin[MyFilter][1.0]=com.mycompany.MyFilter
 


Field Summary
private  java.util.Map accessFilterMap
           
private  boolean firstLogging
           
private  ServerScope glob
           
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
static java.lang.String pluginPropertyName
           
 
Fields inherited from class org.xmlBlaster.util.plugin.PluginManagerBase
NO_PLUGIN_TYPE
 
Constructor Summary
AccessPluginManager(ServerScope glob)
           
 
Method Summary
 boolean addAccessFilterPlugin(java.lang.String type, java.lang.String version)
          Invoked on new subscription or get() invocation, loads plugin.
 I_AccessFilter getAccessFilter(java.lang.String type, java.lang.String version, java.lang.String mime, java.lang.String mimeExtended)
          Get access filter object from cache, based on MIME type.
 java.lang.String getDefaultPluginName(java.lang.String type, java.lang.String version)
           
 java.lang.String getName()
          A human readable name of the listener for logging.
 I_AccessFilter getPlugin(java.lang.String type, java.lang.String version)
          Return a specific MIME based message filter plugin.
protected  java.lang.String getPluginPropertyName()
           
 void postInstantiate(I_Plugin plugin, PluginInfo pluginInfo)
          Called by PluginManagerBase.instantiatePluginSecondPhase()
 void runlevelChange(int from, int to, boolean force)
          Invoked on run level change, see RunlevelManager.RUNLEVEL_HALTED and RunlevelManager.RUNLEVEL_RUNNING

Enforced by I_RunlevelListener

 void shutdown()
           
 
Methods inherited from class org.xmlBlaster.util.plugin.PluginManagerBase
createPluginPropertyKey, getDummyPlugin, getFromPluginCache, getGlobal, getPluginObject, getPluginObject, getPluginObject, ignorePlugin, instantiatePlugin, instantiatePlugin, removeFromPluginCache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ME

private final java.lang.String ME

pluginPropertyName

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

glob

private final ServerScope glob

log

private static java.util.logging.Logger log

firstLogging

private boolean firstLogging

accessFilterMap

private final java.util.Map accessFilterMap
Constructor Detail

AccessPluginManager

public AccessPluginManager(ServerScope glob)
Method Detail

getPlugin

public I_AccessFilter getPlugin(java.lang.String type,
                                java.lang.String version)
                         throws XmlBlasterException
Return a specific MIME based message filter plugin.

It is returned from cache if loaded already.

Parameters:
String - The type of the requested plugin.
String - The version of the requested plugin.
Returns:
The AccessFilter for this type and version or null if none is specified
Throws:
XmlBlasterException

postInstantiate

public void postInstantiate(I_Plugin plugin,
                            PluginInfo pluginInfo)
Called by PluginManagerBase.instantiatePluginSecondPhase()

Overrides:
postInstantiate in class PluginManagerBase

getPluginPropertyName

protected java.lang.String getPluginPropertyName()
Overrides:
getPluginPropertyName in class PluginManagerBase
Returns:
The name of the property in xmlBlaster.property "MimeAccessPlugin" for "MimeAccessPlugin[demo][1.0]"

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 classname or null if not specified

getAccessFilter

public final I_AccessFilter getAccessFilter(java.lang.String type,
                                            java.lang.String version,
                                            java.lang.String mime,
                                            java.lang.String mimeExtended)
Get access filter object from cache, based on MIME type.

Returns:
null if not applicable

addAccessFilterPlugin

public final boolean addAccessFilterPlugin(java.lang.String type,
                                           java.lang.String version)
                                    throws XmlBlasterException
Invoked on new subscription or get() invocation, loads plugin. You have to check yourself if it is loaded already

Returns:
true if initially loaded, and false if was loaded already
Throws:
on - error
XmlBlasterException

shutdown

public void shutdown()
Overrides:
shutdown in class PluginManagerBase

getName

public java.lang.String getName()
A human readable name of the listener for logging.

Enforced by I_RunlevelListener

Specified by:
getName in interface I_RunlevelListener
Specified by:
getName in interface I_PluginManager
Overrides:
getName in class PluginManagerBase
Returns:
The name of the property in xmlBlaster.property, e.g. "Security.Server.Plugin" for "Security.Server.Plugin[simple][1.0]"

runlevelChange

public void runlevelChange(int from,
                           int to,
                           boolean force)
                    throws XmlBlasterException
Invoked on run level change, see RunlevelManager.RUNLEVEL_HALTED and RunlevelManager.RUNLEVEL_RUNNING

Enforced by I_RunlevelListener

Specified by:
runlevelChange in interface I_RunlevelListener
Parameters:
from - The current runlevel
to - The runlevel we want to switch to
force - If true force the change even if messages are lost
Throws:
XmlBlasterException

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.