Methods Summary |
---|
public void | firePluginEvent(int ev)
PluginInitializer.fireEvent( ev );
|
public PluginInterface | getDefaultPluginInterface()
return( PluginInitializer.getDefaultInterface());
|
public org.gudy.azureus2.plugins.installer.PluginInstaller | getPluginInstaller()
return( PluginInstallerImpl.getSingleton(this));
|
public PluginInterface | getPluginInterfaceByClass(java.lang.String class_name)
PluginInterface[] p = getPluginInterfaces();
for (int i=0;i<p.length;i++){
if ( p[i].getPlugin().getClass().getName().equals( class_name )){
return( p[i]);
}
}
return( null );
|
public PluginInterface | getPluginInterfaceByClass(java.lang.Class c)
PluginInterface[] p = getPluginInterfaces();
for (int i=0;i<p.length;i++){
if ( p[i].getPlugin().getClass().equals( c )){
return( p[i]);
}
}
return( null );
|
public PluginInterface | getPluginInterfaceByID(java.lang.String id)
PluginInterface[] p = getPluginInterfaces();
for (int i=0;i<p.length;i++){
if ( p[i].getPluginID().equalsIgnoreCase( id )){
return( p[i]);
}
}
return( null );
|
public PluginInterface[] | getPluginInterfaces()
List l = PluginInitializer.getPluginInterfaces();
PluginInterface[] res = new PluginInterface[l.size()];
l.toArray(res);
return( res );
|
public PluginInterface[] | getPlugins()
return( pi.getPlugins());
|
protected static org.gudy.azureus2.pluginsimpl.local.PluginManagerImpl | getSingleton(PluginInitializer pi)
try{
class_mon.enter();
if ( singleton == null ){
singleton = new PluginManagerImpl( pi );
}
return( singleton );
}finally{
class_mon.exit();
}
|
public void | refreshPluginList()
List loadedPlugins = pi.loadPlugins(pi.getAzureusCore(), true);
for (Iterator iter = loadedPlugins.iterator(); iter.hasNext();) {
PluginInterfaceImpl plugin = (PluginInterfaceImpl) iter.next();
if (!plugin.isOperational()) {
try {
pi.reloadPlugin(plugin);
} catch (PluginException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
|
public static void | registerPlugin(java.lang.Class plugin_class)
PluginInitializer.queueRegistration( plugin_class );
|
public static void | registerPlugin(Plugin plugin, java.lang.String id)
PluginInitializer.queueRegistration( plugin, id );
|
public static void | restartAzureus()
if ( !running ){
throw( new RuntimeException( "Azureus is not running"));
}
try{
azureus_core.requestRestart();
}catch( Throwable e ){
throw( new PluginException( "PluginManager: Azureus restart action failed", e));
}
running = false;
|
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
azureus_core = _core;
running = true;
|
public static PluginManager | startAzureus(int ui_type, java.util.Properties properties)
try{
class_mon.enter();
if ( running ){
throw( new RuntimeException( "Azureus is already running"));
}
running = true;
}finally{
class_mon.exit();
}
// there's a small window here when an immediate "stop" wouldn't work coz
// this code would carry on after the stop and start. However, can't easily
// fix this here...
if ( ui_type == PluginManager.UI_NONE ){
// can't invoke directly as the ui.common stuff isn't part of the core distribution
// org.gudy.azureus2.ui.common.Main.main( new String[]{"--ui=console"});
try{
azureus_core = AzureusCoreFactory.create();
azureus_core.start();
}catch( Throwable e ){
Debug.printStackTrace( e );
// some idiot (me) forgot to add the exception to the i/f and now we
// can't add it as is stuffs existing plugins...
throw( new RuntimeException( "Azureus failed to start", e ));
}
}else if ( ui_type == PluginManager.UI_SWT ){
if ( properties != null ){
String mi = (String)properties.get( PluginManager.PR_MULTI_INSTANCE );
if ( mi != null && mi.equalsIgnoreCase("true")){
System.setProperty( org.gudy.azureus2.ui.swt.Main.PR_MULTI_INSTANCE, "true" );
}
}
org.gudy.azureus2.ui.swt.Main.main(new String[0]);
}
if ( azureus_core == null ){
throw( new RuntimeException( "Azureus core failed to initialise" ));
}
return( azureus_core.getPluginManager());
|
public static void | stopAzureus()
try{
class_mon.enter();
if ( !running ){
throw( new RuntimeException( "Azureus is not running"));
}
try{
azureus_core.requestStop();
}catch( Throwable e ){
throw( new PluginException( "PluginManager: Azureus close action failed", e));
}
running = false;
}finally{
class_mon.exit();
}
|