org.gudy.azureus2.plugins
Class PluginManager

java.lang.Object
  extended by org.gudy.azureus2.plugins.PluginManager

public abstract class PluginManager
extends Object

This class allows Azureus to be started as an embedded component and also allows plugins to be dynamically registered

Author:
parg

Field Summary
static String CA_HIBERNATE
           
static String CA_QUIT_VUZE
           
static String CA_SHUTDOWN
           
static String CA_SLEEP
           
static String PR_APP_DIRECTORY
          Where azureus is 'installed'.
static String PR_DISABLE_NATIVE_SUPPORT
          Set this to "true" (String) if you want to disable any native platform support String value
static String PR_DOC_DIRECTORY
          Parent folder that contains the downloads directory String value
static String PR_MULTI_INSTANCE
          Property Key: Allow multiple instances.
static String PR_USER_DIRECTORY
          Where the azureus config (i.e.
static int UI_NONE
          No user interface
static int UI_SWT
          SWT user inferface
 
Constructor Summary
PluginManager()
           
 
Method Summary
abstract  void executeCloseAction(String action)
           
abstract  void firePluginEvent(int event_type)
           
abstract  PluginInterface getDefaultPluginInterface()
          returns the default plugin interface that can be used to access plugin functionality without an explicit plugin
static PluginManagerDefaults getDefaults()
           
abstract  PluginInstaller getPluginInstaller()
           
abstract  PluginInterface getPluginInterfaceByClass(Class c)
           
abstract  PluginInterface getPluginInterfaceByClass(Class class_object, boolean operational)
          Returns the plugin interface with a given class, or null if not found.
abstract  PluginInterface getPluginInterfaceByClass(String class_name)
           
abstract  PluginInterface getPluginInterfaceByClass(String class_name, boolean operational)
          Returns the plugin interface with a given class name, or null if not found.
abstract  PluginInterface getPluginInterfaceByID(String id)
          returns the plugin interface with a given id, or null if not found
abstract  PluginInterface getPluginInterfaceByID(String id, boolean operational)
          Returns the plugin interface with a given id, or null if not found.
abstract  PluginInterface[] getPluginInterfaces()
          Gets the current set of registered plugins.
abstract  PluginInterface[] getPlugins()
          Gets the current set of registered plugins.
abstract  PluginInterface[] getPlugins(boolean expect_partial_result)
           
abstract  List<PluginInterface> getPluginsWithMethod(String name, Class<?>[] parameters)
          *since 5201
abstract  boolean isInitialized()
           
abstract  boolean isSilentRestartEnabled()
           
 void refreshPluginList()
           
abstract  void refreshPluginList(boolean initialise)
           
static void registerPlugin(Class plugin_class)
          Programatic plugin registration interface
static void registerPlugin(Plugin plugin, String id)
           
static void registerPlugin(Plugin plugin, String id, String config_key)
           
static void restartAzureus()
          restarts azureus and performs any Update actions defined via the plugin "update" interface.
static PluginManager startAzureus(int ui_type, Properties properties)
          Runs Azureus
static void stopAzureus()
          Shuts down Azureus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UI_NONE

public static final int UI_NONE
No user interface

Since:
2.0.8.0
See Also:
Constant Field Values

UI_SWT

public static final int UI_SWT
SWT user inferface

Since:
2.0.6.0
See Also:
Constant Field Values

PR_MULTI_INSTANCE

public static final String PR_MULTI_INSTANCE
Property Key: Allow multiple instances. Normally Azureus will only permit a single instance to run per machine. Values for this key are: "true" or "false"

Since:
2.0.7.0
See Also:
Constant Field Values

PR_USER_DIRECTORY

public static final String PR_USER_DIRECTORY
Where the azureus config (i.e. per-user type) state is stored String value

Since:
4.9.0.1
See Also:
Constant Field Values

PR_APP_DIRECTORY

public static final String PR_APP_DIRECTORY
Where azureus is 'installed'. For embedded use you probably want to set config and app dir to a shared per-user location String value

Since:
4.9.0.1
See Also:
Constant Field Values

PR_DOC_DIRECTORY

public static final String PR_DOC_DIRECTORY
Parent folder that contains the downloads directory String value

Since:
4.9.0.1
See Also:
Constant Field Values

PR_DISABLE_NATIVE_SUPPORT

public static final String PR_DISABLE_NATIVE_SUPPORT
Set this to "true" (String) if you want to disable any native platform support String value

Since:
4.9.0.1
See Also:
Constant Field Values

CA_QUIT_VUZE

public static final String CA_QUIT_VUZE
See Also:
Constant Field Values

CA_SLEEP

public static final String CA_SLEEP
See Also:
Constant Field Values

CA_HIBERNATE

public static final String CA_HIBERNATE
See Also:
Constant Field Values

CA_SHUTDOWN

public static final String CA_SHUTDOWN
See Also:
Constant Field Values
Constructor Detail

PluginManager

public PluginManager()
Method Detail

getDefaults

public static PluginManagerDefaults getDefaults()

startAzureus

public static PluginManager startAzureus(int ui_type,
                                         Properties properties)
Runs Azureus

Parameters:
ui_type - Type of user interface to provide. See UI_* Constants
properties - A list of properties to pass Azureus. See PR_* constants.
Since:
2.0.6.0

stopAzureus

public static void stopAzureus()
                        throws PluginException
Shuts down Azureus

Throws:
PluginException
Since:
2.0.8.0

restartAzureus

public static void restartAzureus()
                           throws PluginException
restarts azureus and performs any Update actions defined via the plugin "update" interface. Currently only works for SWT UIs.

Throws:
PluginException
Since:
2.1.0.0

registerPlugin

public static void registerPlugin(Class plugin_class)
Programatic plugin registration interface

Parameters:
plugin_class - this must implement Plugin
Since:
2.0.6.0

registerPlugin

public static void registerPlugin(Plugin plugin,
                                  String id)

registerPlugin

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

getPluginInterfaceByID

public abstract PluginInterface getPluginInterfaceByID(String id,
                                                       boolean operational)
Returns the plugin interface with a given id, or null if not found.

Parameters:
id -
operational - If true, only return a PluginInterface if the plugin is operational (i.e. is running).
Since:
3.1.1.1

getPluginInterfaceByClass

public abstract PluginInterface getPluginInterfaceByClass(String class_name,
                                                          boolean operational)
Returns the plugin interface with a given class name, or null if not found.

Parameters:
class_name -
operational - If true, only return a PluginInterface if the plugin is operational (i.e. is running).
Since:
3.1.1.1

getPluginInterfaceByClass

public abstract PluginInterface getPluginInterfaceByClass(Class class_object,
                                                          boolean operational)
Returns the plugin interface with a given class, or null if not found.

Parameters:
class_object -
operational - If true, only return a PluginInterface if the plugin is operational (i.e. is running).
Since:
3.1.1.1

getPluginInterfaces

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

Returns:
Since:
2.1.0.0

getDefaultPluginInterface

public abstract PluginInterface getDefaultPluginInterface()
returns the default plugin interface that can be used to access plugin functionality without an explicit plugin

Returns:
null if unavailable

getPlugins

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

Returns:
Since:
2.1.0.0

getPlugins

public abstract PluginInterface[] getPlugins(boolean expect_partial_result)

firePluginEvent

public abstract void firePluginEvent(int event_type)

getPluginInstaller

public abstract PluginInstaller getPluginInstaller()

refreshPluginList

public final void refreshPluginList()

refreshPluginList

public abstract void refreshPluginList(boolean initialise)
Since:
3.1.1.1

isSilentRestartEnabled

public abstract boolean isSilentRestartEnabled()

isInitialized

public abstract boolean isInitialized()

executeCloseAction

public abstract void executeCloseAction(String action)
                                 throws PluginException
Parameters:
action - one of the above CA_
Throws:
PluginException
Since:
5701

getPluginInterfaceByID

public abstract PluginInterface getPluginInterfaceByID(String id)
returns the plugin interface with a given id, or null if not found

Parameters:
id -
Returns:
Since:
2.1.0.0

getPluginInterfaceByClass

public abstract PluginInterface getPluginInterfaceByClass(String class_name)
Since:
2.1.0.0

getPluginInterfaceByClass

public abstract PluginInterface getPluginInterfaceByClass(Class c)

getPluginsWithMethod

public abstract List<PluginInterface> getPluginsWithMethod(String name,
                                                           Class<?>[] parameters)
*since 5201