Author: nickarls
Date: 2009-03-06 03:37:50 -0500 (Fri, 06 Mar 2009)
New Revision: 1781
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ConversationEntry.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ServletConversationManager.java
Log:
minor. some exit-early for conversation handling when there is nothing to do.
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ConversationEntry.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ConversationEntry.java 2009-03-06
06:56:33 UTC (rev 1780)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ConversationEntry.java 2009-03-06
08:37:50 UTC (rev 1781)
@@ -77,6 +77,10 @@
*/
public boolean cancelTermination()
{
+ if (terminationHandle.isCancelled())
+ {
+ return true;
+ }
boolean success = terminationHandle.cancel(false);
if (success)
{
@@ -135,6 +139,10 @@
*/
public boolean unlock()
{
+ if (!concurrencyLock.isLocked())
+ {
+ return true;
+ }
if (concurrencyLock.isHeldByCurrentThread())
{
concurrencyLock.unlock();
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ServletConversationManager.java
===================================================================
---
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ServletConversationManager.java 2009-03-06
06:56:33 UTC (rev 1780)
+++
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/conversation/ServletConversationManager.java 2009-03-06
08:37:50 UTC (rev 1781)
@@ -172,10 +172,10 @@
// canceled in the
// beginConversation) or the case where we have a completely new
// long-running conversation.
- if (longRunningConversations.containsKey(currentConversation.getId()))
+ if (longRunningConversations.containsKey(cid))
{
- longRunningConversations.get(currentConversation.getId()).unlock();
-
longRunningConversations.get(currentConversation.getId()).reScheduleTermination(terminationHandle);
+ longRunningConversations.get(cid).unlock();
+ longRunningConversations.get(cid).reScheduleTermination(terminationHandle);
}
else
{