You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2015/05/05 07:51:54 UTC
svn commit: r1677742 -
/openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
Author: struberg
Date: Tue May 5 05:51:53 2015
New Revision: 1677742
URL: http://svn.apache.org/r1677742
Log:
OWB-1050 fix request conext cleanup
Modified:
openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
Modified: openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java?rev=1677742&r1=1677741&r2=1677742&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java (original)
+++ openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java Tue May 5 05:51:53 2015
@@ -217,6 +217,17 @@ public class WebContextsService extends
}
}
+ @Override
+ public Context getCurrentContext(Class<? extends Annotation> scopeType, boolean createIfNotExists)
+ {
+ if(scopeType.equals(SessionScoped.class))
+ {
+ return getSessionContext(createIfNotExists);
+ }
+
+ return super.getCurrentContext(scopeType, createIfNotExists);
+ }
+
/**
* {@inheritDoc}
*/
@@ -341,21 +352,22 @@ public class WebContextsService extends
*/
protected void destroyRequestContext(Object endObject)
{
- // cleanup open conversations first
+ //Get context
+ RequestContext context = getRequestContext(true);
+
+ if (context == null)
+ {
+ return;
+ }
+
+ // cleanup open conversations first
if (supportsConversation)
{
destroyOutdatedConversations(conversationContexts.get());
}
- //Get context
- RequestContext context = getRequestContext(false);
+ context.destroy();
- //Destroy context
- if (context != null)
- {
- context.destroy();
- }
-
// clean up the EL caches after each request
ELContextStore elStore = ELContextStore.getInstance(false);
if (elStore != null)