public interface SREBootstrap
Depending on the implementation of the SRE, an instance of this SRE access point could be injected.
Modifier and Type | Method and Description |
---|---|
void |
addSREListener(listener : SREListener)
Add an observer on the SRE.
|
default Logger |
getKernelLogger()
Replies the logger used by the SRE.
|
<T> T |
getService(serviceType : Class<T>)
Replies the service of the given type that is implemented into the SRE.
|
default UUID |
getUniverseContextUUID()
Replies the UUID of the root/universe context that is given by the user of the bootstrap.
|
default UUID |
getUniverseSpaceUUID()
Replies the UUID of the root/universe default space that is given by the user of the bootstrap.
|
default boolean |
isActive()
Replies if the bootstrap could be used.
|
default boolean |
isRunning()
Replies if the kernel is running.
|
void |
removeSREListener(listener : SREListener)
Remove the given observer on the SRE.
|
default void |
setBootAgentTypeContextUUID()
Force the SRE platform to use a default context identifier that is build upon the classname of the boot agent.
|
void |
setCommandLineArguments(arguments : String[])
Specify arguments that should be used by the SRE as command-line arguments.
|
default void |
setOffline(isOffline : boolean)
Deprecated.
since 0.12, no direct replacement
|
default void |
setRandomContextUUID()
Force the SRE platform to use a random identifier for its default context.
|
default void |
setSpecificContextUUID()
Force the SRE platform to use the identifier hard-coded in the source code for its default context.
|
default void |
setUniverseContextUUID(id : UUID)
Force the identifier of the root/universe context in case the SRE is run when the
default
identifier mode is enabled . |
default void |
setUniverseSpaceUUID(id : UUID)
Force the identifier of the root/universe default space in case the SRE is run when the
default
identifier mode is enabled . |
default void |
setVerboseLevel(level : int)
Force the verbosity level.
|
default void |
shutdown()
Stop the SRE.
|
default void |
shutdown(blocking : boolean)
Stop the SRE.
|
void |
shutdown(timeout : int)
Stop the SRE.
|
void |
startAgent(agentCls : Class<? extends Agent>,
params : Object*)
Launch the SRE and the first agent in the kernel.
|
void |
startAgent(nbAgents : int,
agentCls : Class<? extends Agent>,
params : Object*)
Launch the SRE and the first agent in the kernel.
|
void |
startAgentWithID(agentCls : Class<? extends Agent>,
agentID : UUID,
params : Object*)
Launch the SRE and the first agent in the kernel and assigning a specific UUID.
|
default AgentContext |
startWithoutAgent()
Start the SRE without an agent.
|
AgentContext |
startWithoutAgent(asCommandLineApp : boolean)
Start the SRE without an agent.
|
def
setCommandLineArguments(arguments : String[]) : void
SREBootstrap
arguments
- the command-line arguments.def
startWithoutAgent(asCommandLineApp : boolean) : AgentContext
SREBootstrap
asCommandLineApp
- indicates if the application should be started as a commend-line application.
If true
, the SRE is started and run directly. Then, the "start agent" functions becomes
unusable because the SRE has started everything as it is called from the shell command line.
If false
, the SRE is started in is normal way and all the functions are available according
to their own specifications.
If it not recommended to invoke this function with this argument evaluated to true
.null
there is no context created.SREBootstrap.startWithoutAgent()
default def
startWithoutAgent() : AgentContext
SREBootstrap
null
there is no context created.def
startAgent(agentCls : Class<? extends Agent>,
params : Object*) : void
throws Exception
SREBootstrap
The function #getBootAgentIdentifier()
permits to retrieve the identifier of the first launched agent.
agentCls
- type of the first agent to launch.params
- parameters to pass to the agent as its initialization parameters.Exception
- - if it is impossible to start the platform.#getBootAgentIdentifier()
def
startAgent(nbAgents : int,
agentCls : Class<? extends Agent>,
params : Object*) : void
throws Exception
SREBootstrap
The function #getBootAgentIdentifier()
permits to retrieve the identifier of the first launched agent.
nbAgents
- the number of agents to be launched.agentCls
- type of the first agent to launch.params
- parameters to pass to the agent as its initialization parameters.Exception
- - if it is impossible to start the platform.#getBootAgentIdentifier()
def
startAgentWithID(agentCls : Class<? extends Agent>,
agentID : UUID,
params : Object*) : void
throws Exception
SREBootstrap
agentCls
- type of the first agent to launch.agentID
- the identifier of the agent to be created.params
- parameters to pass to the agent as its initialization parameters.Exception
- - if it is impossible to start the platform.@Pure
default def
isActive() : boolean
SREBootstrap
If the bootstrap cannot be used, it cannot launch agent.
true
if the bootstrap could be used. false
if it cannot be used.@Pure
default def
isRunning() : boolean
SREBootstrap
true
if the kernel is running. false
is replied
if the kernel was stopped.@Deprecated
default def
setOffline(isOffline : boolean) : void
SREBootstrap
This function has no effect if the agent framework is already launched.
isOffline
- the offline flag.UnsupportedOperationException
- a runtime exceptiondefault def
setRandomContextUUID() : void
SREBootstrap
This function has no effect if the agent framework is already launched.
UnsupportedOperationException
- a runtime exceptiondefault def
setBootAgentTypeContextUUID() : void
SREBootstrap
This function has no effect if the agent framework is already launched.
UnsupportedOperationException
- a runtime exceptiondefault def
setSpecificContextUUID() : void
SREBootstrap
This function has no effect if the agent framework is already launched.
UnsupportedOperationException
- a runtime exceptionSREBootstrap.setUniverseContextUUID(UUID)
,
SREBootstrap.getUniverseContextUUID()
,
SREBootstrap.setUniverseSpaceUUID(UUID)
,
SREBootstrap.getUniverseSpaceUUID()
default def
setUniverseContextUUID(id : UUID) : void
SREBootstrap
default
identifier mode is enabled
.
This function has no effect if the agent framework is already launched.
id
- the identifier, or null
if the default identifier should be used.UnsupportedOperationException
- a runtime exception@Pure
default def
getUniverseContextUUID() : UUID
SREBootstrap
This function has no effect if the agent framework is already launched.
null
if no identifier is provided by the user and the default identifier should be used.UnsupportedOperationException
- a runtime exceptiondefault def
setUniverseSpaceUUID(id : UUID) : void
SREBootstrap
default
identifier mode is enabled
.
This function has no effect if the agent framework is already launched.
id
- the identifier, or null
if the default identifier should be used.UnsupportedOperationException
- a runtime exception@Pure
default def
getUniverseSpaceUUID() : UUID
SREBootstrap
This function has no effect if the agent framework is already launched.
null
if no identifier is provided by the user and the default identifier should be used.UnsupportedOperationException
- a runtime exceptiondefault def
setVerboseLevel(level : int) : void
SREBootstrap
This function may have no effect if the agent framework is already launched. This depends on the implementation of the SRE.
The value of the level
argument does not depend on a specific logging infrastructure.
Indeed, JUL, Log4J and SLF4J attach different numeric values to the different logging levels.
Consequently, the numerical values that are assummed by this function are:
<= 0
: off, no logging.= 1
: errors only.= 2
: errors and warnings.= 3
: errors, warnings and info.= 4
: errors, warnings, info, debug 1.= 5
: errors, warnings, info, debug 1 to 2.= 6
: errors, warnings, info, debug 1 to 3.= 7
: all messages.level
- the verbosity level. See explanation in the documentation of this function.UnsupportedOperationException
- a runtime exception@Pure
default def
getKernelLogger() : Logger
SREBootstrap
This function replies a not null
value only if the kernel was launched.
null
if the kernel was not launched or has no logger.default def
shutdown() : void
throws InterruptedException
SREBootstrap
InterruptedException
- the shutdown process is interrupted.SREBootstrap.shutdown(boolean)
,
SREBootstrap.shutdown(int)
,
#shutdown(boolean, int)
default def
shutdown(blocking : boolean) : void
throws InterruptedException
SREBootstrap
If the argument's value is evaluated to true
, the SREBootstrap.shutdown(int)
functions is invoked with negative timeout; Otherwise the SREBootstrap.shutdown(int)
functions is invoked with 0
value.
blocking
- indicates if the functions is blocked until the shutdown task is finished.
If it is true
, the function returns when the kernel is down. If it is
false
, the function could return before the kernel is down.InterruptedException
- the shutdown process is interrupted.SREBootstrap.shutdown()
,
SREBootstrap.shutdown(int)
,
#shutdown(boolean, int)
def
shutdown(timeout : int) : void
throws InterruptedException
SREBootstrap
timeout
- the maximum amount of milliseconds to wait for the shutdown.
If the provided value is strictly positive, it is the number of milliseconds
to wait for the termination of the shutdown. If the provided value is equal
to 0
, the function returns as soon as the shutdown process is launch
(no waiting for the termination of the shutdown). If the value is strictly
negative, the function waits forever for the termination of the shutdown
process. The default value is -1
.InterruptedException
- the shutdown process is interrupted.SREBootstrap.shutdown()
,
SREBootstrap.shutdown(boolean)
,
SREBootstrap.shutdown(int)
@Puredef
getService(serviceType : Class<T>) : Twith
<T>
SREBootstrap
T
- the type of the service.serviceType
- the type of the service.null
if the SRE does not have any instance of service of the given type.def
addSREListener(listener : SREListener) : void
SREBootstrap
listener
- the observer to add.def
removeSREListener(listener : SREListener) : void
SREBootstrap
listener
- the observer to remove.Copyright © 2021 the original authors or authors.