# @jws:conversation-lifetime Annotation

Specifies the maximum age and/or the maximum idle time for a service's conversations.

## Syntax

@jws:conversation-lifetime

[max-idle-time="duration"]

[max-age="duration"]

## Attributes

max-idle-time

The amount of time that the conversation may remain idle before it is finished by WebLogic Server. Note that only activity between a web service and its client will reset the idle timer; activity between a web service and controls does not reset the idle timer.

Default: 0 seconds. Conversations with 0-length idle timeout will never timeout due to inactivity.

max-age

The amount of time (since it started) that the conversation may remain active before it is finished by WebLogic Server. Default: 1 day (24 hours).

## Remarks

The following rules apply to this annotation's use:

- Use the conversation-lifetime annotation to set initial values for maximum idle time and maximum age.
- Assign values in the form of expressions of time: 2 minutes, 5 days, and so on.
- You may also set values for this annotation using the conversation-lifetime property in the Properties window.
- This annotation must precede any method or class declarations in the JWS file.
- You may also set these values using the setMaxIdleTime and setMaxAge methods of the JwsContext interface. See JwsContext Interface.
- The idle timer may be reset using the resetIdleTime method of the JwsContext interface.
- When a conversation is terminated due to expiration of the idle time or maximum age, the conversation termination never occurs during the execution of a web service method. The conversation will actually terminate after completion of the method that is executing when the conversation is terminated.
- When a conversation is terminated, the optional JwsContext onFinish callback is invoked. You may implement a handler for this callback to receive notification of conversation expiration. See JwsContext Interface.

Related Topics

@jws:conversation Annotation

Managing Conversation Lifetime

JwsContext Interface