org.jboss.webbeans.conversation
Class ConversationImpl

java.lang.Object
  extended by org.jboss.webbeans.conversation.ConversationImpl
All Implemented Interfaces:
Conversation

@RequestScoped
@Named(value="javax.context.conversation")
@Standard
public class ConversationImpl
extends java.lang.Object
implements Conversation

The current conversation implementation

Author:
Nicklas Karlsson
See Also:
Conversation

Constructor Summary
ConversationImpl()
          Creates a new conversation
ConversationImpl(Conversation conversation)
          Creates a new conversation from an existing one.
 
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
 boolean equals(java.lang.Object obj)
           
 java.lang.String getId()
          Get the id associated with the current long running conversation
 java.lang.String getOriginalCid()
          Gets the original ID of the conversation
 long getTimeout()
          Get the timeout for the current long running conversation.
 int hashCode()
           
 void init(ConversationIdGenerator conversationIdGenerator, long timeout)
          Initializes a new conversation
 boolean isLongRunning()
          Determine if a conversation is long running or transient
 void setLongRunning(boolean longRunning)
           
 void setTimeout(long timeout)
          Set the timeout for the current long running conversation
 void switchTo(Conversation conversation)
          Assumes the identity of another conversation
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConversationImpl

public ConversationImpl()
Creates a new conversation


ConversationImpl

public ConversationImpl(Conversation conversation)
Creates a new conversation from an existing one.

Parameters:
conversation - The old conversation
Method Detail

init

@Initializer
public void init(ConversationIdGenerator conversationIdGenerator,
                             @ConversationInactivityTimeout
                             long timeout)
Initializes a new conversation

Parameters:
conversationIdGenerator - The conversation ID generator
timeout - The conversation inactivity timeout

begin

public void begin()
Description copied from interface: Conversation
Mark a transient conversation long running. The container will generate an id

Specified by:
begin in interface Conversation

begin

public void begin(java.lang.String id)
Description copied from interface: Conversation
Mark a transient conversation long running.

Specified by:
begin in interface Conversation
Parameters:
id - the id of the conversation

end

public void end()
Description copied from interface: Conversation
Mark a long running conversation transient

Specified by:
end in interface Conversation

getId

public java.lang.String getId()
Description copied from interface: Conversation
Get the id associated with the current long running conversation

Specified by:
getId in interface Conversation
Returns:
the id of the current long running conversation

getTimeout

public long getTimeout()
Description copied from interface: Conversation
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.

Specified by:
getTimeout in interface Conversation
Returns:
the current timeout in milliseconds

isLongRunning

public boolean isLongRunning()
Description copied from interface: Conversation
Determine if a conversation is long running or transient

Specified by:
isLongRunning in interface Conversation
Returns:
true if the conversation is long running

setTimeout

public void setTimeout(long timeout)
Description copied from interface: Conversation
Set the timeout for the current long running conversation

Specified by:
setTimeout in interface Conversation
Parameters:
timeout - the new timeout in milliseconds

switchTo

public void switchTo(Conversation conversation)
Assumes the identity of another conversation

Parameters:
conversation - The new conversation

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setLongRunning

public void setLongRunning(boolean longRunning)

getOriginalCid

public java.lang.String getOriginalCid()
Gets the original ID of the conversation

Returns:
The id

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2011. All Rights Reserved.