Hitachi

JP1 Version 11 JP1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide 


8.3.10 adshjava command (executes Java batch applications) [only for Windows, Linux, AIX, and HP-UX]

Syntax

When using the scheduling functionality of uCosminexus Application Server:
adshjava  [-grp schedule-group-name]
           -java  [[Java-option]...]  Java-application-class-name
           [[argument-passed-to-the-main-method] ...]
When not using the job scheduling functionality of uCosminexus Application Server:
adshjava -srv batch-server-name
         -java  [[Java-option]...]  Java-application-class-name
           [[argument-passed-to-the-main-method]...] 

Description

Execute Java batch applications linked with uCosminexus Application Server according to instructions provided from the adshjava command. Contents specified by this command are specified for arguments of the cjexecjob command of uCosminexus Application Server and the cjexecjob command is executed. If forced termination of a job is detected, the adshjava command executes the cjkilljob command and automatically stops Java batch applications.

If the job of JP1/Advanced Shell is forced to terminate, Java batch applications are also forced to terminate.

Conditions that automatically force termination of Java batch applications upon forced termination are as follows:

Table 8‒5: Conditions that automatically force termination of Java batch applications upon forced termination

Conditions for forced termination (with exceptions from the second time and on)

Windows

Linux, AIX, HP-UX

Forced termination from JP1/AJS

Y

Y

Ctrl+C

Y

Y

Ctrl+Break

N

Y

Closing the console

N

Y

Sending the End signal for the adshexec command process#1

-

Y

Sending SIGTERM to the adshjava command process

-

Y

Sending SIGINT to the adshjava command process

-

Y

Pausing with the quit command of debugger of adshexec

- #2

- #2

Legend:

Y: Forced termination is available.

N: Forced termination is not available.

-: Not applicable

#1

The end signal is the signal that is terminated by the adshexec command. For signals to be terminated, see 3.11.2 Processing when signals are received (UNIX only).

#2

You cannot force termination of commands that are executed in the background by using the quit command.

You can select whether to use the job scheduling functionality of uCosminexus Application Server as the execution method for Java batch applications.

Users who can execute this command are described below. For details, see the description of the cjexecjob command or cjkilljob command in the uCosminexus Application Server Command Reference Guide. If a user is not authorized, the cjexecjob command or cjkilljob command is terminated with an error.

Arguments

-grp schedule-group-name

Specify the group name of the batch server that is assigned when Component Transaction Monitor of uCosminexus Application Server schedules execution of Java batch applications. Specify the group name of the batch server within 63 bytes.

You need to specify this option before the -java option. Although the length of the schedule group name is verified, other items are not verified and the -grp schedule group name is specified for arguments of the cjexecjob command and cjkilljob command.

-srv batch-server-name

Specify the bath server name of uCosminexus Application Server that will execute Java batch applications within 255 bytes.

You need to specify this option before the -java option.

Although the length of the batch server name is verified, other items are not verified and the -srv batch server name is specified for arguments of the cjexecjob command and cjkilljob command.

-java

Contents specified after this option are passed as is to the cjexecjob command of uCosminexus Application Server.

Error check is not executed for contents that are specified after this option by using the adshjava command unless there are no specifications. Processing is left up to the check using the cjexecjob command.

Java-options

Specify the activation option of JavaVM. For the specification method, see uCosminexus Application Server Command Reference Guide.

For the file assigned by the #-adsh_file command, #-adsh_file_temp command, or #-adsh_spoolfile command, the file name can be passed to Java batch applications via the system property by entering "-D system property name=${file definition name}" with this option.

Java-application-class-name

Specify the class name of the Java application inclusive of the package name. For the Java application class name, see the description of the cjexecjob command in uCosminexus Application Server Command Reference Guide.

argument-passed-to-the-main-method

Specify the argument passed to the main method of the Java application. For the argument passed to the main method, see the description of the cjexecjob command in the uCosminexus Application Server Command Reference Guide.

Return codes

Return code

Occurrence condition

Meaning

0#1

The value returned from the public static int main(String[]) method is 0.

This value is returned when the public static int main(String[]) method is used.

The values specified for the arguments of System.exit(), Runtime.halt(), and Runtime.exit() are 0.

These values are returned if System.exit(), Runtime.halt(), and Runtime.exit() are used.

The return value of the cjexecjob command is 0.

The command is normally terminated by using the public static void main(String[]) method.

1#2

Termination due to processing of the adshjava command

The adshjava command is forced to terminate.

2#2

Termination due to processing of the adshjava command

An error occurred during processing of the adshjava command.

If activation of the cjkilljob command fails with the forced termination process, 1 might appear.

The value returned from the public static int main(String[]) method +15#1, #3

The value returned from the public static int main(String[]) method is 1 or more.

This value is returned when the public static int main(String[]) method is used.

The value specified for arguments of System.exit(), Runtime.halt(), and Runtime.exit() +15#1, #3

The values specified for arguments of System.exit(), Runtime.halt(), and Runtime.exit() are 1 or more.

These values are returned if System.exit(), Runtime.halt(), and Runtime.exit() are used.

The return value of the cjexecjob command + 15#1, #3

The return value of the cjexecjob command is 1.

Execution of the Java batch application failed. Alternatively, the Java batch application was forcibly terminated.

The value returned from the public static int main(String[]) method#1, #4

The value returned from the public static int main(String[]) method is a negative number. (Only for Windows. For UNIX, the last 8 bits are adopted as the RC.)

This value is returned when the public static int main(String[]) method is used.

The value specified for the argument of System.exit(), Runtime.halt(), or Runtime.exit() #1, #4

The value specified for the argument of System.exit(), Runtime.halt(), or Runtime.exit() is a negative number (Only for Windows. For UNIX, the last 8 bits are adopted as the RC.)

This value is returned if System.exit(), Runtime.halt(), or Runtime.exit() is used.

17

Activation of the cjexecjob command failed.

This value is returned if activation of the cjexecjob command failed.

#1

This is the return value of the cjexecjob command of uCosminexus Application Server.

#2

This is the return code of the adshjava command.

#3

If the return code exceeds 255, the value is converted to 255.

#4

If the return value is a negative value, the job controller converts the value to 255.

Notes

Examples