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 Object
implements GlobalManagerListener, AEDiagnosticsEvidenceGenerator

Author:
Olivier

Field Summary
static boolean DISABLE_PLUGIN_VERIFICATION
           
static String INTERNAL_PLUGIN_ID
           
 
Constructor Summary
protected PluginInitializer(AzureusCore _azureus_core, AzureusCoreOperation _core_operation)
           
 
Method Summary
static void addInitThread()
           
static void checkAzureusVersion(String name, Properties props, boolean alert_on_fail)
           
static void checkJDKVersion(String name, 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, Object value)
           
protected  void fireEventSupport(int type, 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  List<PluginEvent> getPEVHistory()
           
protected  PluginInterfaceImpl getPluginFromClass(Class cla)
           
protected  PluginInterfaceImpl getPluginFromClass(String class_name)
           
static List<PluginInterfaceImpl> getPluginInterfaces()
           
protected  PluginManager getPluginManager()
           
 PluginInterface[] getPlugins()
           
 PluginInterface[] getPlugins(boolean expect_partial_result)
           
static PluginInitializer getSingleton(AzureusCore azureus_core, AzureusCoreOperation core_operation)
           
 void initialisationComplete()
           
 void initialisePlugins()
           
protected  void initializePluginFromClass(Class plugin_class, String plugin_id, String plugin_config_key, boolean force_enabled, boolean loading_for_startup, boolean initialise)
           
protected  void initializePluginFromInstance(Plugin plugin, String plugin_id, 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)
           
 List loadPlugins(AzureusCore core, boolean bSkipAlreadyLoaded, boolean load_external_plugins, boolean loading_for_startup, boolean initialise_plugins)
           
protected static String normaliseJDK(String jdk)
           
protected static void queueRegistration(Class _class)
           
protected static void queueRegistration(Plugin plugin, String id, 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 String INTERNAL_PLUGIN_ID
See Also:
Constant Field Values
Constructor Detail

PluginInitializer

protected PluginInitializer(AzureusCore _azureus_core,
                            AzureusCoreOperation _core_operation)
Method Detail

getSingleton

public static PluginInitializer getSingleton(AzureusCore azureus_core,
                                             AzureusCoreOperation core_operation)

queueRegistration

protected static void queueRegistration(Class _class)

queueRegistration

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

isLoadingBuiltin

protected static boolean isLoadingBuiltin()

checkAzureusVersion

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

checkJDKVersion

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

normaliseJDK

protected static String normaliseJDK(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 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(Class plugin_class,
                                         String plugin_id,
                                         String plugin_config_key,
                                         boolean force_enabled,
                                         boolean loading_for_startup,
                                         boolean initialise)
                                  throws PluginException
Throws:
PluginException

initializePluginFromInstance

protected void initializePluginFromInstance(Plugin plugin,
                                            String plugin_id,
                                            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 List<PluginEvent> getPEVHistory()

fireEventSupport

protected void fireEventSupport(int type,
                                Object value)

fireEvent

public static void fireEvent(int type)

fireEvent

public static void fireEvent(int type,
                             Object value)

waitForPluginEvents

public static void waitForPluginEvents()

initialisationComplete

public void initialisationComplete()

isInitialisationComplete

protected boolean isInitialisationComplete()

getPluginInterfaces

public static List<PluginInterfaceImpl> getPluginInterfaces()

getPlugins

public PluginInterface[] getPlugins()

getPlugins

public PluginInterface[] getPlugins(boolean expect_partial_result)

getPluginManager

protected PluginManager getPluginManager()

getPluginFromClass

protected PluginInterfaceImpl getPluginFromClass(Class cla)

getPluginFromClass

protected PluginInterfaceImpl getPluginFromClass(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()