O'Reilly logo

Mobile Agents by Wilhelm R. Rossak, Peter Braun

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

340 Chapter 9 Running a Tracy Agency
Because there are no plugins, you unfortunately cannot do anything sensible
with this agency except stopping it. If you have started Tracy as a background
process, you should use the following command to halt the agency:
$> ./bin/tracy.sh stop
Otherwise, you can just abort Tracy by hitting Ctrl-C. This shuts down Tracy
agency properly and results in the following logging messages:
1 (Mon Oct 13 18:36:58 CET 2003) [INFO] de.fsuj.tracy2.kernel: micro kernel shutting down
2 (Mon Oct 13 18:36:58 CET 2003) [INFO] de.fsuj.tracy2.agency: agency "MainAgency" shutting down
3 (Mon Oct 13 18:36:58 CET 2003) [INFO] de.fsuj.tracy2.agency: agency "MainAgency" shut down
4 (Mon Oct 13 18:36:58 CET 2003) [INFO] de.fsuj.tracy2.kernel: all agent threads terminated
5 (Mon Oct 13 18:36:58 CET 2003) [INFO] de.fsuj.tracy2.kernel: thread pool shutting down
6 (Mon Oct 13 18:36:58 CET 2003) [INFO] de.fsuj.tracy2.kernel: thread pool shut down
7 (Mon Oct 13 18:36:58 CET 2003) [INFO] de.fsuj.tracy2.kernel: micro kernel shut down
Both star t scripts accept the following options:
run Start a Tracy agency within this process.
start Start a Tracy agency as background process.
stop Stop a Tracy agency.
--help Prints help information.
--ini Defines the directory where all configuration files can be found. If you
omit this option, the Tracy loader will use directory conf.
All options that start only with a single dash are passed to the Java virtual
machine.
Thus, under the assumption that you have placed all configuration files in
directory conf/minimal, you can use the following command to start a Tracy
agency on a Unix system:
$> ./bin/tracy.sh start --ini conf/minimal -Xms128m -Xmx256m
This example also shows how to define options that are passed to the Java
virtual machine.
9.4 Installation and Usage of Basic Plugins
In this section we will describe how to install and configure two very
important plugins: AgencyShell and AgentLauncher. The AgencyShell
9.4 Installation and Usage of Basic Plugins 341
plugin provides a textual user interface (console) to administrate a run-
ning agency. The AgentLauncher plugin starts agents while launching the
agency.
9.4.1 AgencyShell
Introduction
If you store the AgencyShell plugin in the plugins directory, you can commu-
nicate with a running agency using a textual user interface (sometimes also
called a shell or console).
Using the textual user interface of Tracy, you can administrate the whole
agency, including starting and stopping agents, listing all agents currently
residing on this agency, and so forth. You can also start and stop plugins and
administrate them if they provide their own commands for the shell.
When the AgencyShell plugin is star ted, it uses the Java authentica-
tion and authorization system to log in users (i.e., file jaas.login is read to
select the login module which defines how users have to authenticate). The
login module that was mentioned previously identifies the user as the one
who is actually starting Tracy. Other login modules, especially the one that
comes with the Taas plugin requires the user to authenticate with a user
name and a password, which are verified against a Tracy user management
database.
After the user has logged in, AgencyShell provides a simple textual user
interface comparable to a Unix shell or a DOS command prompt. In gen-
eral, the console provides two focus points. The first is that of the agency,
which is actually the one that you enter after logging in. In this focus you
can only administrate the agency. The second focus is that of a plugin. To
change focus from the agency to one of the plugins, you must enter com-
mand cf (change focus), which will be explained below. The following set of
commands can be used in the agency focus as well as in a plugin focus.
author [--help] Prints the author of a component according to the
current focus.
docs [--help] Prints a URL where documentation can be found for this
component according to the current focus.
exit [--help] Exits the shell without closing the agency. Note that this
command can only be used at the agency focus.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required