tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmar...@apache.org
Subject svn commit: r392206 - in /incubator/tuscany/java/sca: containers/container.java/src/test/java/org/apache/tuscany/container/java/scopes/ core/src/main/java/org/apache/tuscany/core/context/scope/
Date Fri, 07 Apr 2006 07:23:37 GMT
Author: jmarino
Date: Fri Apr  7 00:23:34 2006
New Revision: 392206

URL: http://svn.apache.org/viewcvs?rev=392206&view=rev
Log:
refactor scope contexts

Added:
    incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/SessionScopeContext.java
  (contents, props changed)
      - copied, changed from r392199, incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/HttpSessionScopeContext.java
Removed:
    incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/HttpSessionScopeContext.java
Modified:
    incubator/tuscany/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicHttpSessionScopeTestCase.java
    incubator/tuscany/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/scopes/HttpSessionScopeLifecycleTestCase.java
    incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/AbstractScopeContext.java
    incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/DefaultScopeStrategy.java
    incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/ModuleScopeContext.java
    incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/RequestScopeContext.java
    incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/StatelessScopeContext.java

Modified: incubator/tuscany/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicHttpSessionScopeTestCase.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicHttpSessionScopeTestCase.java?rev=392206&r1=392205&r2=392206&view=diff
==============================================================================
--- incubator/tuscany/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicHttpSessionScopeTestCase.java
(original)
+++ incubator/tuscany/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/scopes/BasicHttpSessionScopeTestCase.java
Fri Apr  7 00:23:34 2006
@@ -32,7 +32,7 @@
 import org.apache.tuscany.core.context.EventContext;
 import org.apache.tuscany.core.context.Context;
 import org.apache.tuscany.core.context.impl.EventContextImpl;
-import org.apache.tuscany.core.context.scope.HttpSessionScopeContext;
+import org.apache.tuscany.core.context.scope.SessionScopeContext;
 import org.apache.tuscany.model.assembly.Scope;
 import org.apache.tuscany.model.assembly.SimpleComponent;
 
@@ -48,7 +48,7 @@
      */
     public void testInstanceManagement() throws Exception {
         EventContext ctx = new EventContextImpl();
-        HttpSessionScopeContext scope = new HttpSessionScopeContext(ctx);
+        SessionScopeContext scope = new SessionScopeContext(ctx);
         scope.registerFactories(createConfigurations());
         scope.start();
         Object session = new Object();
@@ -84,7 +84,7 @@
      */
     public void testSetNullComponents() throws Exception {
         EventContext ctx = new EventContextImpl();
-        HttpSessionScopeContext scope = new HttpSessionScopeContext(ctx);
+        SessionScopeContext scope = new SessionScopeContext(ctx);
         scope.registerFactories(new ArrayList<ContextFactory<Context>>());
         scope.start();
         scope.stop();
@@ -92,7 +92,7 @@
 
     public void testGetContextByKey() throws Exception {
         EventContext ctx = new EventContextImpl();
-        HttpSessionScopeContext scope = new HttpSessionScopeContext(ctx);
+        SessionScopeContext scope = new SessionScopeContext(ctx);
         scope.registerFactories(createConfigurations());
         scope.start();
         Object session = new Object();
@@ -125,7 +125,7 @@
 
     public void testRegisterContextBeforeSession() throws Exception {
         EventContext ctx = new EventContextImpl();
-        HttpSessionScopeContext scope = new HttpSessionScopeContext(ctx);
+        SessionScopeContext scope = new SessionScopeContext(ctx);
         scope.registerFactories(createConfigurations());
         scope.start();
         Object session = new Object();
@@ -163,7 +163,7 @@
      */
     public void testRegisterContextAfterSession() throws Exception {
         EventContext ctx = new EventContextImpl();
-        HttpSessionScopeContext scope = new HttpSessionScopeContext(ctx);
+        SessionScopeContext scope = new SessionScopeContext(ctx);
         scope.registerFactories(createConfigurations());
         scope.start();
         Object session = new Object();

Modified: incubator/tuscany/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/scopes/HttpSessionScopeLifecycleTestCase.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/scopes/HttpSessionScopeLifecycleTestCase.java?rev=392206&r1=392205&r2=392206&view=diff
==============================================================================
--- incubator/tuscany/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/scopes/HttpSessionScopeLifecycleTestCase.java
(original)
+++ incubator/tuscany/java/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/scopes/HttpSessionScopeLifecycleTestCase.java
Fri Apr  7 00:23:34 2006
@@ -32,7 +32,7 @@
 import org.apache.tuscany.core.context.EventContext;
 import org.apache.tuscany.core.context.Context;
 import org.apache.tuscany.core.context.impl.EventContextImpl;
-import org.apache.tuscany.core.context.scope.HttpSessionScopeContext;
+import org.apache.tuscany.core.context.scope.SessionScopeContext;
 import org.apache.tuscany.model.assembly.Scope;
 import org.apache.tuscany.model.assembly.SimpleComponent;
 
@@ -48,7 +48,7 @@
      */
     public void testInitDestroy() throws Exception {
         EventContext ctx = new EventContextImpl();
-        HttpSessionScopeContext scope = new HttpSessionScopeContext(ctx);
+        SessionScopeContext scope = new SessionScopeContext(ctx);
         scope.registerFactories(createComponents());
         scope.start();
         Object session = new Object();
@@ -85,7 +85,7 @@
      */
     public void testDestroyOrder() throws Exception {
         EventContext ctx = new EventContextImpl();
-        HttpSessionScopeContext scope = new HttpSessionScopeContext(ctx);
+        SessionScopeContext scope = new SessionScopeContext(ctx);
         scope.registerFactories(createOrderedInitComponents());
         scope.start();
         Object session = new Object();

Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/AbstractScopeContext.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/AbstractScopeContext.java?rev=392206&r1=392205&r2=392206&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/AbstractScopeContext.java
(original)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/AbstractScopeContext.java
Fri Apr  7 00:23:34 2006
@@ -44,12 +44,6 @@
         this.eventContext = eventContext;
     }
 
-    public synchronized void start() {
-    }
-
-    public synchronized void stop() {
-    }
-
     public void registerFactories(List<ContextFactory<Context>> configurations)
{
         for (ContextFactory<Context> configuration : configurations) {
             contextFactorys.put(configuration.getName(), configuration);

Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/DefaultScopeStrategy.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/DefaultScopeStrategy.java?rev=392206&r1=392205&r2=392206&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/DefaultScopeStrategy.java
(original)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/DefaultScopeStrategy.java
Fri Apr  7 00:23:34 2006
@@ -36,7 +36,7 @@
 
     public Map<Scope,ScopeContext> createScopes(EventContext eventContext) {
         ScopeContext moduleScope = new ModuleScopeContext(eventContext);
-        ScopeContext sessionScope = new HttpSessionScopeContext(eventContext);
+        ScopeContext sessionScope = new SessionScopeContext(eventContext);
         ScopeContext requestScope = new RequestScopeContext(eventContext);
         ScopeContext statelessScope = new StatelessScopeContext(eventContext);
         ScopeContext aggregrateScope = new CompositeScopeContext(eventContext);

Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/ModuleScopeContext.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/ModuleScopeContext.java?rev=392206&r1=392205&r2=392206&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/ModuleScopeContext.java
(original)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/ModuleScopeContext.java
Fri Apr  7 00:23:34 2006
@@ -73,7 +73,6 @@
         if (lifecycleState != RUNNING) {
             throw new IllegalStateException("Scope in wrong state [" + lifecycleState + "]");
         }
-        super.stop();
         componentContexts = null;
         destroyableContexts = null;
         lifecycleState = STOPPED;

Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/RequestScopeContext.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/RequestScopeContext.java?rev=392206&r1=392205&r2=392206&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/RequestScopeContext.java
(original)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/RequestScopeContext.java
Fri Apr  7 00:23:34 2006
@@ -72,7 +72,6 @@
         if (lifecycleState != UNINITIALIZED) {
             throw new IllegalStateException("Scope must be in UNINITIALIZED state [" + lifecycleState
+ "]");
         }
-        super.start();
         contextMap = new ConcurrentHashMap<Object, Map<String, Context>>();
         destroyComponents = new ConcurrentHashMap<Object, Queue<AtomicContext>>();
         lifecycleState = RUNNING;
@@ -83,7 +82,6 @@
         if (lifecycleState != RUNNING) {
             throw new IllegalStateException("Scope in wrong state [" + lifecycleState + "]");
         }
-        super.stop();
         contextMap = null;
         destroyComponents = null;
         lifecycleState = STOPPED;

Copied: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/SessionScopeContext.java
(from r392199, incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/HttpSessionScopeContext.java)
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/SessionScopeContext.java?p2=incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/SessionScopeContext.java&p1=incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/HttpSessionScopeContext.java&r1=392199&r2=392206&rev=392206&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/HttpSessionScopeContext.java
(original)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/SessionScopeContext.java
Fri Apr  7 00:23:34 2006
@@ -25,11 +25,11 @@
 import java.util.concurrent.ConcurrentLinkedQueue;
 
 /**
- * An implementation of an HTTP session-scoped component container where each HTTP session
is mapped to a context in the scope
+ * An implementation of an session-scoped component container where each HTTP session is
mapped to a context in the scope
  * 
  * @version $Rev$ $Date$
  */
-public class HttpSessionScopeContext extends AbstractScopeContext implements RuntimeEventListener
{
+public class SessionScopeContext extends AbstractScopeContext implements RuntimeEventListener
{
 
     // The collection of service component contexts keyed by session
     private Map<Object, Map<String, Context>> contexts;
@@ -37,16 +37,15 @@
     // Stores ordered lists of contexts to shutdown keyed by session
     private Map<Object, Queue<AtomicContext>> destroyableContexts;
 
-    public HttpSessionScopeContext(EventContext eventContext) {
+    public SessionScopeContext(EventContext eventContext) {
         super(eventContext);
-        setName("Http Session Scope");
+        setName("Session Scope");
     }
 
     public synchronized void start() {
         if (lifecycleState != UNINITIALIZED) {
             throw new IllegalStateException("Scope container must be in UNINITIALIZED state");
         }
-        super.start();
         contexts = new ConcurrentHashMap<Object, Map<String, Context>>();
         destroyableContexts = new ConcurrentHashMap<Object, Queue<AtomicContext>>();
         lifecycleState = RUNNING;
@@ -56,7 +55,6 @@
         if (lifecycleState != RUNNING) {
             throw new IllegalStateException("Scope container in wrong state");
         }
-        super.stop();
         contexts = null;
         contexts = null;
         destroyableContexts = null;

Propchange: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/SessionScopeContext.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/StatelessScopeContext.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/StatelessScopeContext.java?rev=392206&r1=392205&r2=392206&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/StatelessScopeContext.java
(original)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/context/scope/StatelessScopeContext.java
Fri Apr  7 00:23:34 2006
@@ -41,7 +41,6 @@
         if (lifecycleState != UNINITIALIZED) {
             throw new IllegalStateException("Scope must be in UNINITIALIZED state [" + lifecycleState
+ "]");
         }
-        super.start();
         lifecycleState = RUNNING;
         prepare();
     }
@@ -50,7 +49,6 @@
         if (lifecycleState != RUNNING) {
             throw new IllegalStateException("Scope in wrong state [" + lifecycleState + "]");
         }
-        super.stop();
         contextMap = null;
         lifecycleState = STOPPED;
     }



Mime
View raw message