Methods Summary |
---|
public void | addColumnToMyTorrentsTable(java.lang.String columnName, org.gudy.azureus2.plugins.ui.tables.mytorrents.PluginMyTorrentsItemFactory item)
Debug.out( "Method PluginInterface::addColumnToMyTorrentsTable deprecated. Use getUIManager().getTableManager().createColumn" );
|
public void | addColumnToPeersTable(java.lang.String columnName, org.gudy.azureus2.plugins.ui.tables.peers.PluginPeerItemFactory item)
Debug.out( "Method PluginInterface::addColumnToPeersTable deprecated. Use getUIManager().getTableManager().createColumn" );
|
public void | addConfigSection(org.gudy.azureus2.plugins.ui.config.ConfigSection section)
ConfigSectionRepository.getInstance().addConfigSection(section);
configSections.add(section);
|
public void | addConfigUIParameters(org.gudy.azureus2.plugins.ui.config.Parameter[] parameters, java.lang.String displayName)
ParameterRepository.getInstance().addPlugin(parameters, displayName);
|
public void | addEventListener(PluginEventListener l)
event_listeners.add(l);
|
public void | addListener(PluginListener l)
listeners.add(l);
if ( initialiser.isInitialisationComplete()){
l.initializationComplete();
}
|
public void | addView(PluginView view)
getUIManager().getSWTManager().addView(view);
|
protected void | closedownComplete()
for (int i=0;i<listeners.size();i++){
try{
((PluginListener)listeners.get(i)).closedownComplete();
}catch( Throwable e ){
Debug.printStackTrace( e );
}
}
for (int i=0;i<children.size();i++){
((PluginInterfaceImpl)children.get(i)).closedownComplete();
}
|
protected void | closedownInitiated()
for (int i=0;i<listeners.size();i++){
try{
((PluginListener)listeners.get(i)).closedownInitiated();
}catch( Throwable e ){
Debug.printStackTrace( e );
}
}
for (int i=0;i<children.size();i++){
((PluginInterfaceImpl)children.get(i)).closedownInitiated();
}
|
public void | firePluginEvent(PluginEvent event)
for (int i=0;i<event_listeners.size();i++){
try{
((PluginEventListener)event_listeners.get(i)).handleEvent( event );
}catch( Throwable e ){
Debug.printStackTrace( e );
}
}
for (int i=0;i<children.size();i++){
((PluginInterfaceImpl)children.get(i)).firePluginEvent(event);
}
|
protected void | generateEvidence(IndentWriter writer)
writer.println( getPluginName());
try{
writer.indent();
writer.println( "id:" + getPluginID() + ",version:" + getPluginVersion());
String user_dir = FileUtil.getUserFile( "plugins" ).toString();
String shared_dir = FileUtil.getApplicationFile( "plugins" ).toString();
String plugin_dir = getPluginDirectoryName();
String type;
if ( plugin_dir.startsWith( shared_dir )){
type = "shared";
}else if ( plugin_dir.startsWith( user_dir )){
type = "per-user";
}else{
type = "built-in";
}
writer.println( "type:" + type + ",enabled:" + !isDisabled() + ",operational:" + isOperational());
}finally{
writer.exdent();
}
|
public java.lang.String | getAzureusName()
return( Constants.AZUREUS_NAME );
|
public java.lang.String | getAzureusVersion()
return( Constants.AZUREUS_VERSION );
|
public org.gudy.azureus2.plugins.clientid.ClientIDManager | getClientIDManager()
return( ClientIDManagerImpl.getSingleton());
|
public org.gudy.azureus2.plugins.ui.config.ConfigSection[] | getConfigSections()
return (ConfigSection[]) configSections.toArray(new ConfigSection[0]);
|
public org.gudy.azureus2.plugins.network.ConnectionManager | getConnectionManager()
return ConnectionManagerImpl.getSingleton( initialiser.getAzureusCore());
|
public org.gudy.azureus2.plugins.ddb.DistributedDatabase | getDistributedDatabase()
return( DDBaseImpl.getSingleton(initialiser.getAzureusCore()));
|
public DownloadManager | getDownloadManager()
return( DownloadManagerImpl.getSingleton(initialiser.getAzureusCore()));
|
public org.gudy.azureus2.plugins.ipc.IPCInterface | getIPC()
return( ipc_interface );
|
public org.gudy.azureus2.plugins.ipfilter.IPFilter | getIPFilter()
return( new IPFilterImpl());
|
public java.lang.Object | getInitializerKey()
return( initialiser_key );
|
public PluginInterface | getLocalPluginInterface(java.lang.Class plugin_class, java.lang.String id)
try{
Plugin p = (Plugin)plugin_class.newInstance();
PluginInterfaceImpl pi =
new PluginInterfaceImpl(
p,
initialiser,
initialiser_key,
class_loader,
key + "." + id,
props,
pluginDir,
plugin_id + "." + id,
plugin_version );
p.initialize( pi );
children.add( pi );
return( pi );
}catch( Throwable e ){
if ( e instanceof PluginException ){
throw((PluginException)e);
}
throw( new PluginException( "Local initialisation fails", e ));
}
|
public org.gudy.azureus2.plugins.logging.Logger | getLogger()
if ( logger == null ){
logger = new LoggerImpl( this );
}
return( logger );
|
public org.gudy.azureus2.plugins.messaging.MessageManager | getMessageManager()
return MessageManagerImpl.getSingleton( initialiser.getAzureusCore() );
|
public PeerProtocolManager | getPeerProtocolManager()
return( PeerProtocolManagerImpl.getSingleton());
|
public org.gudy.azureus2.plugins.platform.PlatformManager | getPlatformManager()
return( PlatformManagerFactory.getPlatformManager());
|
public Plugin | getPlugin()
return( plugin );
|
public java.lang.ClassLoader | getPluginClassLoader()
return( class_loader );
|
public java.lang.String | getPluginConfigKey()
return( pluginConfigKey );
|
public org.gudy.azureus2.plugins.ui.config.PluginConfigUIFactory | getPluginConfigUIFactory()
return new PluginConfigUIFactoryImpl(config,pluginConfigKey);
|
public java.lang.String | getPluginDirectoryName()
return pluginDir;
|
public java.lang.String | getPluginID()
String id = (String)props.get("plugin.id");
if ( id == null ){
id = plugin_id;
}
return( id==null?"<none>":id );
|
public PluginManager | getPluginManager()
return( initialiser.getPluginManager());
|
public java.lang.String | getPluginName()
String name = null;
if ( props != null ){
name = (String)props.get( "plugin.name");
}
if ( name == null ){
try{
name = new File(pluginDir).getName();
}catch( Throwable e ){
}
}
if ( name == null || name.length() == 0 ){
name = plugin.getClass().getName();
}
return( name );
|
public java.util.Properties | getPluginProperties()
return(props);
|
public java.lang.String | getPluginVersion()
String version = (String)props.get("plugin.version");
if ( version == null ){
version = plugin_version;
}
return( version );
|
public PluginConfig | getPluginconfig()
return config;
|
public ShareManager | getShareManager()
return( ShareManagerImpl.getSingleton());
|
public ShortCuts | getShortCuts()
return( new ShortCutsImpl(this));
|
public TorrentManager | getTorrentManager()
return( TorrentManagerImpl.getSingleton().specialise( this ));
|
public org.gudy.azureus2.plugins.tracker.Tracker | getTracker()
return( TrackerImpl.getSingleton());
|
public UIManager | getUIManager()
return( new UIManagerImpl( this ));
|
public UpdateManager | getUpdateManager()
return( UpdateManagerImpl.getSingleton( initialiser.getAzureusCore()));
|
public Utilities | getUtilities()
return( new UtilitiesImpl( initialiser.getAzureusCore(), this ));
|
protected void | initialisationComplete()
for (int i=0;i<listeners.size();i++){
try{
((PluginListener)listeners.get(i)).initializationComplete();
}catch( Throwable e ){
Debug.printStackTrace( e );
}
}
for (int i=0;i<children.size();i++){
((PluginInterfaceImpl)children.get(i)).initialisationComplete();
}
|
public boolean | isBuiltIn()
String dir = getPluginDirectoryName();
if ( dir == null ){
return( PluginInitializer.isLoadingBuiltin());
}
return( dir.length() == 0 || getPluginID().equals( "azupdater" ));
|
public boolean | isDisabled()
return( disabled );
|
public boolean | isInitialisationThread()
return( initialiser.isInitialisationThread());
|
public boolean | isMandatory()
String mand = getPluginProperties().getProperty( "plugin.mandatory");
return( mand != null && mand.trim().toLowerCase().equals("true"));
|
public boolean | isOperational()
return( operational );
|
public boolean | isShared()
String shared_dir = FileUtil.getApplicationFile( "plugins" ).toString();
String plugin_dir = getPluginDirectoryName();
return( plugin_dir.startsWith( shared_dir ));
|
public boolean | isUnloadable()
String dir = getPluginDirectoryName();
// mechanism to override unloadability
boolean disable_unload = getPluginProperties().getProperty( "plugin.unload.disabled", "" ).equalsIgnoreCase( "true" );
if ( disable_unload ){
return( false );
}
// if not dir based then just test this one
if ( dir == null || dir.length() == 0 ){
return(getPlugin() instanceof UnloadablePlugin );
}
List pis = PluginInitializer.getPluginInterfaces();
for (int i=0;i<pis.size();i++){
PluginInterface pi = (PluginInterface)pis.get(i);
String other_dir = pi.getPluginDirectoryName();
if ( other_dir == null || other_dir.length() == 0 ){
continue;
}
if ( dir.equals( other_dir )){
if ( !(pi.getPlugin() instanceof UnloadablePlugin )){
return( false );
}
}
}
for (int i=0;i<children.size();i++){
if ( !((PluginInterface)children.get(i)).isUnloadable()){
return( false );
}
}
return( true );
|
public void | openTorrentFile(java.lang.String fileName)
try{
getDownloadManager().addDownload( new File(fileName));
}catch( DownloadException e ){
throw( new RuntimeException(e));
}
|
public void | openTorrentURL(java.lang.String url)
try{
getDownloadManager().addDownload( new URL( url ));
}catch( Throwable e ){
throw( new RuntimeException(e));
}
|
public void | reload()
// we use the "reload" method to load disabled plugins regardless of whether they are
// unloadable. If currently disabled then no unloading to do anyway
if ( isUnloadable() || isOperational()){
unload();
}
initialiser.reloadPlugin( this );
|
public void | removeConfigSection(org.gudy.azureus2.plugins.ui.config.ConfigSection section)
ConfigSectionRepository.getInstance().removeConfigSection(section);
configSections.remove(section);
|
public void | removeEventListener(PluginEventListener l)
event_listeners.remove(l);
|
public void | removeListener(PluginListener l)
listeners.remove(l);
|
public void | setDisabled(boolean _disabled)
disabled = _disabled;
|
protected void | setOperational(boolean b)
operational = b;
|
public void | setPluginDirectoryName(java.lang.String name)
initialiser_key = new File(name);
pluginDir = name;
|
public void | setPluginName(java.lang.String name)
props.put( "plugin.name", name );
|
public void | setPluginVersion(java.lang.String version)
props.put( "plugin.version", version );
|
public void | uninstall()
PluginInstallerImpl.getSingleton(getPluginManager()).uninstall( this );
|
public void | unload()
if ( !isUnloadable()){
throw( new PluginException( "Plugin isn't unloadable" ));
}
String dir = getPluginDirectoryName();
// if not dir based then just test this one
if ( dir == null || dir.length() == 0 ){
((UnloadablePlugin)getPlugin()).unload();
initialiser.unloadPlugin( this );
}else{
// we must copy the list here as when we unload interfaces they will be
// removed from the original list
List pis = new ArrayList(PluginInitializer.getPluginInterfaces());
for (int i=0;i<pis.size();i++){
PluginInterfaceImpl pi = (PluginInterfaceImpl)pis.get(i);
String other_dir = pi.getPluginDirectoryName();
if ( other_dir == null || other_dir.length() == 0 ){
continue;
}
if ( dir.equals( other_dir )){
((UnloadablePlugin)pi.getPlugin()).unload();
initialiser.unloadPlugin( pi );
}
}
}
for (int i=0;i<children.size();i++){
((PluginInterface)children.get(i)).unload();
}
setOperational(false);
class_loader = null;
|
protected void | unloadSupport()
ipc_interface.unload();
|