Author: nickarls
Date: 2010-03-06 17:51:41 -0500 (Sat, 06 Mar 2010)
New Revision: 6015
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/conversation/AbstractConversationManager.java
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ConversationMessage.java
core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java
core/trunk/impl/src/main/resources/org/jboss/weld/messages/conversation_en.properties
core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/sessionInvalidation/Storm.java
Log:
Fix an incontainer core test (http session injection)
rename ACM.destroyAllConversations -> destroyBackgroundConversations
Message for mode switching
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-06
22:07:00 UTC (rev 6014)
+++
core/trunk/impl/src/main/java/org/jboss/weld/conversation/AbstractConversationManager.java 2010-03-06
22:51:41 UTC (rev 6015)
@@ -27,6 +27,7 @@
import static org.jboss.weld.logging.messages.ConversationMessage.LRC_COUNT;
import static
org.jboss.weld.logging.messages.ConversationMessage.NO_CONVERSATION_TO_RESTORE;
import static
org.jboss.weld.logging.messages.ConversationMessage.UNABLE_TO_RESTORE_CONVERSATION;
+import static
org.jboss.weld.logging.messages.ConversationMessage.SWITCHING_MODE_RESETS_TIMEOUTS;
import java.io.Serializable;
import java.util.Collections;
@@ -88,7 +89,7 @@
}
if (!managedConversations.isEmpty())
{
- log.warn("Switching modes with non-transient conversations present resets
the timeouts");
+ log.warn(SWITCHING_MODE_RESETS_TIMEOUTS);
}
if (asynchronous)
{
@@ -276,7 +277,7 @@
}
}
- public ConversationManager2 destroyAllConversations()
+ public ConversationManager2 destroyBackgroundConversations()
{
log.debug(DESTROY_ALL_LRC, "session ended");
log.trace(LRC_COUNT, managedConversations.size());
@@ -303,7 +304,7 @@
public ConversationManager2 teardownContext()
{
Container.instance().services().get(ContextLifecycle.class).teardownConversationContext();
- destroyAllConversations();
+ destroyBackgroundConversations();
return this;
}
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ConversationMessage.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ConversationMessage.java 2010-03-06
22:07:00 UTC (rev 6014)
+++
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ConversationMessage.java 2010-03-06
22:51:41 UTC (rev 6015)
@@ -57,7 +57,7 @@
@MessageId("000319") SWITCHED_CONVERSATION,
@MessageId("000214") BEGIN_CALLED_ON_LONG_RUNNING_CONVERSATION,
@MessageId("000215") END_CALLED_ON_TRANSIENT_CONVERSATION,
- @MessageId("000216") NULL_HTTP_SESSION;
- ;
+ @MessageId("000216") NULL_HTTP_SESSION,
+ @MessageId("000217") SWITCHING_MODE_RESETS_TIMEOUTS;
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java 2010-03-06
22:07:00 UTC (rev 6014)
+++ core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java 2010-03-06
22:51:41 UTC (rev 6015)
@@ -22,12 +22,10 @@
*/
package org.jboss.weld.servlet;
-import static org.jboss.weld.jsf.JsfHelper.getServletContext;
import static
org.jboss.weld.logging.messages.ServletMessage.REQUEST_SCOPE_BEAN_STORE_MISSING;
import static org.jboss.weld.servlet.BeanProvider.conversationManager;
import static org.jboss.weld.servlet.BeanProvider.httpSessionManager;
-import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
@@ -107,7 +105,7 @@
else if (lifecycle.getRequestContext().isActive())
{
BeanStore store = restoreSessionContext(session);
- conversationManager.destroyAllConversations();
+ conversationManager.destroyBackgroundConversations();
lifecycle.endSession(session.getId(), store);
}
else
@@ -182,8 +180,8 @@
conversationManager(sessionBeanStore.getServletContext()).teardownContext();
lifecycle.endSession(request.getRequestedSessionId(), sessionBeanStore);
}
- lifecycle.getSessionContext().setActive(false);
lifecycle.getSessionContext().setBeanStore(null);
+ lifecycle.getSessionContext().setActive(false);
BeanStore beanStore = (BeanStore) request.getAttribute(REQUEST_ATTRIBUTE_NAME);
if (beanStore == null)
{
Modified:
core/trunk/impl/src/main/resources/org/jboss/weld/messages/conversation_en.properties
===================================================================
---
core/trunk/impl/src/main/resources/org/jboss/weld/messages/conversation_en.properties 2010-03-06
22:07:00 UTC (rev 6014)
+++
core/trunk/impl/src/main/resources/org/jboss/weld/messages/conversation_en.properties 2010-03-06
22:51:41 UTC (rev 6015)
@@ -21,3 +21,4 @@
BEGIN_CALLED_ON_LONG_RUNNING_CONVERSATION=Attempt to call begin() on a long-running
conversation
END_CALLED_ON_TRANSIENT_CONVERSATION=Attempt to call end() on a transient conversation
NULL_HTTP_SESSION=Cannot create ConversationBeanStore with a null HTTP session
+SWITCHING_MODE_RESETS_TIMEOUTS=Switching modes with non-transient conversations present
resets the timeouts
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/sessionInvalidation/Storm.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/sessionInvalidation/Storm.java 2010-03-06
22:07:00 UTC (rev 6014)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/contexts/sessionInvalidation/Storm.java 2010-03-06
22:51:41 UTC (rev 6015)
@@ -18,13 +18,14 @@
import javax.inject.Inject;
import javax.inject.Named;
-import javax.servlet.http.HttpSession;
+import org.jboss.weld.servlet.HttpSessionManager;
+
@Named
public class Storm
{
- @Inject HttpSession session;
+ @Inject HttpSessionManager sessionManager;
@Inject SomeBean someBean;
public static final String PROPERTY_VALUE = "some value";
@@ -32,7 +33,7 @@
public String invalidateSession()
{
someBean.setProp(PROPERTY_VALUE);
- session.invalidate();
+ sessionManager.getSession().invalidate();
return "success";
}
Show replies by date