|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.fluxion.spi.SPIManager
public class SPIManager
A Manager class for Service Provider utilities. This Manager is backed by a Raven repository, which is a dynamic version of Maven that employs runtime loading and deployment of jars. Utility methods are provided for conveniently committing jars, discovering meta data about Maven artifacts, and looking up available artifacts from the repository.
Spring configuration of an SPIManager bean is possible, using properties localRepository, remoteRepositories (a set) and offlineMode (false by default). If you are using spring configuration, this bean will automatically initialise once all properties have been set, as it implementsInitializingBean
. If you are not using spring configuration but are instead
using this class standalone, you should remember to call the
init()
method before use to ensure the Raven repository is
correctly initialiased.
Constructor Summary | |
---|---|
SPIManager()
|
Method Summary | ||
---|---|---|
void |
addMavenRemoteRepository(java.lang.String remoteRepository)
Add a Maven remote repository Raven can use to download artifacts from. |
|
void |
afterPropertiesSet()
Initialises SPIManager once any properties managed by Spring have been set in an application context. |
|
java.lang.String |
getMavenLocalRepository()
Get the local repository used by Maven. |
|
java.util.Set<java.lang.String> |
getMavenRemoteRepositories()
Get the set of remote repositories used by Maven. |
|
boolean |
getOfflineMode()
Get offline mode - whether Raven can connect to the internet to download artifacts |
|
java.lang.String |
getRavenRepository()
Get the local repository used by Raven |
|
|
getServiceProviderClasses(java.lang.Class<SPI> spi)
Get a set of service provider classes that implement the given SPI class. |
|
|
getServiceProviders(java.lang.Class<SPI> spi)
Get a set of service provider instances that implement the given SPI class. |
|
boolean |
hotloadArtifact(java.io.File jarFile)
Add a new Maven artifact from a jar file. |
|
boolean |
hotloadArtifact(java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version)
Add a new artifact from one of the cofigured repositories. |
|
boolean |
init()
Initialise the SPIManager. |
|
void |
removeMavenRemoteRepository(java.lang.String remoteRepository)
Remove a Maven remote repository that Raven has been using to download artifacts from. |
|
void |
setMavenLocalRepository(java.lang.String mavenLocalRepository)
Set the local repository used by Maven for this system. |
|
void |
setMavenRemoteRepositories(java.util.Set<java.lang.String> remoteRepositories)
Set a Set of Maven remote repositories Raven can use to download
artifacts from. |
|
void |
setOfflineMode(boolean offlineMode)
Set offline mode - when this is true, Raven will never download artifacts from remote repositories. |
|
void |
setRavenRepository(java.lang.String localRepository)
Set the local repository Raven will use |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SPIManager()
Method Detail |
---|
public void setRavenRepository(java.lang.String localRepository)
localRepository
- the location (on-disk) Raven will store artifactspublic java.lang.String getRavenRepository()
public void setMavenLocalRepository(java.lang.String mavenLocalRepository)
mavenLocalRepository
- the maven local repositorypublic java.lang.String getMavenLocalRepository()
public void setMavenRemoteRepositories(java.util.Set<java.lang.String> remoteRepositories)
Set
of Maven remote repositories Raven can use to download
artifacts from. This should include at least the Maven central
repository.
remoteRepositories
- a set of remote repositoriespublic java.util.Set<java.lang.String> getMavenRemoteRepositories()
public void addMavenRemoteRepository(java.lang.String remoteRepository)
remoteRepository
- a remote repository url to addpublic void removeMavenRemoteRepository(java.lang.String remoteRepository)
remoteRepository
- a remote repository url to removepublic void setOfflineMode(boolean offlineMode)
offlineMode
- true if Raven should never connect to the internetpublic boolean getOfflineMode()
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
- if there is a problem initialising this beanpublic boolean init()
public boolean hotloadArtifact(java.io.File jarFile)
getServiceProviders(Class)
jarFile
- the jar file to hotload
public boolean hotloadArtifact(java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
getServiceProviders(Class)
groupId
- the group id of the maven artifact to importartifactId
- the artifact id of the artifact to importversion
- the version of the artifact to import
public <SPI> java.util.Set<SPI> getServiceProviders(java.lang.Class<SPI> spi)
SPI
- the type of the service provider interfacespi
- the service provider interface for services to discover
public <SPI> java.util.Set<java.lang.Class<? extends SPI>> getServiceProviderClasses(java.lang.Class<SPI> spi)
SPI
- the type of the service provider interfacespi
- the service provider interface for services to discover
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |