2016/05/28 - Apache Tuscany has been retired.

For more information, please explore the Attic.



org.apache.tuscany.sca.core.conversation
Class ExtendedConversationImpl

java.lang.Object
  extended by org.apache.tuscany.sca.core.conversation.ExtendedConversationImpl
All Implemented Interfaces:
java.lang.Runnable, ExtendedConversation, org.osoa.sca.Conversation

public class ExtendedConversationImpl
extends java.lang.Object
implements ExtendedConversation, java.lang.Runnable


Constructor Summary
ExtendedConversationImpl(ConversationManagerImpl manager, java.lang.Object conversationID, ConversationState state)
          Constructor
 
Method Summary
 boolean conversationalAttributesInitialized()
           
 void end()
          End this conversation.
 java.lang.Object getConversationID()
          Returns the identifier for this conversation.
 ConversationState getState()
          Get the state of a conversation
 void initializeConversationAttributes(RuntimeComponent targetComponent)
           
 boolean isExpired()
          will check whether this conversation has expired and update state if it has
 void run()
          called when expiring
 void scheduleNextExpiryTime(long currentTime)
          schedule next expiry time
 void setConversationID(java.lang.Object conversationID)
           
 void setState(ConversationState state)
           
 void updateLastReferencedTime()
          updates the last time this conversation was referenced
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedConversationImpl

public ExtendedConversationImpl(ConversationManagerImpl manager,
                                java.lang.Object conversationID,
                                ConversationState state)
Constructor

Parameters:
manager - the conversation manager
conversationID - the conversation id associated with this conversation
state - the initial state of this conversation
aMaxAge - the maximum age of the conversation
aMaxIdleTime - the maximum idle time
Method Detail

isExpired

public boolean isExpired()
will check whether this conversation has expired and update state if it has

Specified by:
isExpired in interface ExtendedConversation
Returns:
true if it has expired

scheduleNextExpiryTime

public void scheduleNextExpiryTime(long currentTime)
schedule next expiry time


updateLastReferencedTime

public void updateLastReferencedTime()
updates the last time this conversation was referenced

Specified by:
updateLastReferencedTime in interface ExtendedConversation

getState

public ConversationState getState()
Description copied from interface: ExtendedConversation
Get the state of a conversation

Specified by:
getState in interface ExtendedConversation
Returns:
The state

end

public void end()
Description copied from interface: org.osoa.sca.Conversation
End this conversation.

Specified by:
end in interface org.osoa.sca.Conversation

getConversationID

public java.lang.Object getConversationID()
Description copied from interface: org.osoa.sca.Conversation
Returns the identifier for this conversation. If a user-defined identity had been supplied for this reference then its value will be returned; otherwise the identity generated by the system when the conversation was initiated will be returned.

Specified by:
getConversationID in interface org.osoa.sca.Conversation
Returns:
the identifier for this conversation

setState

public void setState(ConversationState state)
Specified by:
setState in interface ExtendedConversation
Parameters:
state - the state to set

setConversationID

public void setConversationID(java.lang.Object conversationID)
Specified by:
setConversationID in interface ExtendedConversation
Parameters:
conversationID - the conversationID to set

initializeConversationAttributes

public void initializeConversationAttributes(RuntimeComponent targetComponent)
Specified by:
initializeConversationAttributes in interface ExtendedConversation
Parameters:
maxAge - the maximum age of this conversation

conversationalAttributesInitialized

public boolean conversationalAttributesInitialized()
Specified by:
conversationalAttributesInitialized in interface ExtendedConversation
Returns:
true if the conversational attributes have been initialized

run

public void run()
called when expiring

Specified by:
run in interface java.lang.Runnable