org.gudy.azureus2.pluginsimpl.local
Class PluginInitializer

java.lang.Object
  extended by org.gudy.azureus2.pluginsimpl.local.PluginInitializer
All Implemented Interfaces:
GlobalManagerListener, AEDiagnosticsEvidenceGenerator

public class PluginInitializer
extends java.lang.Object
implements GlobalManagerListener, AEDiagnosticsEvidenceGenerator

Author:
Olivier

Field Summary
static boolean DISABLE_PLUGIN_VERIFICATION
           
static java.lang.String INTERNAL_PLUGIN_ID
           
 
Constructor Summary
protected PluginInitializer(AzureusCore _azureus_core)
           
 
Method Summary
static void addInitThread()
           
static void checkAzureusVersion(java.lang.String name, java.util.Properties props, boolean alert_on_fail)
           
static void checkJDKVersion(java.lang.String name, java.util.Properties props, boolean alert_on_fail)
           
protected  void checkPluginsInitialised()
           
 void destroyed()
           
 void destroyInitiated()
           
 void downloadManagerAdded(DownloadManager dm)
           
 void downloadManagerRemoved(DownloadManager dm)
           
protected  void fireCreated(PluginInterfaceImpl pi)
           
static void fireEvent(int type)
           
static void fireEvent(int type, java.lang.Object value)
           
protected  void fireEventSupport(int type, java.lang.Object value)
           
protected  void fireOperational(PluginInterfaceImpl pi, boolean op)
           
 void generate(IndentWriter writer)
           
protected  AzureusCore getAzureusCore()
           
static PluginInterface getDefaultInterface()
           
protected  PluginInterface getDefaultInterfaceSupport()
           
protected  GlobalManager getGlobalManager()
           
protected  java.util.List<PluginEvent> getPEVHistory()
           
protected  PluginInterfaceImpl getPluginFromClass(java.lang.Class cla)
           
protected  PluginInterfaceImpl getPluginFromClass(java.lang.String class_name)
           
static java.util.List<PluginInterfaceImpl> getPluginInterfaces()
           
protected  PluginManager getPluginManager()
           
 PluginInterface[] getPlugins()
           
 PluginInterface[] getPlugins(boolean expect_partial_result)
           
static PluginInitializer getSingleton(AzureusCore azureus_core)
           
 void initialisationComplete()
           
 void initialisePlugins()
           
protected  void initializePluginFromClass(java.lang.Class plugin_class, java.lang.String plugin_id, java.lang.String plugin_config_key, boolean force_enabled, boolean loading_for_startup, boolean initialise)
           
protected  void initializePluginFromInstance(Plugin plugin, java.lang.String plugin_id, java.lang.String plugin_config_key)
           
static boolean isCoreOrVerifiedPlugin()
           
protected  boolean isInitialisationComplete()
           
protected  boolean isInitialisationThread()
           
protected  boolean isInitialized()
           
static boolean isInitThread()
           
protected static boolean isLoadingBuiltin()
           
static boolean isVerified(PluginInterface pi, Plugin plugin)
           
 java.util.List loadPlugins(AzureusCore core, boolean bSkipAlreadyLoaded, boolean load_external_plugins, boolean loading_for_startup, boolean initialise_plugins)
           
protected static java.lang.String normaliseJDK(java.lang.String jdk)
           
protected static void queueRegistration(java.lang.Class _class)
           
protected static void queueRegistration(Plugin plugin, java.lang.String id, java.lang.String config_key)
           
protected  void reloadPlugin(PluginInterfaceImpl pi)
           
protected  void reloadPlugin(PluginInterfaceImpl pi, boolean loading_for_startup, boolean initialise)
           
static void removeInitThread()
           
protected  void runPEVTask(AERunnable run)
           
 void seedingStatusChanged(boolean seeding_only_mode, boolean b)
          Notification of global seeding status changes.
protected static void setVerified(PluginInterfaceImpl pi, Plugin plugin, boolean v, boolean bad)
           
protected  void unloadPlugin(PluginInterfaceImpl pi)
           
static void waitForPluginEvents()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISABLE_PLUGIN_VERIFICATION

public static final boolean DISABLE_PLUGIN_VERIFICATION
See Also:
Constant Field Values

INTERNAL_PLUGIN_ID

public static final java.lang.String INTERNAL_PLUGIN_ID
See Also:
Constant Field Values
Constructor Detail

PluginInitializer

protected PluginInitializer(AzureusCore _azureus_core)
Method Detail

getSingleton

public static PluginInitializer getSingleton(AzureusCore azureus_core)

queueRegistration

protected static void queueRegistration(java.lang.Class _class)

queueRegistration

protected static void queueRegistration(Plugin plugin,
                                        java.lang.String id,
                                        java.lang.String config_key)

isLoadingBuiltin

protected static boolean isLoadingBuiltin()

checkAzureusVersion

public static void checkAzureusVersion(java.lang.String name,
                                       java.util.Properties props,
                                       boolean alert_on_fail)
                                throws PluginException
Throws:
PluginException

checkJDKVersion

public static void checkJDKVersion(java.lang.String name,
                                   java.util.Properties props,
                                   boolean alert_on_fail)
                            throws PluginException
Throws:
PluginException

normaliseJDK

protected static java.lang.String normaliseJDK(java.lang.String jdk)

fireCreated

protected void fireCreated(PluginInterfaceImpl pi)

fireOperational

protected void fireOperational(PluginInterfaceImpl pi,
                               boolean op)

addInitThread

public static void addInitThread()

removeInitThread

public static void removeInitThread()

isInitThread

public static boolean isInitThread()

isInitialisationThread

protected boolean isInitialisationThread()

loadPlugins

public java.util.List loadPlugins(AzureusCore core,
                                  boolean bSkipAlreadyLoaded,
                                  boolean load_external_plugins,
                                  boolean loading_for_startup,
                                  boolean initialise_plugins)

initialisePlugins

public void initialisePlugins()

checkPluginsInitialised

protected void checkPluginsInitialised()

isInitialized

protected boolean isInitialized()

initializePluginFromClass

protected void initializePluginFromClass(java.lang.Class plugin_class,
                                         java.lang.String plugin_id,
                                         java.lang.String plugin_config_key,
                                         boolean force_enabled,
                                         boolean loading_for_startup,
                                         boolean initialise)
                                  throws PluginException
Throws:
PluginException

initializePluginFromInstance

protected void initializePluginFromInstance(Plugin plugin,
                                            java.lang.String plugin_id,
                                            java.lang.String plugin_config_key)
                                     throws PluginException
Throws:
PluginException

unloadPlugin

protected void unloadPlugin(PluginInterfaceImpl pi)

reloadPlugin

protected void reloadPlugin(PluginInterfaceImpl pi)
                     throws PluginException
Throws:
PluginException

reloadPlugin

protected void reloadPlugin(PluginInterfaceImpl pi,
                            boolean loading_for_startup,
                            boolean initialise)
                     throws PluginException
Throws:
PluginException

getAzureusCore

protected AzureusCore getAzureusCore()

getGlobalManager

protected GlobalManager getGlobalManager()

getDefaultInterface

public static PluginInterface getDefaultInterface()

getDefaultInterfaceSupport

protected PluginInterface getDefaultInterfaceSupport()

downloadManagerAdded

public void downloadManagerAdded(DownloadManager dm)
Specified by:
downloadManagerAdded in interface GlobalManagerListener

downloadManagerRemoved

public void downloadManagerRemoved(DownloadManager dm)
Specified by:
downloadManagerRemoved in interface GlobalManagerListener

destroyInitiated

public void destroyInitiated()
Specified by:
destroyInitiated in interface GlobalManagerListener

destroyed

public void destroyed()
Specified by:
destroyed in interface GlobalManagerListener

seedingStatusChanged

public void seedingStatusChanged(boolean seeding_only_mode,
                                 boolean b)
Description copied from interface: GlobalManagerListener
Notification of global seeding status changes.

Specified by:
seedingStatusChanged in interface GlobalManagerListener
Parameters:
seeding_only_mode - true if only seeding torrents (no downloads), false otherwise
b - - as above but true if queued seeds

runPEVTask

protected void runPEVTask(AERunnable run)

getPEVHistory

protected java.util.List<PluginEvent> getPEVHistory()

fireEventSupport

protected void fireEventSupport(int type,
                                java.lang.Object value)

fireEvent

public static void fireEvent(int type)

fireEvent

public static void fireEvent(int type,
                             java.lang.Object value)

waitForPluginEvents

public static void waitForPluginEvents()

initialisationComplete

public void initialisationComplete()

isInitialisationComplete

protected boolean isInitialisationComplete()

getPluginInterfaces

public static java.util.List<PluginInterfaceImpl> getPluginInterfaces()

getPlugins

public PluginInterface[] getPlugins()

getPlugins

public PluginInterface[] getPlugins(boolean expect_partial_result)

getPluginManager

protected PluginManager getPluginManager()

getPluginFromClass

protected PluginInterfaceImpl getPluginFromClass(java.lang.Class cla)

getPluginFromClass

protected PluginInterfaceImpl getPluginFromClass(java.lang.String class_name)

generate

public void generate(IndentWriter writer)
Specified by:
generate in interface AEDiagnosticsEvidenceGenerator

setVerified

protected static void setVerified(PluginInterfaceImpl pi,
                                  Plugin plugin,
                                  boolean v,
                                  boolean bad)
                           throws PluginException
Throws:
PluginException

isVerified

public static boolean isVerified(PluginInterface pi,
                                 Plugin plugin)

isCoreOrVerifiedPlugin

public static boolean isCoreOrVerifiedPlugin()