org.jboss.weld.conversation
Class ConversationEntry

java.lang.Object
  extended by org.jboss.weld.conversation.ConversationEntry

public class ConversationEntry
extends java.lang.Object

Represents a long-running conversation entry

Author:
Nicklas Karlsson

Constructor Summary
protected ConversationEntry(org.jboss.weld.context.api.BeanStore beanStore, ConversationImpl conversation, java.util.concurrent.Future<?> terminationHandle)
          Creates a new conversation entry
 
Method Summary
 boolean cancelTermination()
          Cancels the timeout termination
 void destroy()
          Destroys the conversation and it's associated conversational context
 ConversationImpl getConversation()
           
 boolean lock(long timeout)
          Attempts to lock the conversation for exclusive usage
static ConversationEntry of(org.jboss.weld.context.api.BeanStore beanStore, ConversationImpl conversation, java.util.concurrent.Future<?> terminationHandle)
          Factory method
 void reScheduleTermination(java.util.concurrent.Future<?> terminationHandle)
          Re-schedules timeout termination
 boolean unlock()
          Attempts to unlock the conversation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConversationEntry

protected ConversationEntry(org.jboss.weld.context.api.BeanStore beanStore,
                            ConversationImpl conversation,
                            java.util.concurrent.Future<?> terminationHandle)
Creates a new conversation entry

Parameters:
cid - The conversation ID
terminationHandle - The timeout termination handle
Method Detail

of

public static ConversationEntry of(org.jboss.weld.context.api.BeanStore beanStore,
                                   ConversationImpl conversation,
                                   java.util.concurrent.Future<?> terminationHandle)
Factory method

Parameters:
cid - The conversation ID
terminationHandle - The timeout termination handle
Returns:
A new conversation entry

cancelTermination

public boolean cancelTermination()
Cancels the timeout termination

Returns:
True if successful, false otherwise

destroy

public void destroy()
Destroys the conversation and it's associated conversational context


lock

public boolean lock(long timeout)
             throws java.lang.InterruptedException
Attempts to lock the conversation for exclusive usage

Parameters:
timeout - The time in milliseconds to wait on the lock
Returns:
True if lock was successful, false otherwise
Throws:
java.lang.InterruptedException - If the lock operation was unsuccessful

unlock

public boolean unlock()
Attempts to unlock the conversation

Returns:
true if the unlock was successful, false otherwise

reScheduleTermination

public void reScheduleTermination(java.util.concurrent.Future<?> terminationHandle)
Re-schedules timeout termination

Parameters:
terminationHandle - The fresh timeout termination handle

getConversation

public ConversationImpl getConversation()


Copyright © 2008-2009 Seam Framework. All Rights Reserved.