org.gudy.azureus2.pluginsimpl.local
Class PluginManagerImpl

java.lang.Object
  extended by org.gudy.azureus2.plugins.PluginManager
      extended by org.gudy.azureus2.pluginsimpl.local.PluginManagerImpl

public class PluginManagerImpl
extends PluginManager


Field Summary
protected static AzureusCore azureus_core
           
protected static AEMonitor class_mon
           
protected  PluginInitializer pi
           
protected static boolean running
           
protected static PluginManagerImpl singleton
           
 
Fields inherited from class org.gudy.azureus2.plugins.PluginManager
CA_HIBERNATE, CA_QUIT_VUZE, CA_SHUTDOWN, CA_SLEEP, PR_APP_DIRECTORY, PR_DISABLE_NATIVE_SUPPORT, PR_DOC_DIRECTORY, PR_MULTI_INSTANCE, PR_USER_DIRECTORY, UI_NONE, UI_SWT
 
Constructor Summary
protected PluginManagerImpl(PluginInitializer _pi)
           
 
Method Summary
 void executeCloseAction(java.lang.String action)
           
 void firePluginEvent(int ev)
           
 PluginInterface getDefaultPluginInterface()
          returns the default plugin interface that can be used to access plugin functionality without an explicit plugin
 PluginInstaller getPluginInstaller()
           
 PluginInterface getPluginInterfaceByClass(java.lang.Class c)
           
 PluginInterface getPluginInterfaceByClass(java.lang.Class c, boolean operational)
          Returns the plugin interface with a given class, or null if not found.
 PluginInterface getPluginInterfaceByClass(java.lang.String class_name)
           
 PluginInterface getPluginInterfaceByClass(java.lang.String class_name, boolean operational)
          Returns the plugin interface with a given class name, or null if not found.
 PluginInterface getPluginInterfaceByID(java.lang.String id)
          returns the plugin interface with a given id, or null if not found
 PluginInterface getPluginInterfaceByID(java.lang.String id, boolean operational)
          Returns the plugin interface with a given id, or null if not found.
 PluginInterface[] getPluginInterfaces()
          Gets the current set of registered plugins.
 PluginInterface[] getPlugins()
          Gets the current set of registered plugins.
 PluginInterface[] getPlugins(boolean expect_partial_result)
           
 java.util.List<PluginInterface> getPluginsWithMethod(java.lang.String name, java.lang.Class<?>[] parameters)
          *since 5201
protected static PluginManagerImpl getSingleton(PluginInitializer pi)
           
 boolean isInitialized()
           
 boolean isSilentRestartEnabled()
           
 void refreshPluginList(boolean initialise)
           
static void registerPlugin(java.lang.Class plugin_class)
           
static void registerPlugin(Plugin plugin, java.lang.String id, java.lang.String config_key)
           
static void restartAzureus()
           
static void setStartDetails(AzureusCore _core)
          When AZ is started directly (i.e.
static PluginManager startAzureus(int ui_type, java.util.Properties properties)
           
static void stopAzureus()
           
 
Methods inherited from class org.gudy.azureus2.plugins.PluginManager
getDefaults, refreshPluginList, registerPlugin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

running

protected static boolean running

singleton

protected static PluginManagerImpl singleton

class_mon

protected static AEMonitor class_mon

azureus_core

protected static AzureusCore azureus_core

pi

protected PluginInitializer pi
Constructor Detail

PluginManagerImpl

protected PluginManagerImpl(PluginInitializer _pi)
Method Detail

getSingleton

protected static PluginManagerImpl getSingleton(PluginInitializer pi)

startAzureus

public static PluginManager startAzureus(int ui_type,
                                         java.util.Properties properties)

stopAzureus

public static void stopAzureus()
                        throws PluginException
Throws:
PluginException

restartAzureus

public static void restartAzureus()
                           throws PluginException
Throws:
PluginException

setStartDetails

public static void setStartDetails(AzureusCore _core)
When AZ is started directly (i.e. not via a plugin) this method is called so that the running state is correctly understood

Parameters:
type -

registerPlugin

public static void registerPlugin(java.lang.Class plugin_class)

registerPlugin

public static void registerPlugin(Plugin plugin,
                                  java.lang.String id,
                                  java.lang.String config_key)

getPluginInterfaceByID

public PluginInterface getPluginInterfaceByID(java.lang.String id)
Description copied from class: PluginManager
returns the plugin interface with a given id, or null if not found

Specified by:
getPluginInterfaceByID in class PluginManager
Returns:

getPluginInterfaceByID

public PluginInterface getPluginInterfaceByID(java.lang.String id,
                                              boolean operational)
Description copied from class: PluginManager
Returns the plugin interface with a given id, or null if not found.

Specified by:
getPluginInterfaceByID in class PluginManager
operational - If true, only return a PluginInterface if the plugin is operational (i.e. is running).

getPluginInterfaceByClass

public PluginInterface getPluginInterfaceByClass(java.lang.Class c)
Specified by:
getPluginInterfaceByClass in class PluginManager

getPluginInterfaceByClass

public PluginInterface getPluginInterfaceByClass(java.lang.Class c,
                                                 boolean operational)
Description copied from class: PluginManager
Returns the plugin interface with a given class, or null if not found.

Specified by:
getPluginInterfaceByClass in class PluginManager
operational - If true, only return a PluginInterface if the plugin is operational (i.e. is running).

getPluginInterfaceByClass

public PluginInterface getPluginInterfaceByClass(java.lang.String class_name)
Specified by:
getPluginInterfaceByClass in class PluginManager

getPluginInterfaceByClass

public PluginInterface getPluginInterfaceByClass(java.lang.String class_name,
                                                 boolean operational)
Description copied from class: PluginManager
Returns the plugin interface with a given class name, or null if not found.

Specified by:
getPluginInterfaceByClass in class PluginManager
operational - If true, only return a PluginInterface if the plugin is operational (i.e. is running).

getPluginInterfaces

public PluginInterface[] getPluginInterfaces()
Description copied from class: PluginManager
Gets the current set of registered plugins. During initialisation this will probably give partial results as plugin initialisation is non-deterministic.

Specified by:
getPluginInterfaces in class PluginManager
Returns:

getDefaultPluginInterface

public PluginInterface getDefaultPluginInterface()
Description copied from class: PluginManager
returns the default plugin interface that can be used to access plugin functionality without an explicit plugin

Specified by:
getDefaultPluginInterface in class PluginManager
Returns:
null if unavailable

getPlugins

public PluginInterface[] getPlugins()
Description copied from class: PluginManager
Gets the current set of registered plugins. During initialisation this will probably give partial results as plugin initialisation is non-deterministic.

Specified by:
getPlugins in class PluginManager
Returns:

getPlugins

public PluginInterface[] getPlugins(boolean expect_partial_result)
Specified by:
getPlugins in class PluginManager

firePluginEvent

public void firePluginEvent(int ev)
Specified by:
firePluginEvent in class PluginManager

getPluginInstaller

public PluginInstaller getPluginInstaller()
Specified by:
getPluginInstaller in class PluginManager

refreshPluginList

public void refreshPluginList(boolean initialise)
Specified by:
refreshPluginList in class PluginManager

isSilentRestartEnabled

public boolean isSilentRestartEnabled()
Specified by:
isSilentRestartEnabled in class PluginManager

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in class PluginManager

executeCloseAction

public void executeCloseAction(java.lang.String action)
                        throws PluginException
Specified by:
executeCloseAction in class PluginManager
Parameters:
action - one of the above CA_
Throws:
PluginException

getPluginsWithMethod

public java.util.List<PluginInterface> getPluginsWithMethod(java.lang.String name,
                                                            java.lang.Class<?>[] parameters)
Description copied from class: PluginManager
*since 5201

Specified by:
getPluginsWithMethod in class PluginManager