public class Runtime
extends java.lang.Object
instance()
static method) of this class allows
controlling the JADE runtime system from an external application.
Two different modalities of controlling the JADE runtime system exist:
createAgentContainer()
and createMainContainer()
methods plus the classes
included in the jade.wrapper
package.startUp()
and shutDown()
methodsIllegalStateException
to be thrown.
It should be noted that the Single-container modality only provides a limited control of the JADE runtime system (e.g. it does not allow creating and killing agents), but is the only one supported both in J2SE, PJAVA/CDC and MIDP when using the LEAP add-on.
Modifier and Type | Method and Description |
---|---|
AgentContainer |
createAgentContainer(Profile p)
Creates a new agent container in the current JVM, providing
access through a proxy object.
|
AgentContainer |
createMainContainer(Profile p)
Creates a new main container in the current JVM, providing
access through a proxy object.
|
static java.lang.String |
getDate() |
static java.lang.String |
getRevision() |
static java.lang.String |
getVersion() |
static java.lang.String |
getVersionInfo()
Return the version number and date of this JADE Runtime.
|
static Runtime |
instance()
This method returns the singleton instance of this class
that should be then used to create agent containers.
|
void |
invokeOnTermination(java.lang.Runnable r)
Allows setting a
Runnable that is executed when
the last container in this JVM terminates. |
void |
setCloseVM(boolean flag)
Causes the local JVM to be closed when the last container in this
JVM terminates.
|
void |
shutDown()
Stops the JADE container running in the Single-container modality.
|
void |
startUp(Profile p)
Starts a JADE container in the Single-container modality.
|
public static Runtime instance()
public AgentContainer createAgentContainer(Profile p)
p
- the profile containing boostrap and configuration
data for this containerjava.lang.IllegalStateException
- if the Single-container modality
was previously activated by calling the startUp()
method.public AgentContainer createMainContainer(Profile p)
p
- the profile containing boostrap and configuration
data for this containerjava.lang.IllegalStateException
- if the Single-container modality
was previously activated by calling the startUp()
method.public void setCloseVM(boolean flag)
public void startUp(Profile p)
p
- the profile containing boostrap and configuration
data for this containerjava.lang.IllegalStateException
- if the Multiple-container modality
was previously activated by calling the createAgentContainer()
or createMainContainer()
methods.public void shutDown()
public void invokeOnTermination(java.lang.Runnable r)
Runnable
that is executed when
the last container in this JVM terminates.public static java.lang.String getVersionInfo()
public static java.lang.String getVersion()
public static java.lang.String getRevision()
public static java.lang.String getDate()