public final class SRE extends Object
Depending on the implementation of the SRE, an instance of this SRE access point could be injected.
For declaring a SRE bootstrap, the library that contains the contributing SRE must declared
a specific service implementation of SRE
. The declaration of this service must be
done by creating a file into the folder META-INF/services/io.sarl.lang.core.SREBootstrap
.
This file contains a single line that is the fully qualified name of the SRE
's implementation.
ServiceLoader
Modifier and Type | Method and Description |
---|---|
static SREBootstrap |
getBootstrap()
Find and reply the current SRE.
|
static Iterable<URL> |
getBootstrappedLibraries()
Replies all the libraries that contains a SRE bootstrap.
|
static Iterable<URL> |
getServiceLibraries(libraryName : String)
Replies all the libraries that contains a Java service for the given service name.
|
static ServiceLoader<SREBootstrap> |
getServiceLoader()
Replies all the installed SRE into the class path.
|
static ServiceLoader<SREBootstrap> |
getServiceLoader(onlyInstalledInJRE : boolean)
Replies all the installed SRE into the class path.
|
static void |
main(args : String[])
Launch the SRE from a declared bootstrap within the JRE services.
|
static void |
resetServiceLoader()
Reset the service loader for the SRE bootstrap.
|
static void |
setBootstrap(sre : SREBootstrap)
Change the current SRE.
|
public static def
resetServiceLoader() : void
SRE
@Pure
public static def
getServiceLoader() : ServiceLoader<SREBootstrap>
SRE
@Pure
public static def
getServiceLoader(onlyInstalledInJRE : boolean) : ServiceLoader<SREBootstrap>
SRE
onlyInstalledInJRE
- indicates if the services will be considered only into the libraries that are
installed into the JRE. If true
, only the libraries into the JRE will be considered and
the application libraries will be ignored. If false
, the application libraries will be
considered as well.@Pure
public static def
getBootstrappedLibraries() : Iterable<URL>
SRE
@Pure
public static def
getServiceLibraries(libraryName : String) : Iterable<URL>
SRE
libraryName
- the name of the service that is the fully qualified name of the service class.public static def
setBootstrap(sre : SREBootstrap) : void
SRE
sre
- the current SRE.public static def
main(args : String[]) : void
throws Exception
SRE
args
- the command-line arguments. The first argument must be the qualified name of the agent to be launched.
The other values are directly given to the launched agent as initialization parameter.Exception
- in case of error.@Pure
public static def
getBootstrap() : SREBootstrap
SRE
null
.IllegalStateException
- if a SRE cannot be found.Copyright © 2021 the original authors or authors.