net.sf.taverna.raven
Class Loader

java.lang.Object
  extended by net.sf.taverna.raven.Loader

public class Loader
extends java.lang.Object

Bootstrap a raven installation, allows a non raven aware loader to create a repository structure etc and boot into an artifact class loader driven world view without having to actually have raven installed to begin with. Also handles splash screen management and a few other conveniences.

Author:
Tom Oinn, Matthew Pocock

Field Summary
static Log logger
           
 
Constructor Summary
Loader()
           
 
Method Summary
static java.lang.Class doRavenMagic(java.io.File localRepositoryLocation, java.net.URL[] remoteRepositories, java.lang.String targetGroup, java.lang.String targetArtifact, java.lang.String targetVersion, java.lang.String className, RepositoryListener listener)
          Initialize raven's repository and load the specified artifact into it.
static java.lang.Class doRavenMagic(java.lang.String ravenVersion, java.io.File localRepositoryLocation, java.net.URL[] remoteRepositories, java.lang.String targetGroup, java.lang.String targetArtifact, java.lang.String targetVersion, java.lang.String className, java.net.URL splashScreenURL, int splashTime)
          Initialize raven's repository, show a splash screen and load the specified artifact into it.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static Log logger
Constructor Detail

Loader

public Loader()
Method Detail

doRavenMagic

public static java.lang.Class doRavenMagic(java.io.File localRepositoryLocation,
                                           java.net.URL[] remoteRepositories,
                                           java.lang.String targetGroup,
                                           java.lang.String targetArtifact,
                                           java.lang.String targetVersion,
                                           java.lang.String className,
                                           RepositoryListener listener)
                                    throws ArtifactNotFoundException,
                                           ArtifactStateException,
                                           java.lang.ClassNotFoundException
Initialize raven's repository and load the specified artifact into it. Returns the named class from the classloader containing the specified artifact and all of its dependencies.

Parameters:
localRepositoryLocation - Directory on disk to use as a local cache for m2 artifacts
remoteRepositories - array of URLs to remote Maven2 repositories
targetGroup - Group ID of the Maven2 artifact to bootstrap from
targetArtifact - Artifact ID of the Maven2 artifact to bootstrap from
targetVersion - Version of the Maven2 artifact to bootstrap from
className - Class name to return from the target artifact
listener - a RepositoryListener that will be informed of repository events
Returns:
Class object loaded by raven as specified by the arguments to this method call
Throws:
ArtifactNotFoundException
ArtifactStateException
java.lang.ClassNotFoundException

doRavenMagic

public static java.lang.Class doRavenMagic(java.lang.String ravenVersion,
                                           java.io.File localRepositoryLocation,
                                           java.net.URL[] remoteRepositories,
                                           java.lang.String targetGroup,
                                           java.lang.String targetArtifact,
                                           java.lang.String targetVersion,
                                           java.lang.String className,
                                           java.net.URL splashScreenURL,
                                           int splashTime)
                                    throws ArtifactNotFoundException,
                                           ArtifactStateException,
                                           java.lang.ClassNotFoundException
Initialize raven's repository, show a splash screen and load the specified artifact into it. Returns the named class from the classloader containing the specified artifact and all of its dependencies. This will additionally download the specified version of raven. .

Parameters:
ravenVersion - The version of Raven to install or check in the local repository
localRepositoryLocation - Directory on disk to use as a local cache for m2 artifacts
remoteRepositories - array of URLs to remote Maven2 repositories
targetGroup - Group ID of the Maven2 artifact to bootstrap from
targetArtifact - Artifact ID of the Maven2 artifact to bootstrap from
targetVersion - Version of the Maven2 artifact to bootstrap from
className - Class name to return from the target artifact
splashScreenURL - URL to a splash screen image of a form a JLabel can use
splashTime - Time in milliseconds to display the splashscreen, splashscreen is displayed while either this timeout is not exceeded or there is any raven activity.
Returns:
Class object loaded by raven as specified by the arguments to this method call
Throws:
ArtifactNotFoundException
ArtifactStateException
java.lang.ClassNotFoundException