Cytoscape 2.8.0 API

cytoscape.plugin
Class PluginManager

java.lang.Object
  extended by cytoscape.plugin.PluginManager

public class PluginManager
extends Object

Author:
skillcoy

Field Summary
protected  PluginTracker pluginTracker
           
 
Method Summary
 void clearErrorList()
          Clears the loading error list.
 void delete()
          Takes all objects on the "to-delete" list and deletes them.
 void delete(DownloadableInfo Obj)
          Marks the given object for deletion the next time Cytoscape is restarted.
 DownloadableInfo download(DownloadableInfo Obj)
          Downloads given object to the temporary directory.
 DownloadableInfo download(DownloadableInfo Obj, TaskMonitor taskMonitor)
          Downloads given object to the temporary directory.
 List<DownloadableInfo> findUpdates(DownloadableInfo Info)
          Get list of plugins that would update the given plugin.
static URLClassLoader getClassLoader()
           
 List<DownloadableInfo> getDownloadables(PluginStatus Status)
          Get a list of downloadable objects by status.
 List<Throwable> getLoadingErrors()
          /** Returns list of loading exceptions.
 File getPluginManageDirectory()
           
static PluginManager getPluginManager()
          Get the PluginManager object.
protected static PluginManager getPluginManager(PluginTracker Tracker)
          This should ONLY be used by tests!!
static List<URL> getPluginURLs()
           
static List<String> getResourcePlugins()
           
 List<DownloadableInfo> inquire(String Url)
          Calls the given url, expects document describing plugins available for download
 void install()
          Sets all plugins on the "install" list to "current"
 void install(DownloadableInfo obj)
          Change the given downloadable object from "install" to "current" status
 void loadPlugin(DownloadableInfo i)
           
 void loadPlugin(PluginInfo p)
          Load a single plugin based on the PluginInfo object given
 void loadPlugins(List<String> p)
          Parses the plugin input strings and transforms them into the appropriate URLs or resource names.
protected static boolean recursiveDeleteFiles(File file)
           
protected  void register(CytoscapePlugin Plugin, JarFile Jar)
          Registers a currently installed plugin with tracking object.
protected  boolean removeWebstartInstalls()
          Deletes everything under the webstart install directory.
protected  void resetManager()
          This is used in testing to isolate each test case.
static void setPluginManageDirectory(String loc)
           
 void update(DownloadableInfo Current, DownloadableInfo New)
          Finds the given version of the new object, sets the old object for deletion and downloads new object to temporary directory
 void update(DownloadableInfo currentObj, DownloadableInfo newObj, TaskMonitor taskMonitor)
          Finds the given version of the new object, sets the old object for deletion and downloads new object to temporary directory
static boolean usingWebstartManager()
          Returns true/false based on the System property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pluginTracker

protected PluginTracker pluginTracker
Method Detail

getLoadingErrors

public List<Throwable> getLoadingErrors()
/** Returns list of loading exceptions.


clearErrorList

public void clearErrorList()
Clears the loading error list. Ideally this should be called after checking the list each time.


getClassLoader

public static URLClassLoader getClassLoader()
Returns:
URLClassLoader used to load plugins at startup.

getResourcePlugins

public static List<String> getResourcePlugins()
Returns:
Set of resource plugins from startup

getPluginURLs

public static List<URL> getPluginURLs()
Returns:
Set of plugin URL's from startup

usingWebstartManager

public static boolean usingWebstartManager()
Returns true/false based on the System property. This is what is checked to find out if install/delete/download methods are permitted.

Returns:
true if Cytoscape is in webstart

removeWebstartInstalls

protected boolean removeWebstartInstalls()
Deletes everything under the webstart install directory. Nothing in here should stick around.

Returns:
True if all files deleted successfully

getPluginManager

public static PluginManager getPluginManager()
Get the PluginManager object.

Returns:
PluginManager

setPluginManageDirectory

public static void setPluginManageDirectory(String loc)
Parameters:
loc - Location of plugin download/install directory. If this method is not called the default is .cytoscape/[cytoscape version]/plugins

getPluginManageDirectory

public File getPluginManageDirectory()
Returns:
The current version directory under .cytoscape that includes the plugins/ directory. Ex. //.cytoscape/2.6/plugins

getPluginManager

protected static PluginManager getPluginManager(PluginTracker Tracker)
This should ONLY be used by tests!!

Parameters:
Tracker -
Returns:

resetManager

protected void resetManager()
This is used in testing to isolate each test case. DO NOT USE THIS IN CYTOSCAPE RUNTIME CODE


getDownloadables

public List<DownloadableInfo> getDownloadables(PluginStatus Status)
Get a list of downloadable objects by status. CURRENT: currently installed INSTALL: objects to be installed DELETE: objects to be deleted

Parameters:
Status -
Returns:

inquire

public List<DownloadableInfo> inquire(String Url)
                               throws IOException,
                                      org.jdom.JDOMException
Calls the given url, expects document describing plugins available for download

Parameters:
Url -
Returns:
List of PluginInfo objects
Throws:
IOException
org.jdom.JDOMException

register

protected void register(CytoscapePlugin Plugin,
                        JarFile Jar)
Registers a currently installed plugin with tracking object. Only useful if the plugin was not installed via the install process.

Parameters:
Plugin -
JarFileName -

install

public void install()
Sets all plugins on the "install" list to "current"


install

public void install(DownloadableInfo obj)
Change the given downloadable object from "install" to "current" status

Parameters:
obj -

delete

public void delete(DownloadableInfo Obj)
            throws WebstartException
Marks the given object for deletion the next time Cytoscape is restarted.

Parameters:
Obj -
Throws:
WebstartException

delete

public void delete()
            throws ManagerException
Takes all objects on the "to-delete" list and deletes them. This can only occur at start up.

Throws:
ManagerException - If all files fail to delete
WebstartException - If this method is called from a webstart instance

recursiveDeleteFiles

protected static boolean recursiveDeleteFiles(File file)

findUpdates

public List<DownloadableInfo> findUpdates(DownloadableInfo Info)
                                   throws IOException,
                                          org.jdom.JDOMException
Get list of plugins that would update the given plugin.

Parameters:
Info -
Returns:
List
Throws:
ManagerException
IOException
org.jdom.JDOMException

update

public void update(DownloadableInfo Current,
                   DownloadableInfo New)
            throws IOException,
                   ManagerException,
                   WebstartException
Finds the given version of the new object, sets the old object for deletion and downloads new object to temporary directory

Parameters:
Current - DownloadableInfo object currently installed
New - DownloadableInfo object to install
Throws:
IOException - Fails to download the file.
ManagerException - If the objects don't match or the new one is not a newer version.
WebstartException

update

public void update(DownloadableInfo currentObj,
                   DownloadableInfo newObj,
                   TaskMonitor taskMonitor)
            throws IOException,
                   ManagerException,
                   WebstartException
Finds the given version of the new object, sets the old object for deletion and downloads new object to temporary directory

Parameters:
Current - PluginInfo object currently installed
New - PluginInfo object to install
taskMonitor - TaskMonitor for downloads
Throws:
IOException - Fails to download the file.
ManagerException - If the plugins don't match or the new one is not a newer version.
WebstartException

download

public DownloadableInfo download(DownloadableInfo Obj)
                          throws IOException,
                                 ManagerException
Downloads given object to the temporary directory.

Parameters:
Obj - PluginInfo object to be downloaded
Returns:
File downloaded
Throws:
IOException
ManagerException

download

public DownloadableInfo download(DownloadableInfo Obj,
                                 TaskMonitor taskMonitor)
                          throws IOException,
                                 ManagerException
Downloads given object to the temporary directory. Uses a task monitor if available.

Parameters:
Obj - PluginInfo object to be downloaded
taskMonitor - TaskMonitor
tempDirectory - Download to a different temporary directory. Default is .cytoscape/plugins/[cytoscape version number]
Returns:
File downloaded
Throws:
IOException
ManagerException

loadPlugin

public void loadPlugin(DownloadableInfo i)
                throws MalformedURLException,
                       IOException,
                       ClassNotFoundException,
                       PluginException
Throws:
MalformedURLException
IOException
ClassNotFoundException
PluginException

loadPlugin

public void loadPlugin(PluginInfo p)
                throws ManagerException
Load a single plugin based on the PluginInfo object given

Parameters:
PluginInfo - The plugin to load
Throws:
ManagerException

loadPlugins

public void loadPlugins(List<String> p)
Parses the plugin input strings and transforms them into the appropriate URLs or resource names. The method first checks to see if the


Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.