[jboss-cvs] jboss-seam/src/main/org/jboss/seam/contexts ...
Gavin King
gavin.king at jboss.com
Sun Jun 10 15:39:15 EDT 2007
User: gavin
Date: 07/06/10 15:39:15
Modified: src/main/org/jboss/seam/contexts BasicContext.java
BusinessProcessContext.java
ClientConversationContext.java Context.java
Lifecycle.java ServerConversationContext.java
SessionContext.java
Added: src/main/org/jboss/seam/contexts
ApplicationContext.java EventContext.java
Log:
cleaner
Revision Changes Path
1.2 +5 -2 jboss-seam/src/main/org/jboss/seam/contexts/BasicContext.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BasicContext.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/BasicContext.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- BasicContext.java 10 Jun 2007 19:25:58 -0000 1.1
+++ BasicContext.java 10 Jun 2007 19:39:15 -0000 1.2
@@ -1,4 +1,4 @@
-//$Id: BasicContext.java,v 1.1 2007/06/10 19:25:58 gavin Exp $
+//$Id: BasicContext.java,v 1.2 2007/06/10 19:39:15 gavin Exp $
package org.jboss.seam.contexts;
import java.util.HashMap;
@@ -8,6 +8,9 @@
import org.jboss.seam.ScopeType;
import org.jboss.seam.core.Events;
+/**
+ * @author Gavin King
+ */
public class BasicContext implements Context
{
@@ -20,7 +23,7 @@
this.map = new HashMap<String, Object>();
}
- public BasicContext(ScopeType scope, Map<String, Object> map)
+ protected BasicContext(ScopeType scope, Map<String, Object> map)
{
this.scope = scope;
this.map = map;
1.36 +0 -1 jboss-seam/src/main/org/jboss/seam/contexts/BusinessProcessContext.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BusinessProcessContext.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/BusinessProcessContext.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -b -r1.35 -r1.36
--- BusinessProcessContext.java 19 May 2007 01:36:52 -0000 1.35
+++ BusinessProcessContext.java 10 Jun 2007 19:39:15 -0000 1.36
@@ -27,7 +27,6 @@
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
* @author <a href="mailto:steve at hibernate.org">Steve Ebersole</a>
* @author Gavin King
- * @version $Revision: 1.35 $
*/
public class BusinessProcessContext implements Context {
1.11 +0 -1 jboss-seam/src/main/org/jboss/seam/contexts/ClientConversationContext.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ClientConversationContext.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/ClientConversationContext.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- ClientConversationContext.java 21 Feb 2007 16:58:41 -0000 1.10
+++ ClientConversationContext.java 10 Jun 2007 19:39:15 -0000 1.11
@@ -22,7 +22,6 @@
*
* @author Gavin King
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision: 1.10 $
*/
public class ClientConversationContext implements Context {
1.8 +2 -2 jboss-seam/src/main/org/jboss/seam/contexts/Context.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Context.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/Context.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- Context.java 18 Nov 2006 00:38:22 -0000 1.7
+++ Context.java 10 Jun 2007 19:39:15 -0000 1.8
@@ -13,9 +13,9 @@
* is associated with a particular seam context.
*
* @author Gavin King
- * @version $Revision: 1.7 $
*/
-public interface Context {
+public interface Context
+{
public Object get(String name);
public Object get(Class clazz);
public void set(String name, Object value);
1.92 +15 -15 jboss-seam/src/main/org/jboss/seam/contexts/Lifecycle.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Lifecycle.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/Lifecycle.java,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -b -r1.91 -r1.92
--- Lifecycle.java 10 Jun 2007 19:25:58 -0000 1.91
+++ Lifecycle.java 10 Jun 2007 19:39:15 -0000 1.92
@@ -33,7 +33,7 @@
/**
* @author Gavin King
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision: 1.91 $
+ * @version $Revision: 1.92 $
*/
public class Lifecycle
{
@@ -43,8 +43,8 @@
public static void beginRequest(ExternalContext externalContext)
{
log.debug( ">>> Begin web request" );
- Contexts.eventContext.set( new BasicContext( ScopeType.EVENT, externalContext.getRequestMap() ) );
- Contexts.applicationContext.set( new BasicContext( ScopeType.APPLICATION, externalContext.getApplicationMap() ) );
+ Contexts.eventContext.set( new EventContext( externalContext.getRequestMap() ) );
+ Contexts.applicationContext.set( new ApplicationContext( externalContext.getApplicationMap() ) );
Contexts.sessionContext.set( new SessionContext( externalContext.getSessionMap() ) );
ServletSession servletSession = ServletSession.getInstance();
if ( servletSession!=null && servletSession.isInvalidDueToNewScheme() )
@@ -58,9 +58,9 @@
public static void beginRequest(ServletContext servletContext, HttpServletRequest request)
{
log.debug( ">>> Begin web request" );
- Contexts.eventContext.set( new BasicContext( ScopeType.EVENT, new ServletRequestMap(request) ) );
+ Contexts.eventContext.set( new EventContext( new ServletRequestMap(request) ) );
Contexts.sessionContext.set( new SessionContext( new ServletRequestSessionMap(request) ) );
- Contexts.applicationContext.set( new BasicContext( ScopeType.APPLICATION, new ServletApplicationMap(servletContext) ) );
+ Contexts.applicationContext.set(new ApplicationContext( new ServletApplicationMap(servletContext) ) );
Contexts.conversationContext.set(null); //in case endRequest() was never called
}
@@ -71,7 +71,7 @@
Contexts.sessionContext.set( new BasicContext(ScopeType.SESSION) );
Contexts.conversationContext.set( new BasicContext(ScopeType.CONVERSATION) );
Contexts.businessProcessContext.set( new BusinessProcessContext() );
- Contexts.applicationContext.set( new BasicContext( ScopeType.APPLICATION, new ServletApplicationMap( getServletContext() ) ) );
+ Contexts.applicationContext.set( new ApplicationContext( new ServletApplicationMap( getServletContext() ) ) );
}
public static void endCall()
@@ -95,7 +95,7 @@
public static void mockApplication()
{
- Contexts.applicationContext.set( new BasicContext(ScopeType.APPLICATION, new ServletApplicationMap( getServletContext() ) ) );
+ Contexts.applicationContext.set( new ApplicationContext( new ServletApplicationMap( getServletContext() ) ) );
}
public static void unmockApplication()
@@ -117,14 +117,14 @@
public static void beginInitialization(ServletContext servletContext)
{
- Contexts.applicationContext.set( new BasicContext( ScopeType.APPLICATION, new ServletApplicationMap(servletContext) ) );
+ Contexts.applicationContext.set( new ApplicationContext( new ServletApplicationMap(servletContext) ) );
Contexts.eventContext.set( new BasicContext(ScopeType.EVENT) );
Contexts.conversationContext.set( new BasicContext(ScopeType.CONVERSATION) );
}
public static void beginReinitialization(ServletContext servletContext, HttpServletRequest request)
{
- Contexts.applicationContext.set(new BasicContext( ScopeType.APPLICATION, new ServletApplicationMap(servletContext) ) );
+ Contexts.applicationContext.set( new ApplicationContext( new ServletApplicationMap(servletContext) ) );
Contexts.eventContext.set( new BasicContext(ScopeType.EVENT) );
Contexts.sessionContext.set( new SessionContext( new ServletRequestSessionMap(request) ) );
Contexts.conversationContext.set( new BasicContext(ScopeType.CONVERSATION) );
@@ -132,8 +132,8 @@
public static void beginExceptionRecovery(ExternalContext externalContext)
{
- Contexts.applicationContext.set( new BasicContext( ScopeType.APPLICATION, externalContext.getApplicationMap() ) );
- Contexts.eventContext.set( new BasicContext( ScopeType.EVENT, externalContext.getRequestMap() ) );
+ Contexts.applicationContext.set( new ApplicationContext( externalContext.getApplicationMap() ) );
+ Contexts.eventContext.set( new EventContext( externalContext.getRequestMap() ) );
Contexts.sessionContext.set( new SessionContext( externalContext.getSessionMap() ) );
Contexts.conversationContext.set( new ServerConversationContext( externalContext.getSessionMap() ) );
Contexts.pageContext.set(null);
@@ -198,8 +198,8 @@
{
log.debug("Undeploying, destroying application context");
- Context tempApplicationContext = new BasicContext( ScopeType.APPLICATION, new ServletApplicationMap(servletContext) );
- Contexts.applicationContext.set( tempApplicationContext );
+ Context tempApplicationContext = new ApplicationContext( new ServletApplicationMap(servletContext) );
+ Contexts.applicationContext.set(tempApplicationContext);
Contexts.destroy(tempApplicationContext);
Contexts.applicationContext.set(null);
Contexts.eventContext.set(null);
@@ -223,7 +223,7 @@
boolean sessionContextActive = Contexts.isSessionContextActive();
if ( !applicationContextActive )
{
- Context tempApplicationContext = new BasicContext( ScopeType.APPLICATION, new ServletApplicationMap(servletContext) );
+ Context tempApplicationContext = new ApplicationContext( new ServletApplicationMap(servletContext) );
Contexts.applicationContext.set(tempApplicationContext);
}
if ( !sessionContextActive )
@@ -280,7 +280,7 @@
throw new IllegalStateException("Please end the HttpSession via Seam.invalidateSession()");
}
- Context tempApplicationContext = new BasicContext( ScopeType.APPLICATION, new ServletApplicationMap(servletContext) );
+ Context tempApplicationContext = new ApplicationContext( new ServletApplicationMap(servletContext) );
Contexts.applicationContext.set(tempApplicationContext);
//this is used just as a place to stick the ConversationManager
1.24 +0 -1 jboss-seam/src/main/org/jboss/seam/contexts/ServerConversationContext.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: ServerConversationContext.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/ServerConversationContext.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- ServerConversationContext.java 10 Jun 2007 19:25:58 -0000 1.23
+++ ServerConversationContext.java 10 Jun 2007 19:39:15 -0000 1.24
@@ -26,7 +26,6 @@
*
* @author Gavin King
* @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision: 1.23 $
*/
public class ServerConversationContext implements Context {
1.2 +0 -2 jboss-seam/src/main/org/jboss/seam/contexts/SessionContext.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: SessionContext.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/contexts/SessionContext.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- SessionContext.java 10 Jun 2007 19:25:58 -0000 1.1
+++ SessionContext.java 10 Jun 2007 19:39:15 -0000 1.2
@@ -14,8 +14,6 @@
/**
* @author Gavin King
- * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @version $Revision: 1.1 $
*/
public class SessionContext extends BasicContext
{
1.1 date: 2007/06/10 19:39:15; author: gavin; state: Exp;jboss-seam/src/main/org/jboss/seam/contexts/ApplicationContext.java
Index: ApplicationContext.java
===================================================================
/*
* JBoss, Home of Professional Open Source
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.seam.contexts;
import java.util.Map;
import org.jboss.seam.ScopeType;
/**
* @author Gavin King
*/
public class ApplicationContext extends BasicContext
{
public ApplicationContext(Map<String, Object> map)
{
super(ScopeType.APPLICATION, map);
}
}
1.6 +13 -41 jboss-seam/src/main/org/jboss/seam/contexts/EventContext.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: EventContext.java
===================================================================
RCS file: EventContext.java
diff -N EventContext.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ EventContext.java 10 Jun 2007 19:39:15 -0000 1.6
@@ -0,0 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.seam.contexts;
+
+import java.util.Map;
+
+import org.jboss.seam.ScopeType;
+
+/**
+ * @author Gavin King
+ */
+public class EventContext extends BasicContext
+{
+
+ public EventContext(Map<String, Object> map)
+ {
+ super(ScopeType.EVENT, map);
+ }
+
+}
More information about the jboss-cvs-commits
mailing list