io.sarl.lang.core
Class SRE
final class SRE
extends java.lang.Object
Represents an access point to the SARL run-time environment (SRE). This access point may be used for accessing the underlying SRE independently of its implementation.

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.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
core
Since:
0.6
See:
java.util.ServiceLoader
Action Summary
Modifier and type Action and description
static SREBootstrap getBootstrap
Find and reply the current SRE.
static java.lang.Iterable<T> getBootstrappedLibraries
Replies all the libraries that contains a SRE bootstrap.
static java.lang.Iterable<T> getServiceLibraries(String)
Replies all the libraries that contains a Java service for the given service name.
static java.util.ServiceLoader<S> getServiceLoader
Replies all the installed SRE into the class path.
static java.util.ServiceLoader<S> getServiceLoader(boolean)
Replies all the installed SRE into the class path.
static void main(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(SREBootstrap)
Change the current SRE.
Action Details
getBootstrap
def getBootstrap : SREBootstrap
Find and reply the current SRE.
Returns:
the current SRE, never null .
Throws exception:
  • java.lang.IllegalStateException: if a SRE cannot be found.
getBootstrappedLibraries
def getBootstrappedLibraries : java.lang.Iterable<T>
Replies all the libraries that contains a SRE bootstrap.
Returns:
the set of libraries.
Since:
0.7
getServiceLibraries(String)
def getServiceLibraries(String) : java.lang.Iterable<T>
Replies all the libraries that contains a Java service for the given service name.
Parameters:
libraryName - the name of the service that is the fully qualified name of the service class.
Returns:
the set of libraries.
Since:
0.12
getServiceLoader
def getServiceLoader : java.util.ServiceLoader<S>
Replies all the installed SRE into the class path.
Returns:
the installed SRE.
getServiceLoader(boolean)
def getServiceLoader(boolean) : java.util.ServiceLoader<S>
Replies all the installed SRE into the class path.
Parameters:
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.
Returns:
the installed SRE.
main(String)
def main(String)

throws java.lang.Exception

Launch the SRE from a declared bootstrap within the JRE services. This execution entry point does not provide advanced interface, e.g. command line options.
Parameters:
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.
Throws exception:
  • java.lang.Exception: in case of error.
Since:
0.7
resetServiceLoader
def resetServiceLoader
Reset the service loader for the SRE bootstrap.
setBootstrap(SREBootstrap)
def setBootstrap(SREBootstrap)
Change the current SRE.
Parameters:
sre - the current SRE.