The Lime server embodies the runtime support needed to run applications on a
given host. It is possible to run multiple Lime servers on each host, as long
as they are started on different ports. This is useful for testing
applications where eventually multiple hosts will be used, but during testing
the hosts are simulated. The Lime server can be started from within a Java
application, or from the command line using the lime.util.Launcher
.
If the Lime server is started from within a Java application, it runs as a
separate thread within the Java VM that contains the application. Please refer
to the API documentation for lime.LimeServer
for a description of
the methods available on a LimeServer
object.
If the Lime server is launched from the command line, it is executed within a separate Java VM. Since the actual computation is performed by agents executing in a Lime server, the problem remains of loading such agents into the Lime server. There are basically two ways to achieve this with the current API:
java lime.util.Launcher -load MyAgent1 MyAgent2
java lime.util.LauncherThis will start the Lime server with no agents running. In another shell, type
java lime.util.Launcher -quit -load MyAgent1 MyAgent2This will load the agents into an already existing Lime server (the one we previously started) and then exit immediately.
.class
files. The argument to the
-load
option are one or more .class
files, each
containing a subclass of StationaryAgent
. (Notice how the
.class
suffix is not specified in the parameters.) The bytecode
for the agents must be reachable from the CLASSPATH
associated
with the Lime server, otherwise an error is generated.
-load
and -quit
. The
-quit
options allows to use an auxiliary Lime server for the sole
purpose of loading one or more agents into an already existing Lime server on
the same host. Notice that the -load
option must always be
the last one on the command line.
The text above describe how to launch a server that can contain only
stationary, non-mobile agents. However, Lime allows also for mobile agents, and
actually an adaptation layer has
been developed that in principle allows to use Lime with any mobile agent
system. In the current distribution, the only adapter provided supports the µCode
mobile agent toolkit. Operation of this system with Lime requires a different
launcher, lime.mobileagent.mucode.Launcher
, with slightly different
command-line options:
Usage: java lime.mobileagent.mucode.Launcher [--mucode [mucode options]] [--lime [lime options]] [--load [class names of agents to be loaded]] OR java lime.mobileagent.mucode.Launcher [--send <host:port of target muserver <class names of agent to be loaded remotely>] For instance:
java lime.mobileagent.mucode.Launcher --mucode -port 2000 --lime -port 3000 -debug on --load InteractiveMobileAgentloads
InteractiveMobileAgent
in a mucode server that listens on port 2000, connected with a Lime server (whose debug messages are enabled) listening on port 3000.
java lime.mobileagent.mucode.Launcher --send localhost:2000 InteractiveMobileAgent InteractiveMobileAgentloads (remotely) two additional instances of
InteractiveMobileAgent
in the mucode server previously
created and then quits.InteractiveMobileAgent
engage their tuple
spaces they will all share the same host-level tuple space.--mucode
option must mandatorily come
before the --lime
option, and the
--load
option must be last.--load
option causes the mobile agent to be loaded into
the µcode server. The lime option -load
instead loads the
agent directly in the Lime server.
--send
option performs the remote loading and then
quits.
For additional information about the options available for the µCode server and the system in general, please see the µCode site.