jade.core
Class MicroRuntime

java.lang.Object
  |
  +--jade.core.MicroRuntime

public class MicroRuntime
extends java.lang.Object

This class is used to start up the JADE runtime as a split (front-end) container. Though JADE supports split containers on all Java editions, the split container deployment is better suited for small, resource constrained devices (MIDP and PJava).
Requires the LEAP add-on

Author:
Giovanni Caire - TILAB

Field Summary
static java.lang.String AGENTS_KEY
          The configuration property key that maps to the list of agents that have to be activated at boostrap.
static java.lang.String CONN_MGR_CLASS_KEY
           
static java.lang.String HOST_KEY
          The configuration property key that maps to the host where to connect to the JADE mediator.
static java.lang.String PORT_KEY
          The configuration property key that maps to the port where to connect to the JADE mediator.
static java.lang.String SERVICES_KEY
          The configuration property key that maps to the list of services that have to be installed.
 
Constructor Summary
MicroRuntime()
           
 
Method Summary
static void detach()
           
static boolean isRunning()
          Tells whether a JADE Front End container is currently running within this JVM.
static void killAgent(java.lang.String name)
          Kill an agent.
static void startAgent(java.lang.String name, java.lang.String className, java.lang.String[] args)
          Start a new agent.
static void startJADE(Properties p, java.lang.Runnable r)
          Start up the JADE runtime.
static void stopJADE()
          Shut down the JADE runtime.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AGENTS_KEY

public static final java.lang.String AGENTS_KEY
The configuration property key that maps to the list of agents that have to be activated at boostrap.

See Also:
Constant Field Values

SERVICES_KEY

public static final java.lang.String SERVICES_KEY
The configuration property key that maps to the list of services that have to be installed.

See Also:
Constant Field Values

HOST_KEY

public static final java.lang.String HOST_KEY
The configuration property key that maps to the host where to connect to the JADE mediator.

See Also:
Constant Field Values

PORT_KEY

public static final java.lang.String PORT_KEY
The configuration property key that maps to the port where to connect to the JADE mediator.

See Also:
Constant Field Values

CONN_MGR_CLASS_KEY

public static final java.lang.String CONN_MGR_CLASS_KEY
See Also:
Constant Field Values
Constructor Detail

MicroRuntime

public MicroRuntime()
Method Detail

startJADE

public static void startJADE(Properties p,
                             java.lang.Runnable r)
Start up the JADE runtime. This method launches a JADE Front End container. Since JADE supports only one container in the split-container deployment, if a Front End is already running this method does nothing.

Parameters:
p - A property bag, containing name-value pairs used to configure the container during boot.
r - A Runnable object, whose run() method will be executed just after container termination.

stopJADE

public static void stopJADE()
Shut down the JADE runtime. This method stops the JADE Front End container currently running in this JVM, if one such container exists.


isRunning

public static boolean isRunning()
Tells whether a JADE Front End container is currently running within this JVM.

Returns:
If the JADE runtime is currently running, true is returned. Otherwise, the method returns false.

startAgent

public static void startAgent(java.lang.String name,
                              java.lang.String className,
                              java.lang.String[] args)
                       throws java.lang.Exception
Start a new agent. This method starts a new agent within the active Front End container.

Parameters:
name - The local name (i.e. without the platform ID) of the agent to create.
className - The fully qualified name of the class implementing the agent to start.
args - The creation arguments for the agent.
Throws:
java.lang.Exception - If the underlying agent creation process fails.

killAgent

public static void killAgent(java.lang.String name)
                      throws NotFoundException
Kill an agent. This method terminates an agent running within the active Front End container.

Parameters:
name - The local name (i.e. without the platform ID) of the agent to kill.
Throws:
NotFoundException - If no agent with the given local name are running within the active Front End.

detach

public static void detach()


JADE