Quick Links

Contact Information

4800 Liberty Ave
Pittsburgh, PA 15224

Open 9:30am-6pm EST
Monday-Friday

Phone: +1 (412) 682-5282

info@cometway.com
sales@cometway.com
support@cometway.com

For more information about Comet Way products and services, please visit our corporate website at

http://www.cometway.com

ak

This shell script is used to initialize and start the Comet Way Agent Kernel. If you used the ak/install.sh script, this script was installed into your ~/bin directory. Most UNIX configurations already have the ~/bin directory included in the PATH, and issuing the ak command in any directory with .startup files will startup the Agent Kernel.

The ak script looks like this:

#! /bin/sh CLASSPATH=/Users/mario/classes:/Users/mario/ak/ak.jar java -classpath ${CLASSPATH} com.cometway.ak.AK $*

Note: If the ak command does not work for you, you may need to add ~/bin to your PATH, or make edits to the ak script for your particular configuration.

The ak command uses the following syntax:

ak [-hide_println] [-hide_debug] [-hide_warning] [-props ] [-startup_agent <classname>] [-startup_dir <dir>] [<file>] ...

When this shell script is executed, the Agent Kernel is loaded and starts up an agent called the Startup Agent. This agent is responsible for scanning the Startup Directory for files ending in .startup that contain the agent properties of each additional agent to start.

After these initial agents have started, you can start additional agents by specifying the name of additional agent properties files ending in .agent.

Each agent properties or Props file must contain a classname property set to the classname of the agent to be loaded. Other properties can be defined for the agent in these Props files to customize their behavior.

Here is the Props file for starting the Service Manager agent:

agent_id=100 classname=com.cometway.ak.ServiceManager

The classname property tells the Agent Kernel which Java class to instantiate and start as an Agent. The agent_id property is assigned by the Agent Kernel if you do not provide one. When there are more than one agent of a particular class, assigning each agent a different agent_id can help you distinguish their activity in the Reporter output.

Examples of Using the ak Command

1. Load Agent Kernel and Service Manager

ak

2. Load Agent Kernel, Service Manager, and Object Manager

ak 110_ObjectManager.agent

3. Load the Scheduler and Load Monitor

ak 120_Scheduler.agent 130_LoadMonitor.agent

4. Load all agents and hide Agent Kernel activity output

ak -hide_println *.agent

5. Load startup agents from another directory

ak -startup_dir ./startup

6. Load an alternate startup agent

ak -startup_agent com.cometway.swing.StartupEditor

7. Load Agent Kernel configuration properties from a file

ak -props ak.cfg

[Prev] [Next]

Description: How to use the ak Unix shell script.

Updated: Mon May 19 06:26:21 EDT 2008