javax.enterprise.context
Interface Conversation


public interface Conversation

Provides conversation management operations

Author:
Pete Muir

Method Summary
 void begin()
          Mark a transient conversation long running.
 void begin(java.lang.String id)
          Mark a transient conversation long running.
 void end()
          Mark a long running conversation transient
 java.lang.String getId()
          Get the id associated with the current long running conversation
 long getTimeout()
          Get the timeout for the current long running conversation.
 boolean isLongRunning()
          Determine if a conversation is long running or transient
 boolean isTransient()
           
 void setTimeout(long milliseconds)
          Set the timeout for the current long running conversation
 

Method Detail

begin

void begin()
Mark a transient conversation long running. The container will generate an id

Throws:
java.lang.IllegalStateException - if the current conversation is marked long running

begin

void begin(java.lang.String id)
Mark a transient conversation long running.

Parameters:
id - the id of the conversation
Throws:
java.lang.IllegalStateException - if the current conversation is marked long running
java.lang.IllegalArgumentException - if a long running conversation with id already exists

end

void end()
Mark a long running conversation transient

Throws:
java.lang.IllegalStateException - if the current conversation is marked transient

isLongRunning

boolean isLongRunning()
Determine if a conversation is long running or transient

Returns:
true if the conversation is long running

getId

java.lang.String getId()
Get the id associated with the current long running conversation

Returns:
the id of the current long running conversation

getTimeout

long getTimeout()
Get the timeout for the current long running conversation. The conversation will destroy the conversation if it has not been accessed within this time period.

Returns:
the current timeout in milliseconds

setTimeout

void setTimeout(long milliseconds)
Set the timeout for the current long running conversation

Parameters:
milliseconds - the new timeout in milliseconds

isTransient

boolean isTransient()
Returns:
true if the conversation is marked transient, or false if it is marked long-running.


Copyright © 2008-2009. All Rights Reserved.