Server Command Files

In this section:

You can use iWay Service Manager (iSM) to execute commands, such as start and stop, from the iSM command shell. These commands can also be added to command files and executed by the following:

All server commands that are available from the shell can be included in command files. iWay expects that those commands that affect the server, such as start, stop and set will be the most useful. Nothing prevents other commands, such as memory, from being run in the command file. However, the information that is output by these commands may not appear in a convenient place.

Note: To control which JRE is used by the iWay Secure Messaging Option (iSMO) product, you can set the machine's environment variable IWAYIAMJVM to the full path where the jvm.dll file is located. For example:

IWAYIAMJVM=c:\java\jre\bin\server\jvm.dll

Top of page

x
Understanding the Command File Structure

Command files can make use of the iWay Functional Language during their execution. For example, consider a properties file that contains the following lines:

1. dostart=start
2. whattoday=chan3

Now consider the following command file:

1. // this is a test file
2. set debug on
3. _properties('c:/testprop','dostart',';') file1
4. _if(sreg('true')='true'),'start file1',';')
5. // last line of test file

The first line is a comment. Any line beginning with a // or a semicolon is a comment. The second line enables debug tracing. The next line is an iWay Functional Language (iFL) statement, testing the dostart property in the testprop properties file. If the property is not found, the semicolon is returned and the line is ignored. If it is found, the value start is returned, and the line now reads:

start

The first line is a comment. Any line beginning with a // or a semicolon is a comment. The second line sets the debug trace to on. Line 3 is an iFL statement, testing the dostart property in the testprop properties file. If the property is not found, the semicolon is returned and the line is ignored. If it is found the value start is returned, and the line now reads:

start file1

This line starts the named channel.

Line 4 is another iFL statement. In this case, if the special register condition1 is set to true, then the start file1 command is executed.

So there are two methods for conditionally executing lines in the command file.

The command file also supports the special command goto <label>. A label is a named point in the file ahead of the goto command. A label ends with a colon and must exist on a line with no other commands.

1. // this is a test file with goto
2. goto point
3. _if (_properties('c:/props','whattoday')=='chan3','goto point3')
4. start chan1
5. start chan2
6. goto end
7. point3:
8. start chan3 
9. end:
10. // last line of test file

In this command file, the iFL statement on line 3 instructs the server that if the whattoday property is set to chan3, then the commands pick up on line 7. Else the commands on lines 4 through 6 will execute.


iWay Software