setRequestTimeout method (format 2)

Description

Sets an RMI-IIOP communication timeout. This method sets the parameter sec as the timeout value for running threads. The timeout set by this method is valid for threads that are currently being executed. At the end of the processing, make sure to cancel the timeout settings using the unset method. When this method is invoked more than once in the same thread, the value set for timeout gets overwritten.

Format

public void setRequestTimeout(int sec)
 throws IllegalArgumentException,
        IllegalStateException;

Parameters

sec:
Specify an integer in the range of 0 to 86400 for the timeout period (unit: seconds). The timeout is not set when 0 is specified.

Exceptions

java.lang.IllegalArgumentException:
This exception is thrown when an invalid object is specified as the target for setting timeout or an invalid value is specified for timeout period.
java.lang.IllegalStateException:
An attempt to set the timeout failed.

Return value

None

Caution

When you set the timeout by this method, make sure to invoke the unsetRequestTimeout method and cancel the timeout settings at the end of the processing. If you do not cancel the timeout settings and if the corresponding thread is used while invoking from other clients, an unexpected communication timeout may occur for these clients.