crystalspace.jbind.impl.csutil.plugin
Class csPluginManager

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csutil.scf.csBase
          extended bycrystalspace.jbind.impl.csutil.plugin.csPluginManager
All Implemented Interfaces:
iBase, iPluginManager, iPointer

public class csPluginManager
extends csBase
implements iPluginManager

Author:
qan To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments

Field Summary
 
Fields inherited from class crystalspace.jbind.impl.csNativeObject
ImplFactory, nPointer
 
Constructor Summary
csPluginManager(iPointer nPointer)
           
 
Method Summary
 void clear()
          Unload all plugins from this plugin manager.
static java.lang.Class getInterfaceClass()
           
static java.lang.String getInterfaceName()
           
static int getInterfaceVersion()
           
 java.lang.String getName()
          Return the name of the interface
 iPluginIterator getPlugins()
          Get an iterator to iterate over all loaded plugins in the plugin manager.
 int getVersion()
          Return the version of the interface
static void initSCF()
           
protected  boolean isNativePointerValidSafe()
           
 iBase loadPlugin(java.lang.String classID)
          Load a plugin and (optionally); initialize it.
 iBase loadPlugin(java.lang.String classID, java.lang.String iInterface)
          Load a plugin and (optionally); initialize it.
 iBase loadPlugin(java.lang.String classID, java.lang.String iInterface, int iVersion)
          Load a plugin and (optionally); initialize it.
 iBase loadPlugin(java.lang.String classID, java.lang.String iInterface, int iVersion, boolean init)
          Load a plugin and (optionally); initialize it.
 void queryOptions(iComponent object)
          Query all options supported by given plugin and place into OptionList.
 iBase queryPlugin(java.lang.String iInterface, int iVersion)
          Get first of the loaded plugins that supports given interface ID.
 iBase queryPlugin(java.lang.String classID, java.lang.String iInterface, int iVersion)
          Find a plugin given his class ID.
 boolean registerPlugin(java.lang.String classID, iComponent obj)
          Register a object that implements the iComponent interface as a plugin.
 boolean unloadPlugin(iComponent obj)
          Remove a plugin from system driver's plugin list.
 
Methods inherited from class crystalspace.jbind.impl.csutil.scf.csBase
decRef, equals, finalize, getRefCount, incRef, nDelete, queryInterface, queryInterfaceSafe
 
Methods inherited from class crystalspace.jbind.impl.csNativeObject
changePointer, getPointer, getPointer, getPointerArray, hashCode, isMemoryOwner, isNativePointerValid, isNativePointerValidSafe, newNativeObject, setMemoryOwner, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getRefCount, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Constructor Detail

csPluginManager

public csPluginManager(iPointer nPointer)
Parameters:
nPointer -
Method Detail

getVersion

public int getVersion()
Description copied from interface: iBase
Return the version of the interface

Specified by:
getVersion in interface iBase
Specified by:
getVersion in class csBase

getName

public java.lang.String getName()
Description copied from interface: iBase
Return the name of the interface

Specified by:
getName in interface iBase
Specified by:
getName in class csBase

initSCF

public static void initSCF()

getInterfaceVersion

public static int getInterfaceVersion()

getInterfaceName

public static java.lang.String getInterfaceName()

getInterfaceClass

public static java.lang.Class getInterfaceClass()

isNativePointerValidSafe

protected boolean isNativePointerValidSafe()

clear

public void clear()
Description copied from interface: iPluginManager
Unload all plugins from this plugin manager. Implemented in csPluginManager.

Specified by:
clear in interface iPluginManager
See Also:
iPluginManager.clear()

getPlugins

public iPluginIterator getPlugins()
Description copied from interface: iPluginManager
Get an iterator to iterate over all loaded plugins in the plugin manager. This iterator will contain a copy of the plugins so it will not lock the plugin manager while looping over the plugins. Implemented in csPluginManager.

Specified by:
getPlugins in interface iPluginManager
Returns:
See Also:
iPluginManager.getPlugins()

loadPlugin

public iBase loadPlugin(java.lang.String classID,
                        java.lang.String iInterface,
                        int iVersion,
                        boolean init)
Description copied from interface: iPluginManager
Load a plugin and (optionally); initialize it. If 'init' is true then the plugin will be initialized and QueryOptions(); will be called. Implemented in csPluginManager.

Specified by:
loadPlugin in interface iPluginManager
Parameters:
classID -
iInterface -
iVersion -
init -
Returns:
See Also:
iPluginManager.loadPlugin(java.lang.String, java.lang.String, int, boolean)

loadPlugin

public iBase loadPlugin(java.lang.String classID,
                        java.lang.String iInterface,
                        int iVersion)
Description copied from interface: iPluginManager
Load a plugin and (optionally); initialize it. If 'init' is true then the plugin will be initialized and QueryOptions(); will be called. Implemented in csPluginManager.

Specified by:
loadPlugin in interface iPluginManager
Parameters:
classID -
iInterface -
iVersion -
Returns:
See Also:
iPluginManager.loadPlugin(java.lang.String, java.lang.String, int)

loadPlugin

public iBase loadPlugin(java.lang.String classID,
                        java.lang.String iInterface)
Description copied from interface: iPluginManager
Load a plugin and (optionally); initialize it. If 'init' is true then the plugin will be initialized and QueryOptions(); will be called. Implemented in csPluginManager.

Specified by:
loadPlugin in interface iPluginManager
Parameters:
classID -
iInterface -
Returns:
See Also:
iPluginManager.loadPlugin(java.lang.String, java.lang.String)

loadPlugin

public iBase loadPlugin(java.lang.String classID)
Description copied from interface: iPluginManager
Load a plugin and (optionally); initialize it. If 'init' is true then the plugin will be initialized and QueryOptions(); will be called. Implemented in csPluginManager.

Specified by:
loadPlugin in interface iPluginManager
Parameters:
classID -
Returns:
See Also:
iPluginManager.loadPlugin(java.lang.String)

queryOptions

public void queryOptions(iComponent object)
Description copied from interface: iPluginManager
Query all options supported by given plugin and place into OptionList. Normally this is done automatically by LoadPlugin(); if 'init' is true. If 'init' is not true then you can call this function AFTER calling object->Initialize();. Implemented in csPluginManager.

Specified by:
queryOptions in interface iPluginManager
Parameters:
object -
See Also:
iPluginManager.queryOptions(crystalspace.jbind.interfaces.iutil.comp.iComponent)

queryPlugin

public iBase queryPlugin(java.lang.String iInterface,
                         int iVersion)
Description copied from interface: iPluginManager
Get first of the loaded plugins that supports given interface ID. Warning! Usage of this function is usually not safe since multiple plugins can implement the same interface and there is no way to know which one is the correct one. It is better to use the object registry to find about single loaded components. Implemented in csPluginManager.

Specified by:
queryPlugin in interface iPluginManager
Parameters:
iInterface -
iVersion -
Returns:
See Also:
iPluginManager.queryPlugin(java.lang.String, int)

queryPlugin

public iBase queryPlugin(java.lang.String classID,
                         java.lang.String iInterface,
                         int iVersion)
Description copied from interface: iPluginManager
Find a plugin given his class ID. Implemented in csPluginManager.

Specified by:
queryPlugin in interface iPluginManager
Parameters:
classID -
iInterface -
iVersion -
Returns:
See Also:
iPluginManager.queryPlugin(java.lang.String, java.lang.String, int)

registerPlugin

public boolean registerPlugin(java.lang.String classID,
                              iComponent obj)
Description copied from interface: iPluginManager
Register a object that implements the iComponent interface as a plugin. Implemented in csPluginManager.

Specified by:
registerPlugin in interface iPluginManager
Parameters:
classID -
obj -
Returns:
See Also:
iPluginManager.registerPlugin(java.lang.String, crystalspace.jbind.interfaces.iutil.comp.iComponent)

unloadPlugin

public boolean unloadPlugin(iComponent obj)
Description copied from interface: iPluginManager
Remove a plugin from system driver's plugin list. Implemented in csPluginManager.

Specified by:
unloadPlugin in interface iPluginManager
Parameters:
obj -
Returns:
See Also:
iPluginManager.unloadPlugin(crystalspace.jbind.interfaces.iutil.comp.iComponent)