Writing Java in an agent

Procedure

  1. Select Agents from the Applications Navigator.
  2. Click New Agent or open an existing agent. The Agent Properties box appears.
  3. Specify name, options, run time options, and security as needed.
  4. Select Java from the Run menu.
  5. Write your Java after the remark line, "Your code goes here," or click Edit Project to add source, resource, class, or archive files to the current agent.
    Note: Any changes made to the Java files in the current agent exist only in the agent. If you want to update the original files, you must export the agent to the directory containing the files you want to update.
  6. Optional: Click New Class to add a new class. A horizontal bar separates each class. The name of a class appears on the bar preceding the class to which it refers.
  7. Click on Compile following the Script area. You can choose to compile the current class or the entire agent.
  8. Optional: Click Export to export Java to a project directory.

Results

For information about creating an agent, see Creating an agent.

Note: The Agent Properties box is new with Release 6.

Viewing output from a Java agent

About this task

You can review output from a Java agent that is running locally in the Java Debug Console. To activate the console, choose Tools - Show Java Debug Console. To clear output from the window, click Clear.

If a Java agent is running on a server, the Java Debug Console output is redirected to a server log file.

Adding resource, class, or archive files to an agent

Procedure

  1. Click Edit Project.
  2. From the Browse menu, choose the filing system for the resources you want to import.
  3. If using the Local File System, enter the desired path in the Base directory box.
  4. Optional: Select the appropriate check box for Show file types. The default file type is All.
  5. Select the files you want to include as a resource and click Add/Replace File(s). To select all of the files in the base directory and all of its subdirectories, click Add/Replace All. To remove a file, or group of files from the Current Agent Files column, select the file(s) and click Delete.
  6. Put the files in the proper order in the Current Agent Files column by clicking Reorder Up or Reorder Down to move files up or down, or by dragging files into place. You can move files one at a time, or in groups.

Including a script library on the class path

Procedure

  1. Click Edit Project.
  2. Choose Shared Java Libraries from the Browse menu.
  3. Choose the desired database from the options in the Database box.
  4. Select the script library to add to the class path.
  5. Click Add/Replace File(s).

Results

Note: The Database box is new with Release 6.