Registering jagtool commands in the Ant build file  XML configuration files

Chapter 12: Using jagtool and jagant

Using the jag_connect command

In build files, use the jag_connect command to connect to a server or to specify the server name for local mode. You cannot use jag_connect from the command line; instead use the connection or local-mode arguments described in “Local versus connected mode”.

jag_connect must be executed before any other jagtool commands in the build file. jag_connect can be included directly in any target, or in a “connect” target that other targets list as a dependency.

As with jagtool, you can run jagant in local or connected mode. “Local versus connected mode” explains the difference.

To run jagant in connected mode, specify these options for the jag_connect command:

To run in local mode, specify these options for the jag_connect command:

You can use multiple jag_connect commands in a single build file, which allows you to execute jagtool commands for different servers. Each time jag_connect is executed, the current connection or local-mode session is closed and a new one is opened. For example, this code restarts two servers:

<target name="restart_all_servers">
<jag_connect host="host1" password-="jagpass" />
<jag_restart />
<jag_connect host="host2" password="jagpass" />
<jag_restart /></target>

A connection to host1 is opened and the server on host1 is restarted. Then the connection is closed, a connection is opened to host2, and the server on host2 is restarted. The port number for both servers is 9000 and the user name is jagadmin (the defaults). The password for both servers is jagpass, and the log file is System.out.





Copyright © 2003. Sybase Inc. All rights reserved. XML configuration files

View this book as PDF