[weld-commits] Weld SVN: r5993 - core/trunk/impl/src/main/java/org/jboss/weld/context and 3 other directories.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Wed Mar 3 13:47:14 EST 2010


Author: nickarls
Date: 2010-03-03 13:47:14 -0500 (Wed, 03 Mar 2010)
New Revision: 5993

Added:
   api/trunk/weld/src/main/java/org/jboss/weld/conversation/ConversationManager.java
   core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationManager2.java
   core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationManagerAdapter.java
Removed:
   core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationManager.java
Modified:
   core/trunk/impl/src/main/java/org/jboss/weld/context/ContextLifecycle.java
   core/trunk/impl/src/main/java/org/jboss/weld/context/ConversationContext.java
   core/trunk/impl/src/main/java/org/jboss/weld/conversation/AbstractConversationManager.java
   core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationImpl.java
   core/trunk/impl/src/main/java/org/jboss/weld/conversation/ManagedConversation.java
   core/trunk/impl/src/main/java/org/jboss/weld/jsf/WeldPhaseListener.java
   core/trunk/impl/src/main/java/org/jboss/weld/servlet/BeanProvider.java
Log:
Restore ConversationManager API to weld-api
Adaptor to ConversationManager2
Lifecycle API changes to context destruction

Added: api/trunk/weld/src/main/java/org/jboss/weld/conversation/ConversationManager.java
===================================================================
--- api/trunk/weld/src/main/java/org/jboss/weld/conversation/ConversationManager.java	                        (rev 0)
+++ api/trunk/weld/src/main/java/org/jboss/weld/conversation/ConversationManager.java	2010-03-03 18:47:14 UTC (rev 5993)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.conversation;
+
+import java.util.Set;
+
+import javax.enterprise.context.Conversation;
+
+/**
+ * A conversation manager responsible for starting, resuming and ending conversations
+ * 
+ * @author Nicklas Karlsson
+ * @see org.jboss.weld.conversation.ConversationManager
+ */
+public interface ConversationManager
+{
+   /**
+    * Begins or restores a conversation
+    * 
+    * @param cid The incoming conversation ID. Can be null in cases of transient conversations
+    */
+   public abstract void beginOrRestoreConversation(String cid);
+   
+   /**
+    * Cleans up the current conversation, destroying transient conversation and handling 
+    * long-running conversations
+    */
+   public abstract void cleanupConversation();
+   
+   /**
+    * Destroys all long-running conversations
+    */
+   public abstract void destroyAllConversations();
+   
+   /**
+    * Gets the currently managed long-running conversations
+    * 
+    * @return the conversations
+    */
+   public abstract Set<Conversation> getLongRunningConversations();
+   
+}
\ No newline at end of file

Modified: core/trunk/impl/src/main/java/org/jboss/weld/context/ContextLifecycle.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/context/ContextLifecycle.java	2010-03-03 13:31:43 UTC (rev 5992)
+++ core/trunk/impl/src/main/java/org/jboss/weld/context/ContextLifecycle.java	2010-03-03 18:47:14 UTC (rev 5993)
@@ -22,6 +22,7 @@
  */
 package org.jboss.weld.context;
 
+import static org.jboss.weld.jsf.JsfHelper.getServletContext;
 import static org.jboss.weld.logging.Category.CONTEXT;
 import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
 import static org.jboss.weld.logging.messages.ContextMessage.APPLICATION_ENDED;
@@ -30,7 +31,10 @@
 import static org.jboss.weld.logging.messages.ContextMessage.REQUEST_STARTED;
 import static org.jboss.weld.logging.messages.ContextMessage.SESSION_ENDED;
 import static org.jboss.weld.logging.messages.ContextMessage.SESSION_RESTORED;
+import static org.jboss.weld.servlet.BeanProvider.conversationManager;
 
+import javax.faces.context.FacesContext;
+
 import org.jboss.weld.bootstrap.api.Lifecycle;
 import org.jboss.weld.bootstrap.api.Service;
 import org.jboss.weld.context.api.BeanStore;
@@ -39,15 +43,15 @@
 import org.slf4j.cal10n.LocLogger;
 
 /**
- * An implementation of the Weld lifecycle that supports restoring
- * and destroying all the built in contexts
+ * An implementation of the Weld lifecycle that supports restoring and
+ * destroying all the built in contexts
  * 
  * @author Pete Muir
  * 
  */
 public class ContextLifecycle implements Lifecycle, Service
 {
-   
+
    private static final LocLogger log = loggerFactory().getLogger(CONTEXT);
 
    private final AbstractApplicationContext applicationContext;
@@ -56,7 +60,7 @@
    private final ConversationContext conversationContext;
    private final RequestContext requestContext;
    private final DependentContext dependentContext;
-   
+
    public ContextLifecycle(AbstractApplicationContext applicationContext, AbstractApplicationContext singletonContext, SessionContext sessionContext, ConversationContext conversationContext, RequestContext requestContext, DependentContext dependentContext)
    {
       this.applicationContext = applicationContext;
@@ -70,26 +74,22 @@
    public void restoreSession(String id, BeanStore sessionBeanStore)
    {
       log.trace(SESSION_RESTORED, id);
-      sessionContext.setBeanStore(sessionBeanStore);
-      sessionContext.setActive(true);
+      setupContext(sessionContext, sessionBeanStore);
    }
 
    public void endSession(String id, BeanStore sessionBeanStore)
    {
       log.trace(SESSION_ENDED, id);
-      sessionContext.setActive(true);
-      sessionContext.destroy();
-      sessionContext.setBeanStore(null);
-      sessionContext.setActive(false);
+      teardownContext(sessionContext);
+      conversationManager(getServletContext(FacesContext.getCurrentInstance())).teardownContext();
    }
 
    public void beginRequest(String id, BeanStore requestBeanStore)
    {
       log.trace(REQUEST_STARTED, id);
-      requestContext.setBeanStore(requestBeanStore);
-      requestContext.setActive(true);
       dependentContext.setActive(true);
-      activateConversationContext();
+      setupContext(requestContext, requestBeanStore);
+      setupConversationContext();
    }
 
    public void endRequest(String id, BeanStore requestBeanStore)
@@ -97,54 +97,46 @@
       log.trace(REQUEST_ENDED, id);
       requestContext.setBeanStore(requestBeanStore);
       dependentContext.setActive(false);
-      requestContext.destroy();
-      requestContext.setActive(false);
-      requestContext.setBeanStore(null);
-      deactivateConversationContext();
+      teardownContext(requestContext);
+      conversationContext.setBeanStore(null);
+      conversationContext.setActive(false);
    }
-   
+
    public boolean isRequestActive()
    {
       return singletonContext.isActive() && applicationContext.isActive() && requestContext.isActive() && dependentContext.isActive();
    }
-   
+
    public boolean isApplicationActive()
    {
       return singletonContext.isActive() && applicationContext.isActive() && dependentContext.isActive();
    }
-   
+
    public boolean isConversationActive()
    {
       return singletonContext.isActive() && applicationContext.isActive() && sessionContext.isActive() && conversationContext.isActive() && dependentContext.isActive();
    }
-   
-   public boolean isSessionActive() 
+
+   public boolean isSessionActive()
    {
       return singletonContext.isActive() && applicationContext.isActive() && sessionContext.isActive() && dependentContext.isActive();
    }
-   
 
    public void beginApplication(BeanStore applicationBeanStore)
    {
       log.trace(APPLICATION_STARTED, "");
-      applicationContext.setBeanStore(applicationBeanStore);
-      applicationContext.setActive(true);
-      singletonContext.setBeanStore(new ConcurrentHashMapBeanStore());
-      singletonContext.setActive(true);
+      setupContext(applicationContext, applicationBeanStore);
+      setupContext(singletonContext, new ConcurrentHashMapBeanStore());
    }
-   
+
    public void endApplication()
    {
       log.trace(APPLICATION_ENDED, "");
-      applicationContext.destroy();
-      applicationContext.setActive(false);
-      applicationContext.setBeanStore(null);
-      singletonContext.destroy();
-      singletonContext.setActive(false);
-      singletonContext.setBeanStore(null);
+      teardownContext(applicationContext);
+      teardownContext(singletonContext);
    }
-   
-   public void cleanup() 
+
+   public void cleanup()
    {
       dependentContext.cleanup();
       requestContext.cleanup();
@@ -153,47 +145,73 @@
       singletonContext.cleanup();
       applicationContext.cleanup();
    }
-   
+
    public AbstractApplicationContext getApplicationContext()
    {
       return applicationContext;
    }
-   
+
    public AbstractApplicationContext getSingletonContext()
    {
       return singletonContext;
    }
-   
+
    public SessionContext getSessionContext()
    {
       return sessionContext;
    }
-   
+
    public ConversationContext getConversationContext()
    {
       return conversationContext;
    }
-   
+
    public RequestContext getRequestContext()
    {
       return requestContext;
    }
-   
+
    public DependentContext getDependentContext()
    {
       return dependentContext;
    }
 
-   public void activateConversationContext()
+   public void setupConversationContext()
    {
-      conversationContext.setActive(true);
-      conversationContext.setBeanStore(new HashMapBeanStore());
+      setupContext(conversationContext, new HashMapBeanStore());
    }
 
-   public void deactivateConversationContext()
+   public void teardownConversationContext()
    {
-      conversationContext.setActive(false);
-      conversationContext.setBeanStore(null);
+      teardownContext(conversationContext);
    }
 
+   private void setupContext(AbstractThreadLocalMapContext context, BeanStore beanStore)
+   {
+      context.setBeanStore(beanStore);
+      context.setActive(true);
+   }
+
+   private void setupContext(AbstractApplicationContext context, BeanStore beanStore)
+   {
+      context.setBeanStore(beanStore);
+      context.setActive(true);
+   }
+   
+   private void teardownContext(AbstractThreadLocalMapContext context)
+   {
+      context.setActive(true);
+      context.destroy();
+      context.setBeanStore(null);
+      context.setActive(false);
+   }
+   
+   private void teardownContext(AbstractApplicationContext context)
+   {
+      context.setActive(true);
+      context.destroy();
+      context.setBeanStore(null);
+      context.setActive(false);
+   }   
+
 }

Modified: core/trunk/impl/src/main/java/org/jboss/weld/context/ConversationContext.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/context/ConversationContext.java	2010-03-03 13:31:43 UTC (rev 5992)
+++ core/trunk/impl/src/main/java/org/jboss/weld/context/ConversationContext.java	2010-03-03 18:47:14 UTC (rev 5993)
@@ -63,5 +63,12 @@
       String beanStoreInfo = getBeanStore() == null ? "" : getBeanStore().toString();
       return active + "conversation context " + beanStoreInfo;
    }
+
+   public static void destroyBeanStore(BeanStore beanStore)
+   {
+      ConversationContext terminatorContext = new ConversationContext();
+      terminatorContext.setBeanStore(beanStore);
+      terminatorContext.destroy();
+   }
    
 }

Modified: core/trunk/impl/src/main/java/org/jboss/weld/conversation/AbstractConversationManager.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/conversation/AbstractConversationManager.java	2010-03-03 13:31:43 UTC (rev 5992)
+++ core/trunk/impl/src/main/java/org/jboss/weld/conversation/AbstractConversationManager.java	2010-03-03 18:47:14 UTC (rev 5993)
@@ -55,7 +55,7 @@
  * @author Nicklas Karlsson
  * 
  */
-public abstract class AbstractConversationManager implements ConversationManager, Serializable
+public abstract class AbstractConversationManager implements ConversationManager2, Serializable
 {
    private static final long serialVersionUID = 1L;
 
@@ -69,7 +69,8 @@
    @Inject
    private ConversationIdGenerator conversationIdGenerator;
 
-   @Inject @ConversationConcurrentAccessTimeout
+   @Inject
+   @ConversationConcurrentAccessTimeout
    private long concurrentAccessTimeout;
 
    private Map<String, ManagedConversation> managedConversations;
@@ -79,7 +80,7 @@
       managedConversations = new ConcurrentHashMap<String, ManagedConversation>();
    }
 
-   public ConversationManager setAsynchronous(boolean asynchronous)
+   public ConversationManager2 setAsynchronous(boolean asynchronous)
    {
       if (this.asynchronous == asynchronous)
       {
@@ -131,7 +132,7 @@
       }
    }
 
-   public ConversationManager setupConversation(String cid)
+   public ConversationManager2 setupConversation(String cid)
    {
       if (!asynchronous)
       {
@@ -175,7 +176,7 @@
       return Container.instance().services().get(ContextLifecycle.class).getConversationContext();
    }
 
-   public ConversationManager teardownConversation()
+   public ConversationManager2 teardownConversation()
    {
       log.trace(CLEANING_UP_CONVERSATION, conversation);
       if (conversation.isTransient())
@@ -275,10 +276,15 @@
       }
    }
 
-   public ConversationManager destroyAllConversations()
+   public ConversationManager2 destroyAllConversations()
    {
       log.debug(DESTROY_ALL_LRC, "session ended");
       log.trace(LRC_COUNT, managedConversations.size());
+      if (conversation.getResumedId() != null)
+      {
+         // Already destroyed when context destroyed
+         managedConversations.remove(conversation.getResumedId());
+      }
       for (ManagedConversation managedConversation : managedConversations.values())
       {
          log.debug(DESTROY_LRC, managedConversation, "session ended");
@@ -288,15 +294,16 @@
       return this;
    }
 
-   public ConversationManager activateContext()
+   public ConversationManager2 setupContext()
    {
-      Container.instance().services().get(ContextLifecycle.class).activateConversationContext();
+      Container.instance().services().get(ContextLifecycle.class).setupConversationContext();
       return this;
    }
 
-   public ConversationManager deactivateContext()
+   public ConversationManager2 teardownContext()
    {
-      Container.instance().services().get(ContextLifecycle.class).deactivateConversationContext();
+      Container.instance().services().get(ContextLifecycle.class).teardownConversationContext();
+      destroyAllConversations();
       return this;
    }
 

Modified: core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationImpl.java	2010-03-03 13:31:43 UTC (rev 5992)
+++ core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationImpl.java	2010-03-03 18:47:14 UTC (rev 5993)
@@ -52,7 +52,7 @@
    private static final LocLogger log = loggerFactory().getLogger(CONVERSATION);
 
    @Inject
-   private ConversationManager conversationManager;
+   private ConversationManager2 conversationManager;
 
    private String id;
    private boolean _transient = true;
@@ -79,7 +79,7 @@
     * 
     * @param conversation The old conversation
     */
-   protected ConversationImpl(Conversation conversation, ConversationManager conversationManager)
+   protected ConversationImpl(Conversation conversation, ConversationManager2 conversationManager)
    {
       id = conversation.getId();
       _transient = conversation.isTransient();
@@ -88,7 +88,7 @@
       this.conversationManager = conversationManager;
    }
    
-   public static ConversationImpl of(Conversation conversation, ConversationManager conversationManager)
+   public static ConversationImpl of(Conversation conversation, ConversationManager2 conversationManager)
    {
       return new ConversationImpl(conversation, conversationManager);
    }
@@ -220,7 +220,7 @@
       return resumedId;
    }
 
-   public ConversationImpl unProxy(ConversationManager conversationManager)
+   public ConversationImpl unProxy(ConversationManager2 conversationManager)
    {
       return new ConversationImpl(this, conversationManager);
    }

Deleted: core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationManager.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationManager.java	2010-03-03 13:31:43 UTC (rev 5992)
+++ core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationManager.java	2010-03-03 18:47:14 UTC (rev 5993)
@@ -1,96 +0,0 @@
-package org.jboss.weld.conversation;
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.util.Map;
-
-import javax.enterprise.context.Conversation;
-
-public interface ConversationManager
-{
-   /**
-    * Checks the state of the conversation context
-    * 
-    * @return true if the conversation context is active, false otherwise
-    */
-   public abstract boolean isContextActive();
-   
-   /**
-    * Activates the conversation context
-    * 
-    * @return The conversation manager
-    * 
-    * @throws IllegalStateException if the context is already active
-    */   
-   public abstract ConversationManager activateContext();
-   
-   /**
-    * Deactivates the conversation context
-    * 
-    * @return The conversation manager
-    * 
-    * @throws IllegalStateException if the context is already deactive
-    */   
-   public abstract ConversationManager deactivateContext();
-
-   /**
-    * Resumes a long running conversation. If the cid is null, nothing is done and the current
-    * transient conversation is resumed
-    * 
-    * 
-    * @param cid The conversation id to restore
-    * @return The conversation manager
-    * @throws NonexistentConversationException If the non-transient conversation is not known
-    * @throws BusyConversationException If the conversation is locked and not released while waiting 
-    * @throws IllegalStateException if the conversation context is not active
-    */
-   
-   public abstract ConversationManager setupConversation(String cid);
-   
-   /**
-    * Destroys the current conversation if it's transient. Stores it for conversation 
-    * propagation if it's non-transient
-    * 
-    * @return The conversation manager
-    * @throws IllegalStateException if the conversation context is not active
-    */
-   public abstract ConversationManager teardownConversation();
-   
-   /**
-    * Gets the current non-transient conversations
-    * 
-    * @return The conversations, mapped by id
-    * @throws IllegalStateException if the conversation context is not active
-    */
-   public abstract Map<String, Conversation> getConversations();
-
-   /**
-    * Returns a new, session-unique conversation ID
-    * 
-    * @return The conversation id
-    * @throws IllegalStateException if the conversation context is not active
-    */   
-   public abstract String generateConversationId();
- 
-   /**
-    * Destroys all non-transient conversations
-    * 
-    * @return The conversation manager
-    */
-   public abstract ConversationManager destroyAllConversations();
-   
-}

Copied: core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationManager2.java (from rev 5968, core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationManager.java)
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationManager2.java	                        (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationManager2.java	2010-03-03 18:47:14 UTC (rev 5993)
@@ -0,0 +1,89 @@
+package org.jboss.weld.conversation;
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.Map;
+
+import javax.enterprise.context.Conversation;
+
+public interface ConversationManager2
+{
+   /**
+    * Checks the state of the conversation context
+    * 
+    * @return true if the conversation context is active, false otherwise
+    */
+   public abstract boolean isContextActive();
+   
+   /**
+    * Sets up and activates the conversation context
+    * 
+    * @return The conversation manager
+    * 
+    * @throws IllegalStateException if the context is already active
+    */   
+   public abstract ConversationManager2 setupContext();
+   
+   /**
+    * Destroys the conversations and deactivates the conversation context
+    * 
+    * @return The conversation manager
+    * 
+    * @throws IllegalStateException if the context is already deactive
+    */   
+   public abstract ConversationManager2 teardownContext();
+
+   /**
+    * Resumes a long running conversation. If the cid is null, nothing is done and the current
+    * transient conversation is resumed
+    * 
+    * 
+    * @param cid The conversation id to restore
+    * @return The conversation manager
+    * @throws NonexistentConversationException If the non-transient conversation is not known
+    * @throws BusyConversationException If the conversation is locked and not released while waiting 
+    * @throws IllegalStateException if the conversation context is not active
+    */
+   
+   public abstract ConversationManager2 setupConversation(String cid);
+   
+   /**
+    * Destroys the current conversation if it's transient. Stores it for conversation 
+    * propagation if it's non-transient
+    * 
+    * @return The conversation manager
+    * @throws IllegalStateException if the conversation context is not active
+    */
+   public abstract ConversationManager2 teardownConversation();
+   
+   /**
+    * Gets the current non-transient conversations
+    * 
+    * @return The conversations, mapped by id
+    * @throws IllegalStateException if the conversation context is not active
+    */
+   public abstract Map<String, Conversation> getConversations();
+
+   /**
+    * Returns a new, session-unique conversation ID
+    * 
+    * @return The conversation id
+    * @throws IllegalStateException if the conversation context is not active
+    */   
+   public abstract String generateConversationId();
+ 
+}

Added: core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationManagerAdapter.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationManagerAdapter.java	                        (rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationManagerAdapter.java	2010-03-03 18:47:14 UTC (rev 5993)
@@ -0,0 +1,44 @@
+package org.jboss.weld.conversation;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.context.Conversation;
+import javax.enterprise.context.SessionScoped;
+import javax.inject.Inject;
+
+ at SessionScoped
+public class ConversationManagerAdapter implements ConversationManager
+{
+
+   public ConversationManagerAdapter()
+   {
+   }
+
+   @Inject
+   private ConversationManager2 conversationManager;
+
+   public void beginOrRestoreConversation(String cid)
+   {
+      conversationManager.setupConversation(cid);
+   }
+
+   public void cleanupConversation()
+   {
+      conversationManager.teardownConversation();
+   }
+
+   public void destroyAllConversations()
+   {
+      conversationManager.teardownContext();
+   }
+
+   public Set<Conversation> getLongRunningConversations()
+   {
+      Set<Conversation> conversations = new HashSet<Conversation>();
+      conversations.addAll(conversationManager.getConversations().values());
+      return Collections.unmodifiableSet(conversations);
+   }
+
+}

Modified: core/trunk/impl/src/main/java/org/jboss/weld/conversation/ManagedConversation.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/conversation/ManagedConversation.java	2010-03-03 13:31:43 UTC (rev 5992)
+++ core/trunk/impl/src/main/java/org/jboss/weld/conversation/ManagedConversation.java	2010-03-03 18:47:14 UTC (rev 5993)
@@ -127,9 +127,7 @@
       {
          cancelTermination();
       }
-      ConversationContext terminationContext = new ConversationContext();
-      terminationContext.setBeanStore(beanStore);
-      terminationContext.destroy();
+      ConversationContext.destroyBeanStore(beanStore);
    }
 
    /**

Modified: core/trunk/impl/src/main/java/org/jboss/weld/jsf/WeldPhaseListener.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/jsf/WeldPhaseListener.java	2010-03-03 13:31:43 UTC (rev 5992)
+++ core/trunk/impl/src/main/java/org/jboss/weld/jsf/WeldPhaseListener.java	2010-03-03 18:47:14 UTC (rev 5993)
@@ -35,7 +35,7 @@
 import javax.faces.event.PhaseId;
 import javax.faces.event.PhaseListener;
 
-import org.jboss.weld.conversation.ConversationManager;
+import org.jboss.weld.conversation.ConversationManager2;
 import org.slf4j.cal10n.LocLogger;
 
 /**
@@ -64,9 +64,9 @@
 
    private static final LocLogger log = loggerFactory().getLogger(JSF);
 
-   private ConversationManager conversationManager;
+   private ConversationManager2 conversationManager;
 
-   private ConversationManager getConversationManager()
+   private ConversationManager2 getConversationManager()
    {
       if (conversationManager == null)
       {

Modified: core/trunk/impl/src/main/java/org/jboss/weld/servlet/BeanProvider.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/servlet/BeanProvider.java	2010-03-03 13:31:43 UTC (rev 5992)
+++ core/trunk/impl/src/main/java/org/jboss/weld/servlet/BeanProvider.java	2010-03-03 18:47:14 UTC (rev 5993)
@@ -24,7 +24,7 @@
 
 import org.jboss.weld.conversation.ConversationIdName;
 import org.jboss.weld.conversation.ConversationImpl;
-import org.jboss.weld.conversation.ConversationManager;
+import org.jboss.weld.conversation.ConversationManager2;
 import org.jboss.weld.manager.BeanManagerImpl;
 
 public class BeanProvider
@@ -39,11 +39,11 @@
       
    }
    
-   public static ConversationManager conversationManager(ServletContext servletContext)
+   public static ConversationManager2 conversationManager(ServletContext servletContext)
    {
       BeanManagerImpl beanManager = getModuleBeanManager(servletContext);
-      Bean<?> bean = beanManager.resolve(beanManager.getBeans(ConversationManager.class));
-      return (ConversationManager) beanManager.getReference(bean, ConversationManager.class, beanManager.createCreationalContext(bean));
+      Bean<?> bean = beanManager.resolve(beanManager.getBeans(ConversationManager2.class));
+      return (ConversationManager2) beanManager.getReference(bean, ConversationManager2.class, beanManager.createCreationalContext(bean));
    }
    
    public static HttpSessionManager httpSessionManager(ServletContext servletContext)



More information about the weld-commits mailing list