tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmar...@apache.org
Subject svn commit: r411356 [2/6] - in /incubator/tuscany/sandbox/jboynes/sca: commands/launcher/ containers/container.groovy/src/main/java/org/apache/tuscany/container/extension/loader/ containers/container.groovy/src/main/java/org/apache/tuscany/container/gr...
Date Sat, 03 Jun 2006 02:25:09 GMT
Modified: incubator/tuscany/sandbox/jboynes/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/integration/context/ScopeReferenceTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/integration/context/ScopeReferenceTestCase.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/integration/context/ScopeReferenceTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/integration/context/ScopeReferenceTestCase.java Fri Jun  2 19:25:01 2006
@@ -40,7 +40,7 @@
 import org.apache.tuscany.core.context.scope.RequestScopeContext;
 import org.apache.tuscany.core.context.scope.StatelessScopeContext;
 import org.apache.tuscany.core.util.JavaIntrospectionHelper;
-import org.apache.tuscany.spi.context.AtomicContext;
+import org.apache.tuscany.spi.context.AtomicComponent;
 import org.apache.tuscany.spi.context.ScopeContext;
 import org.apache.tuscany.spi.context.WorkContext;
 
@@ -61,12 +61,12 @@
         ScopeContext scope = new ModuleScopeContext(null);
         scope.start();
 
-        Map<String, AtomicContext> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class, scope, members, "target", Target.class, TargetImpl.class, scope);
+        Map<String, AtomicComponent> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class, scope, members, "target", Target.class, TargetImpl.class, scope);
         scope.onEvent(new ModuleStart(this, null));
-        AtomicContext<Source> sourceContext = (AtomicContext<Source>) contexts.get("source");
-        AtomicContext<Target> targetContext = (AtomicContext<Target>) contexts.get("target");
-        Source source = sourceContext.getService();
-        Target target = targetContext.getService();
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getService();
+        Target target = targetComponent.getService();
         assertNull(source.getTarget().getString());
         assertNull(target.getString());
         target.setString("foo");
@@ -87,16 +87,16 @@
         ScopeContext sessionScope = new HttpSessionScopeContext(ctx);
         sessionScope.start();
 
-        Map<String, AtomicContext> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
+        Map<String, AtomicComponent> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
                 moduleScope, members, "target", Target.class, TargetImpl.class, sessionScope);
         moduleScope.onEvent(new ModuleStart(this, null));
         Object session1 = new Object();
         ctx.setIdentifier(HttpSessionScopeContext.HTTP_IDENTIFIER, session1);
         sessionScope.onEvent(new HttpSessionStart(this, session1));
-        AtomicContext<Source> sourceContext = (AtomicContext<Source>) contexts.get("source");
-        AtomicContext<Target> targetContext = (AtomicContext<Target>) contexts.get("target");
-        Source source = sourceContext.getService();
-        Target target = targetContext.getService();
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getService();
+        Target target = targetComponent.getService();
         assertNull(source.getTarget().getString());
         assertNull(target.getString());
         target.setString("foo");
@@ -110,7 +110,7 @@
         ctx.setIdentifier(HttpSessionScopeContext.HTTP_IDENTIFIER, session2);
         sessionScope.onEvent(new HttpSessionStart(this, session2));
 
-        Target target2 = targetContext.getService();
+        Target target2 = targetComponent.getService();
         assertFalse("foo".equals(target2.getString()));
 
         assertFalse("foo".equals(source.getTarget().getString()));
@@ -136,15 +136,15 @@
         final ScopeContext requestScope = new RequestScopeContext(ctx);
         requestScope.start();
 
-        Map<String, AtomicContext> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
+        Map<String, AtomicComponent> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
                 moduleScope, members, "target", Target.class, TargetImpl.class, requestScope);
         moduleScope.onEvent(new ModuleStart(this, null));
         requestScope.onEvent(new RequestStart(this));
 
-        AtomicContext<Source> sourceContext = (AtomicContext<Source>) contexts.get("source");
-        final AtomicContext<Target> targetContext = (AtomicContext<Target>) contexts.get("target");
-        final Source source = sourceContext.getService();
-        Target target = targetContext.getService();
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        final AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        final Source source = sourceComponent.getService();
+        Target target = targetComponent.getService();
         assertNull(source.getTarget().getString());
         assertNull(target.getString());
         target.setString("foo");
@@ -156,7 +156,7 @@
         FutureTask<Void> future = new FutureTask<Void>(new Runnable() {
             public void run() {
                 requestScope.onEvent(new RequestStart(this));
-                Target target2 = targetContext.getService();
+                Target target2 = targetComponent.getService();
                 assertFalse("foo".equals(target2.getString()));
                 assertFalse("foo".equals(source.getTarget().getString()));
                 source.getTarget().setString("bar");
@@ -185,20 +185,20 @@
         ScopeContext statelessScope = new StatelessScopeContext(ctx);
         statelessScope.start();
 
-        Map<String, AtomicContext> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
+        Map<String, AtomicComponent> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
                 moduleScope, members, "target", Target.class, TargetImpl.class, statelessScope);
         moduleScope.onEvent(new ModuleStart(this, null));
 
-        AtomicContext<Source> sourceContext = (AtomicContext<Source>) contexts.get("source");
-        AtomicContext<Target> targetContext = (AtomicContext<Target>) contexts.get("target");
-        Source source = sourceContext.getService();
-        Target target = targetContext.getService();
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getService();
+        Target target = targetComponent.getService();
         assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
         assertNull(source.getTarget().getString());
         assertNull(target.getString());
         target.setString("foo");
         assertFalse("foo".equals(source.getTarget().getString()));
-        Target target2 = targetContext.getService();
+        Target target2 = targetComponent.getService();
         assertFalse("foo".equals(target2.getString()));
         source.getTarget().setString("bar");
         assertFalse("bar".equals(source.getTarget().getString()));
@@ -217,16 +217,16 @@
         ScopeContext sessionScope = new HttpSessionScopeContext(ctx);
         sessionScope.start();
 
-        Map<String, AtomicContext> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
+        Map<String, AtomicComponent> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
                 sessionScope, members, "target", Target.class, TargetImpl.class, sessionScope);
 
         Object session1 = new Object();
         ctx.setIdentifier(HttpSessionScopeContext.HTTP_IDENTIFIER, session1);
         sessionScope.onEvent(new HttpSessionStart(this, session1));
-        AtomicContext<Source> sourceContext = (AtomicContext<Source>) contexts.get("source");
-        AtomicContext<Target> targetContext = (AtomicContext<Target>) contexts.get("target");
-        Source source = sourceContext.getService();
-        Target target = targetContext.getService();
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getService();
+        Target target = targetComponent.getService();
         source.getTarget().setString("foo");
         source.getTarget().setString("foo");
         assertEquals("foo", target.getString());
@@ -239,9 +239,9 @@
         ctx.setIdentifier(HttpSessionScopeContext.HTTP_IDENTIFIER, session2);
         sessionScope.onEvent(new HttpSessionStart(this, session2));
 
-        Source source2 = sourceContext.getService();
+        Source source2 = sourceComponent.getService();
         assertNotNull(source2);
-        Target target2 = targetContext.getService();
+        Target target2 = targetComponent.getService();
 
         assertNotNull(target2);
         assertNull(target2.getString());
@@ -266,16 +266,16 @@
         ScopeContext sessionScope = new HttpSessionScopeContext(ctx);
         sessionScope.start();
 
-        Map<String, AtomicContext> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
+        Map<String, AtomicComponent> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
                 sessionScope, members, "target", Target.class, TargetImpl.class, moduleScope);
         moduleScope.onEvent(new ModuleStart(this, null));
         Object session1 = new Object();
         ctx.setIdentifier(HttpSessionScopeContext.HTTP_IDENTIFIER, session1);
         sessionScope.onEvent(new HttpSessionStart(this, session1));
-        AtomicContext<Source> sourceContext = (AtomicContext<Source>) contexts.get("source");
-        AtomicContext<Target> targetContext = (AtomicContext<Target>) contexts.get("target");
-        Source source = sourceContext.getService();
-        Target target = targetContext.getService();
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getService();
+        Target target = targetComponent.getService();
         assertNull(source.getTarget().getString());
         assertNull(target.getString());
         target.setString("foo");
@@ -289,8 +289,8 @@
         ctx.setIdentifier(HttpSessionScopeContext.HTTP_IDENTIFIER, session2);
         sessionScope.onEvent(new HttpSessionStart(this, session2));
 
-        Target target2 = targetContext.getService();
-        Source source2 = sourceContext.getService();
+        Target target2 = targetComponent.getService();
+        Source source2 = sourceComponent.getService();
         assertEquals("foo", target2.getString());
         assertEquals("foo", source2.getTarget().getString());
         source2.getTarget().setString("baz");
@@ -314,16 +314,16 @@
         ScopeContext sessionScope = new HttpSessionScopeContext(ctx);
         sessionScope.start();
 
-        Map<String, AtomicContext> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
+        Map<String, AtomicComponent> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
                 sessionScope, members, "target", Target.class, TargetImpl.class, requestScope);
         Object session1 = new Object();
         ctx.setIdentifier(HttpSessionScopeContext.HTTP_IDENTIFIER, session1);
         sessionScope.onEvent(new HttpSessionStart(this, session1));
         requestScope.onEvent(new RequestStart(this));
-        AtomicContext<Source> sourceContext = (AtomicContext<Source>) contexts.get("source");
-        final AtomicContext<Target> targetContext = (AtomicContext<Target>) contexts.get("target");
-        final Source source = sourceContext.getService();
-        Target target = targetContext.getService();
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        final AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        final Source source = sourceComponent.getService();
+        Target target = targetComponent.getService();
         assertNull(source.getTarget().getString());
         assertNull(target.getString());
         target.setString("foo");
@@ -335,7 +335,7 @@
         FutureTask<Void> future = new FutureTask<Void>(new Runnable() {
             public void run() {
                 requestScope.onEvent(new RequestStart(this));
-                Target target2 = targetContext.getService();
+                Target target2 = targetComponent.getService();
                 assertFalse("foo".equals(target2.getString()));
                 assertFalse("foo".equals(source.getTarget().getString()));
                 source.getTarget().setString("bar");
@@ -366,23 +366,23 @@
         ScopeContext statelessScope = new StatelessScopeContext(ctx);
         statelessScope.start();
 
-        Map<String, AtomicContext> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
+        Map<String, AtomicComponent> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
                 sessionScope, members, "target", Target.class, TargetImpl.class, statelessScope);
 
         Object session1 = new Object();
         ctx.setIdentifier(HttpSessionScopeContext.HTTP_IDENTIFIER, session1);
         sessionScope.onEvent(new HttpSessionStart(this, session1));
 
-        AtomicContext<Source> sourceContext = (AtomicContext<Source>) contexts.get("source");
-        AtomicContext<Target> targetContext = (AtomicContext<Target>) contexts.get("target");
-        Source source = sourceContext.getService();
-        Target target = targetContext.getService();
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getService();
+        Target target = targetComponent.getService();
         assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
         assertNull(source.getTarget().getString());
         assertNull(target.getString());
         target.setString("foo");
         assertFalse("foo".equals(source.getTarget().getString()));
-        Target target2 = targetContext.getService();
+        Target target2 = targetComponent.getService();
         assertFalse("foo".equals(target2.getString()));
         source.getTarget().setString("bar");
         assertFalse("bar".equals(source.getTarget().getString()));
@@ -402,14 +402,14 @@
         final ScopeContext requestScope = new RequestScopeContext(ctx);
         requestScope.start();
 
-        Map<String, AtomicContext> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
+        Map<String, AtomicComponent> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
                 requestScope, members, "target", Target.class, TargetImpl.class, requestScope);
         requestScope.onEvent(new RequestStart(this));
 
-        final AtomicContext<Source> sourceContext = (AtomicContext<Source>) contexts.get("source");
-        final AtomicContext<Target> targetContext = (AtomicContext<Target>) contexts.get("target");
-        Source source = sourceContext.getService();
-        Target target = targetContext.getService();
+        final AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        final AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getService();
+        Target target = targetComponent.getService();
         assertNull(source.getTarget().getString());
         assertNull(target.getString());
         target.setString("foo");
@@ -421,8 +421,8 @@
         FutureTask<Void> future = new FutureTask<Void>(new Runnable() {
             public void run() {
                 requestScope.onEvent(new RequestStart(this));
-                Source source2 = sourceContext.getService();
-                Target target2 = targetContext.getService();
+                Source source2 = sourceComponent.getService();
+                Target target2 = targetComponent.getService();
                 assertFalse("foo".equals(target2.getString()));
                 assertFalse("foo".equals(source2.getTarget().getString()));
                 source2.getTarget().setString("bar");
@@ -449,14 +449,14 @@
         moduleScope.start();
         moduleScope.onEvent(new ModuleStart(this, null));
 
-        Map<String, AtomicContext> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
+        Map<String, AtomicComponent> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
                 requestScope, members, "target", Target.class, TargetImpl.class, moduleScope);
         requestScope.onEvent(new RequestStart(this));
 
-        final AtomicContext<Source> sourceContext = (AtomicContext<Source>) contexts.get("source");
-        final AtomicContext<Target> targetContext = (AtomicContext<Target>) contexts.get("target");
-        Source source = sourceContext.getService();
-        Target target = targetContext.getService();
+        final AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        final AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getService();
+        Target target = targetComponent.getService();
         assertNull(source.getTarget().getString());
         assertNull(target.getString());
         target.setString("foo");
@@ -468,8 +468,8 @@
         FutureTask<Void> future = new FutureTask<Void>(new Runnable() {
             public void run() {
                 requestScope.onEvent(new RequestStart(this));
-                Source source2 = sourceContext.getService();
-                Target target2 = targetContext.getService();
+                Source source2 = sourceComponent.getService();
+                Target target2 = targetComponent.getService();
                 assertEquals("foo",target2.getString());
                 assertEquals("foo",source2.getTarget().getString());
                 source2.getTarget().setString("bar");
@@ -502,14 +502,14 @@
         Object session1 = new Object();
         ctx.setIdentifier(HttpSessionScopeContext.HTTP_IDENTIFIER, session1);
         sessionScope.onEvent(new HttpSessionStart(this, session1));
-        Map<String, AtomicContext> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
+        Map<String, AtomicComponent> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
                 requestScope, members, "target", Target.class, TargetImpl.class, sessionScope);
 
-        final AtomicContext<Source> sourceContext = (AtomicContext<Source>) contexts.get("source");
-        final AtomicContext<Target> targetContext = (AtomicContext<Target>) contexts.get("target");
+        final AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        final AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
         requestScope.onEvent(new RequestStart(this));
-        Source source = sourceContext.getService();
-        Target target = targetContext.getService();
+        Source source = sourceComponent.getService();
+        Target target = targetComponent.getService();
         assertNull(source.getTarget().getString());
         assertNull(target.getString());
         target.setString("foo");
@@ -521,8 +521,8 @@
         FutureTask<Void> future = new FutureTask<Void>(new Runnable() {
             public void run() {
                 requestScope.onEvent(new RequestStart(this));
-                Source source2 = sourceContext.getService();
-                Target target2 = targetContext.getService();
+                Source source2 = sourceComponent.getService();
+                Target target2 = targetComponent.getService();
                 assertEquals("foo",target2.getString());
                 assertEquals("foo",source2.getTarget().getString());
                 source2.getTarget().setString("bar");
@@ -554,20 +554,20 @@
         ScopeContext statelessScope = new StatelessScopeContext(ctx);
         statelessScope.start();
 
-        Map<String, AtomicContext> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
+        Map<String, AtomicComponent> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
                 requestScope, members, "target", Target.class, TargetImpl.class, statelessScope);
 
-        AtomicContext<Source> sourceContext = (AtomicContext<Source>) contexts.get("source");
-        AtomicContext<Target> targetContext = (AtomicContext<Target>) contexts.get("target");
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
         requestScope.onEvent(new RequestStart(this));
-        Source source = sourceContext.getService();
-        Target target = targetContext.getService();
+        Source source = sourceComponent.getService();
+        Target target = targetComponent.getService();
         assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
         assertNull(source.getTarget().getString());
         assertNull(target.getString());
         target.setString("foo");
         assertFalse("foo".equals(source.getTarget().getString()));
-        Target target2 = targetContext.getService();
+        Target target2 = targetComponent.getService();
         assertFalse("foo".equals(target2.getString()));
         source.getTarget().setString("bar");
         assertFalse("bar".equals(source.getTarget().getString()));
@@ -586,19 +586,19 @@
         ScopeContext statelessScope = new StatelessScopeContext(ctx);
         statelessScope.start();
 
-        Map<String, AtomicContext> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
+        Map<String, AtomicComponent> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
                 statelessScope, members, "target", Target.class, TargetImpl.class, statelessScope);
 
-        AtomicContext<Source> sourceContext = (AtomicContext<Source>) contexts.get("source");
-        AtomicContext<Target> targetContext = (AtomicContext<Target>) contexts.get("target");
-        Source source = sourceContext.getService();
-        Target target = targetContext.getService();
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getService();
+        Target target = targetComponent.getService();
         assertTrue(Proxy.isProxyClass(source.getTarget().getClass()));
         assertNull(source.getTarget().getString());
         assertNull(target.getString());
         target.setString("foo");
         assertFalse("foo".equals(source.getTarget().getString()));
-        Target target2 = targetContext.getService();
+        Target target2 = targetComponent.getService();
         assertFalse("foo".equals(target2.getString()));
         source.getTarget().setString("bar");
         assertFalse("bar".equals(source.getTarget().getString()));
@@ -616,13 +616,13 @@
         ScopeContext statelessScope = new StatelessScopeContext(ctx);
         statelessScope.start();
 
-        Map<String, AtomicContext> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
+        Map<String, AtomicComponent> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
                 statelessScope, members, "target", Target.class, TargetImpl.class, requestScope);
         requestScope.onEvent(new RequestStart(this));
-        AtomicContext<Source> sourceContext = (AtomicContext<Source>) contexts.get("source");
-        final AtomicContext<Target> targetContext = (AtomicContext<Target>) contexts.get("target");
-        final Source source = sourceContext.getService();
-        Target target = targetContext.getService();
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        final AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        final Source source = sourceComponent.getService();
+        Target target = targetComponent.getService();
         assertNull(source.getTarget().getString());
         assertNull(target.getString());
         target.setString("foo");
@@ -634,7 +634,7 @@
         FutureTask<Void> future = new FutureTask<Void>(new Runnable() {
             public void run() {
                 requestScope.onEvent(new RequestStart(this));
-                Target target2 = targetContext.getService();
+                Target target2 = targetComponent.getService();
                 assertFalse("foo".equals(target2.getString()));
                 assertFalse("foo".equals(source.getTarget().getString()));
                 source.getTarget().setString("bar");
@@ -660,15 +660,15 @@
         ScopeContext sessionScope = new HttpSessionScopeContext(ctx);
         sessionScope.start();
 
-        Map<String, AtomicContext> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
+        Map<String, AtomicComponent> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
                 statelessScope, members, "target", Target.class, TargetImpl.class, sessionScope);
         Object session1 = new Object();
         ctx.setIdentifier(HttpSessionScopeContext.HTTP_IDENTIFIER, session1);
         sessionScope.onEvent(new HttpSessionStart(this, session1));
-        AtomicContext<Source> sourceContext = (AtomicContext<Source>) contexts.get("source");
-        AtomicContext<Target> targetContext = (AtomicContext<Target>) contexts.get("target");
-        Source source = sourceContext.getService();
-        Target target = targetContext.getService();
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getService();
+        Target target = targetComponent.getService();
         assertNull(source.getTarget().getString());
         assertNull(target.getString());
         target.setString("foo");
@@ -682,7 +682,7 @@
         ctx.setIdentifier(HttpSessionScopeContext.HTTP_IDENTIFIER, session2);
         sessionScope.onEvent(new HttpSessionStart(this, session2));
 
-        Target target2 = targetContext.getService();
+        Target target2 = targetComponent.getService();
         assertFalse("foo".equals(target2.getString()));
 
         assertFalse("foo".equals(source.getTarget().getString()));
@@ -708,13 +708,13 @@
         ScopeContext moduleScope = new ModuleScopeContext(ctx);
         moduleScope.start();
 
-        Map<String, AtomicContext> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
+        Map<String, AtomicComponent> contexts = MockContextFactory.createWiredContexts("source", SourceImpl.class,
                 statelessScope, members, "target", Target.class, TargetImpl.class, moduleScope);
         moduleScope.onEvent(new ModuleStart(this, null));
-        AtomicContext<Source> sourceContext = (AtomicContext<Source>) contexts.get("source");
-        AtomicContext<Target> targetContext = (AtomicContext<Target>) contexts.get("target");
-        Source source = sourceContext.getService();
-        Target target = targetContext.getService();
+        AtomicComponent<Source> sourceComponent = (AtomicComponent<Source>) contexts.get("source");
+        AtomicComponent<Target> targetComponent = (AtomicComponent<Target>) contexts.get("target");
+        Source source = sourceComponent.getService();
+        Target target = targetComponent.getService();
         assertNull(source.getTarget().getString());
         assertNull(target.getString());
         target.setString("foo");
@@ -726,7 +726,7 @@
         ctx.setIdentifier(HttpSessionScopeContext.HTTP_IDENTIFIER, session2);
         moduleScope.onEvent(new HttpSessionStart(this, session2));
 
-        Target target2 = targetContext.getService();
+        Target target2 = targetComponent.getService();
         assertEquals("foo",target2.getString());
 
         assertEquals("foo",source.getTarget().getString());

Modified: incubator/tuscany/sandbox/jboynes/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockContextFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockContextFactory.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockContextFactory.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/containers/container.java/src/test/java/org/apache/tuscany/container/java/mock/MockContextFactory.java Fri Jun  2 19:25:01 2006
@@ -8,7 +8,7 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.tuscany.container.java.JavaAtomicContext;
+import org.apache.tuscany.container.java.JavaAtomicComponent;
 import org.apache.tuscany.container.java.JavaTargetInvoker;
 import org.apache.tuscany.core.injection.EventInvoker;
 import org.apache.tuscany.core.injection.Injector;
@@ -22,8 +22,8 @@
 import org.apache.tuscany.core.wire.OutboundWireImpl;
 import org.apache.tuscany.spi.ObjectFactory;
 import org.apache.tuscany.spi.builder.BuilderConfigException;
-import org.apache.tuscany.spi.context.AtomicContext;
-import org.apache.tuscany.spi.context.CompositeContext;
+import org.apache.tuscany.spi.context.AtomicComponent;
+import org.apache.tuscany.spi.context.CompositeComponent;
 import org.apache.tuscany.spi.context.ScopeContext;
 import org.apache.tuscany.spi.model.Scope;
 import org.apache.tuscany.spi.wire.InboundInvocationChain;
@@ -43,18 +43,18 @@
 
     private static final WireService wireService = ArtifactFactory.createWireService();
 
-    public static JavaAtomicContext<?> createJavaAtomicContext(String name, ScopeContext scopeContext, Class<?> clazz, Scope scope) throws NoSuchMethodException {
+    public static JavaAtomicComponent<?> createJavaAtomicContext(String name, ScopeContext scopeContext, Class<?> clazz, Scope scope) throws NoSuchMethodException {
         return createJavaAtomicContext(name, null, scopeContext, clazz, clazz, scope, false, null, null, null, null);
 
     }
 
-    public static JavaAtomicContext<?> createJavaAtomicContext(String name, ScopeContext scopeContext, Class<?> clazz, Class<?> service, Scope scope) throws NoSuchMethodException {
+    public static JavaAtomicComponent<?> createJavaAtomicContext(String name, ScopeContext scopeContext, Class<?> clazz, Class<?> service, Scope scope) throws NoSuchMethodException {
         return createJavaAtomicContext(name, null, scopeContext, clazz, service, scope, false, null, null, null, null);
 
     }
 
-    public static JavaAtomicContext<?> createJavaAtomicContext(String name,
-                                                               CompositeContext<?> parent,
+    public static JavaAtomicComponent<?> createJavaAtomicContext(String name,
+                                                               CompositeComponent<?> parent,
                                                                ScopeContext scopeContext,
                                                                Class<?> clazz,
                                                                Class<?> service,
@@ -67,7 +67,7 @@
             throws NoSuchMethodException {
         List<Class<?>> serviceInterfaces = new ArrayList<Class<?>>();
         serviceInterfaces.add(service);
-        return new JavaAtomicContext(name, parent, scopeContext, serviceInterfaces, createObjectFactory(clazz),
+        return new JavaAtomicComponent(name, parent, scopeContext, serviceInterfaces, createObjectFactory(clazz),
                 scope, eagerInit, initInvoker, destroyInvoker, injectors, members,wireService);
     }
 
@@ -85,7 +85,7 @@
      * @return
      * @throws Exception
      */
-    public static Map<String, AtomicContext> createWiredContexts(String sourceName, Class<?> sourceClass,
+    public static Map<String, AtomicComponent> createWiredContexts(String sourceName, Class<?> sourceClass,
                                                                  ScopeContext sourceScope,
                                                                  Map<String, Member> members, String targetName, Class<?> targetService, Class<?> targetClass,
                                                                  ScopeContext targetScope) throws Exception {
@@ -96,7 +96,7 @@
     /**
      * Wires two contexts together where the reference interface may be different from the target service
      */
-    public static Map<String, AtomicContext> createWiredContexts(String sourceName, Class<?> sourceClass, Class<?> sourceReferenceClass,
+    public static Map<String, AtomicComponent> createWiredContexts(String sourceName, Class<?> sourceClass, Class<?> sourceReferenceClass,
                                                                  ScopeContext sourceScope,
                                                                  Map<String, Member> members, String targetName,
                                                                  Class<?> targetService, Class<?> targetClass,
@@ -105,7 +105,7 @@
                 targetClass, targetScope, null, null, null);
     }
 
-    public static Map<String, AtomicContext> createWiredContexts(String sourceName, Class<?> sourceClass, Class<?> sourceReferenceClass,
+    public static Map<String, AtomicComponent> createWiredContexts(String sourceName, Class<?> sourceClass, Class<?> sourceReferenceClass,
                                                                  ScopeContext sourceScope,
                                                                  Interceptor sourceHeadInterceptor,
                                                                  MessageHandler sourceHeadRequestHandler,
@@ -116,19 +116,19 @@
                                                                  Interceptor targetHeadInterceptor,
                                                                  MessageHandler targetRequestHeadHandler,
                                                                  MessageHandler targetResponseHeadHandler) throws Exception {
-        JavaAtomicContext targetContext = createJavaAtomicContext(targetName, targetScope, targetClass, targetScope.getScope());
+        JavaAtomicComponent targetContext = createJavaAtomicContext(targetName, targetScope, targetClass, targetScope.getScope());
         InboundWire inboundWire = createServiceWire(targetService.getName().substring(
                 targetService.getName().lastIndexOf('.') + 1), targetService, targetHeadInterceptor, targetRequestHeadHandler, targetResponseHeadHandler);
         targetContext.addInboundWire(inboundWire);
 
-        JavaAtomicContext sourceContext = createJavaAtomicContext(sourceName, null, sourceScope, sourceClass, sourceClass, sourceScope.getScope(), false, null, null, null, members);
+        JavaAtomicComponent sourceContext = createJavaAtomicContext(sourceName, null, sourceScope, sourceClass, sourceClass, sourceScope.getScope(), false, null, null, null, members);
         OutboundWire outboundWire = createReferenceWire(targetName, sourceReferenceClass, sourceHeadInterceptor,
                 sourceHeadRequestHandler, sourceHeadResponseHandler);
         sourceContext.addOutboundWire(outboundWire);
         targetScope.register(targetContext);
         sourceScope.register(sourceContext);
         connect(outboundWire, inboundWire, targetContext, false);
-        Map<String, AtomicContext> contexts = new HashMap<String, AtomicContext>();
+        Map<String, AtomicComponent> contexts = new HashMap<String, AtomicComponent>();
         contexts.put(sourceName, sourceContext);
         contexts.put(targetName, targetContext);
         return contexts;
@@ -150,16 +150,16 @@
      * @return
      * @throws Exception
      */
-    public static Map<String, AtomicContext> createWiredMultiplicity(String sourceName, Class<?> sourceClass, Class<?> sourceReferenceClass,
+    public static Map<String, AtomicComponent> createWiredMultiplicity(String sourceName, Class<?> sourceClass, Class<?> sourceReferenceClass,
                                                                      ScopeContext sourceScope,
                                                                      String targetName, Class<?> targetService, Class<?> targetClass,
                                                                      Map<String, Member> members, ScopeContext targetScope) throws Exception {
-        JavaAtomicContext targetContext = createJavaAtomicContext(targetName, targetScope, targetClass, targetScope.getScope());
+        JavaAtomicComponent targetContext = createJavaAtomicContext(targetName, targetScope, targetClass, targetScope.getScope());
         InboundWire inboundWire = createServiceWire(targetService.getName().substring(
                 targetService.getName().lastIndexOf('.') + 1), targetService, null, null, null);
         targetContext.addInboundWire(inboundWire);
 
-        JavaAtomicContext sourceContext = createJavaAtomicContext(sourceName, null, sourceScope, sourceClass, sourceClass, sourceScope.getScope(), false, null, null, null, members);
+        JavaAtomicComponent sourceContext = createJavaAtomicContext(sourceName, null, sourceScope, sourceClass, sourceClass, sourceScope.getScope(), false, null, null, null, members);
         OutboundWire outboundWire = createReferenceWire(targetName, sourceReferenceClass, null, null, null);
         List<OutboundWire> factories = new ArrayList<OutboundWire>();
         factories.add(outboundWire);
@@ -167,7 +167,7 @@
         targetScope.register(targetContext);
         sourceScope.register(sourceContext);
         connect(outboundWire, inboundWire, targetContext, false);
-        Map<String, AtomicContext> contexts = new HashMap<String, AtomicContext>();
+        Map<String, AtomicComponent> contexts = new HashMap<String, AtomicComponent>();
         contexts.put(sourceName, sourceContext);
         contexts.put(targetName, targetContext);
         return contexts;
@@ -217,7 +217,7 @@
      * @param cacheable
      * @throws Exception
      */
-    public static void connect(OutboundWire<?> outboundWire, InboundWire<?> inboundWire, JavaAtomicContext targetContext, boolean cacheable) throws Exception {
+    public static void connect(OutboundWire<?> outboundWire, InboundWire<?> inboundWire, JavaAtomicComponent targetContext, boolean cacheable) throws Exception {
         if (inboundWire != null) {
             // if null, the target side has no interceptors or handlers
             Map<Method, InboundInvocationChain> targetInvocationConfigs = inboundWire.getInvocationChains();

Modified: incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/LICENSE.txt
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/LICENSE.txt?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/LICENSE.txt (original)
+++ incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/LICENSE.txt Fri Jun  2 19:25:01 2006
@@ -137,7 +137,7 @@
       with Licensor regarding such Contributions.
 
    6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
+      names, trademarks, serviceDefinition marks, or product names of the Licensor,
       except as required for reasonable and customary use in describing the
       origin of the Work and reproducing the content of the NOTICE file.
 

Modified: incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/main/java/org/apache/tuscany/container/spring/SpringCompositeBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/main/java/org/apache/tuscany/container/spring/SpringCompositeBuilder.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/main/java/org/apache/tuscany/container/spring/SpringCompositeBuilder.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/main/java/org/apache/tuscany/container/spring/SpringCompositeBuilder.java Fri Jun  2 19:25:01 2006
@@ -2,57 +2,57 @@
 
 import org.apache.tuscany.spi.QualifiedName;
 import org.apache.tuscany.spi.builder.BuilderConfigException;
-import org.apache.tuscany.spi.context.ComponentContext;
-import org.apache.tuscany.spi.context.CompositeContext;
-import org.apache.tuscany.spi.context.ServiceContext;
+import org.apache.tuscany.spi.context.Component;
+import org.apache.tuscany.spi.context.CompositeComponent;
+import org.apache.tuscany.spi.context.Service;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
 import org.apache.tuscany.spi.extension.ComponentBuilderExtension;
 import org.apache.tuscany.spi.model.Binding;
-import org.apache.tuscany.spi.model.BoundReference;
-import org.apache.tuscany.spi.model.BoundService;
-import org.apache.tuscany.spi.model.Component;
+import org.apache.tuscany.spi.model.BoundReferenceDefinition;
+import org.apache.tuscany.spi.model.BoundServiceDefinition;
+import org.apache.tuscany.spi.model.ComponentDefinition;
 import org.apache.tuscany.spi.model.CompositeComponentType;
 import org.apache.tuscany.spi.model.Property;
-import org.apache.tuscany.spi.model.Reference;
+import org.apache.tuscany.spi.model.ReferenceDefinition;
 import org.apache.tuscany.spi.model.ReferenceTarget;
 import org.apache.tuscany.spi.wire.InboundInvocationChain;
 import org.apache.tuscany.spi.wire.InboundWire;
 import org.springframework.context.support.GenericApplicationContext;
 
 /**
- * Creates a {@link SpringCompositeContext} from an assembly model
+ * Creates a {@link SpringCompositeComponent} from an assembly model
  *
  * @version $$Rev$$ $$Date$$
  */
 public class SpringCompositeBuilder extends ComponentBuilderExtension<SpringImplementation> {
 
 
-    public ComponentContext build(CompositeContext parent, Component<SpringImplementation> component,
+    public Component build(CompositeComponent<?> parent, ComponentDefinition<SpringImplementation> componentDefinition,
                                   DeploymentContext deploymentContext) throws BuilderConfigException {
-        String name = component.getName();
-        GenericApplicationContext applicationContext = component.getImplementation().getApplicationContext();
-        SpringCompositeContext context = new SpringCompositeContext(name, applicationContext, parent,wireService);
-        CompositeComponentType<BoundService, BoundReference, ? extends Property> componentType = component.getImplementation().getComponentType();
-        for (BoundService service : componentType.getServices().values()) {
+        String name = componentDefinition.getName();
+        GenericApplicationContext applicationContext = componentDefinition.getImplementation().getApplicationContext();
+        SpringCompositeComponent context = new SpringCompositeComponent(name, applicationContext, parent,wireService);
+        CompositeComponentType<BoundServiceDefinition, BoundReferenceDefinition, ? extends Property> componentType = componentDefinition.getImplementation().getComponentType();
+        for (BoundServiceDefinition serviceDefinition : componentType.getServices().values()) {
             // call back into deployment context to handle building of services
-            ServiceContext<?> serviceContext = (ServiceContext) builderRegistry.build(parent,
-                    service,
+            Service<?> service = (Service) builderRegistry.build(parent,
+                    serviceDefinition,
                     deploymentContext);
-            // wire service to bean invokers
-            InboundWire<?> wire = serviceContext.getInboundWire();
-            QualifiedName targetName = new QualifiedName(service.getTarget().getPath());
+            // wire serviceDefinition to bean invokers
+            InboundWire<?> wire = service.getInboundWire();
+            QualifiedName targetName = new QualifiedName(serviceDefinition.getTarget().getPath());
             for (InboundInvocationChain chain : wire.getInvocationChains().values()) {
                 chain.setTargetInvoker(context.createTargetInvoker(targetName.getPartName(), chain.getMethod()));
             }
-            context.registerContext(serviceContext);
+            context.register(service);
         }
         // TODO is this correct?
-        for (ReferenceTarget target : component.getReferenceTargets().values()) {
-            Reference reference = target.getReference();
-            if (reference instanceof BoundReference) {
+        for (ReferenceTarget target : componentDefinition.getReferenceTargets().values()) {
+            ReferenceDefinition referenceDefinition = target.getReference();
+            if (referenceDefinition instanceof BoundReferenceDefinition) {
                 // call back into deployment context to handle building of references
-                context.registerContext(builderRegistry.build(parent, (BoundReference<? extends Binding>)
-                        reference, deploymentContext));
+                context.register(builderRegistry.build(parent, (BoundReferenceDefinition<? extends Binding>)
+                        referenceDefinition, deploymentContext));
             }
         }
         return context;

Copied: incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/main/java/org/apache/tuscany/container/spring/SpringCompositeComponent.java (from r411328, incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/main/java/org/apache/tuscany/container/spring/SpringCompositeContext.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/main/java/org/apache/tuscany/container/spring/SpringCompositeComponent.java?p2=incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/main/java/org/apache/tuscany/container/spring/SpringCompositeComponent.java&p1=incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/main/java/org/apache/tuscany/container/spring/SpringCompositeContext.java&r1=411328&r2=411356&rev=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/main/java/org/apache/tuscany/container/spring/SpringCompositeContext.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/main/java/org/apache/tuscany/container/spring/SpringCompositeComponent.java Fri Jun  2 19:25:01 2006
@@ -5,12 +5,12 @@
 import java.util.Locale;
 import java.util.Map;
 
-import org.apache.tuscany.spi.context.CompositeContext;
-import org.apache.tuscany.spi.context.Context;
-import org.apache.tuscany.spi.context.ReferenceContext;
+import org.apache.tuscany.spi.context.CompositeComponent;
+import org.apache.tuscany.spi.context.SCAObject;
+import org.apache.tuscany.spi.context.Reference;
 import org.apache.tuscany.spi.context.ScopeContext;
-import org.apache.tuscany.spi.context.ServiceContext;
-import org.apache.tuscany.spi.extension.CompositeContextExtension;
+import org.apache.tuscany.spi.context.Service;
+import org.apache.tuscany.spi.extension.CompositeComponentExtension;
 import org.apache.tuscany.spi.wire.TargetInvoker;
 import org.apache.tuscany.spi.wire.WireService;
 import org.springframework.beans.BeansException;
@@ -31,7 +31,7 @@
  *
  * @version $$Rev$$ $$Date$$
  */
-public class SpringCompositeContext extends CompositeContextExtension {
+public class SpringCompositeComponent extends CompositeComponentExtension {
     private static final String[] EMPTY_ARRAY = new String[0];
     private GenericApplicationContext springContext;
     private SCAApplicationContext scaApplicationContext;
@@ -43,7 +43,7 @@
      * @param springContext the pre-instantiated Spring applicaiton context
      * @param parent        the SCA composite parent
      */
-    public SpringCompositeContext(String name, GenericApplicationContext springContext, CompositeContext parent, WireService wireService) {
+    public SpringCompositeComponent(String name, GenericApplicationContext springContext, CompositeComponent parent, WireService wireService) {
         super(name, parent, wireService);
         scaApplicationContext = new SCAApplicationContext();
         springContext.setParent(scaApplicationContext);
@@ -76,12 +76,12 @@
     /**
      * An inner class is required to act as the Spring application context parent as opposed to implementing
      * the interface since the return types for {@link org.springframework.context.ApplicationContext#getParent()}
-     * and {@link org.apache.tuscany.spi.context.CompositeContext#getParent()} clash
+     * and {@link org.apache.tuscany.spi.context.CompositeComponent#getParent()} clash
      */
     private class SCAApplicationContext implements ApplicationContext {
 
         public Object getBean(String name) throws BeansException {
-            Context context = (Context) children.get(name); // keep cast for compiler error
+            SCAObject context = (SCAObject) children.get(name); // keep cast for compiler error
             if (context == null) {
                 throw new NoSuchBeanDefinitionException("SCA service not found [" + name + "]");
             }
@@ -89,15 +89,15 @@
         }
 
         public Object getBean(String name, Class requiredType) throws BeansException {
-            Context context = (Context) children.get(name);   // keep cast for compiler error
+            SCAObject context = (SCAObject) children.get(name);   // keep cast for compiler error
             if (context == null) {
                 throw new NoSuchBeanDefinitionException("SCA service not found [" + name + "]");
             }
             Class<?> type;
-            if (context instanceof ReferenceContext) {
-                type = ((ReferenceContext) context).getInterface();
-            } else if (context instanceof ServiceContext) {
-                type = ((ServiceContext) context).getInterface();
+            if (context instanceof Reference) {
+                type = ((Reference) context).getInterface();
+            } else if (context instanceof Service) {
+                type = ((Service) context).getInterface();
             } else {
                 throw new AssertionError("Illegal context type [" + name + "]");
             }

Modified: incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/test/java/org/apache/tuscany/container/spring/ReferenceInvocationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/test/java/org/apache/tuscany/container/spring/ReferenceInvocationTestCase.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/test/java/org/apache/tuscany/container/spring/ReferenceInvocationTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/test/java/org/apache/tuscany/container/spring/ReferenceInvocationTestCase.java Fri Jun  2 19:25:01 2006
@@ -2,7 +2,7 @@
 
 import org.apache.tuscany.container.spring.mock.TestBean;
 import org.apache.tuscany.container.spring.mock.TestBeanImpl;
-import org.apache.tuscany.spi.context.ReferenceContext;
+import org.apache.tuscany.spi.context.Reference;
 import org.apache.tuscany.test.ArtifactFactory;
 import org.jmock.Mock;
 import org.jmock.MockObjectTestCase;
@@ -22,15 +22,15 @@
 
     public void testInvocation() throws Exception {
         GenericApplicationContext ctx = createSpringContext();
-        SpringCompositeContext parent = new SpringCompositeContext("spring", ctx, null, ArtifactFactory.createWireService());
+        SpringCompositeComponent parent = new SpringCompositeComponent("spring", ctx, null, ArtifactFactory.createWireService());
         parent.start();
         TestBean referenceTarget = new TestBeanImpl();
-        Mock mock = mock(ReferenceContext.class);
+        Mock mock = mock(Reference.class);
         mock.stubs().method("getName").will(returnValue("bar"));
         mock.stubs().method("getInterface").will(returnValue(TestBean.class));
         mock.expects(atLeastOnce()).method("getService").will(returnValue(referenceTarget));
-        ReferenceContext referenceContext = (ReferenceContext) mock.proxy();
-        parent.registerContext(referenceContext);
+        Reference reference = (Reference) mock.proxy();
+        parent.register(reference);
         ctx.getBean("foo");
     }
 

Modified: incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/test/java/org/apache/tuscany/container/spring/ServiceInvocationTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/test/java/org/apache/tuscany/container/spring/ServiceInvocationTestCase.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/test/java/org/apache/tuscany/container/spring/ServiceInvocationTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/test/java/org/apache/tuscany/container/spring/ServiceInvocationTestCase.java Fri Jun  2 19:25:01 2006
@@ -4,8 +4,8 @@
 import org.apache.tuscany.container.spring.mock.TestBean;
 import org.apache.tuscany.container.spring.mock.TestBeanImpl;
 import org.apache.tuscany.core.builder.Connector;
-import org.apache.tuscany.spi.context.ServiceContext;
-import org.apache.tuscany.spi.extension.ServiceContextExtension;
+import org.apache.tuscany.spi.context.Service;
+import org.apache.tuscany.spi.extension.ServiceExtension;
 import org.apache.tuscany.spi.wire.InboundInvocationChain;
 import org.apache.tuscany.spi.wire.InboundWire;
 import org.apache.tuscany.spi.wire.OutboundWire;
@@ -23,22 +23,22 @@
 public class ServiceInvocationTestCase extends TestCase {
 
     public void testInvocation() {
-        SpringCompositeContext context = new SpringCompositeContext("parent", createSpringContext(), null,ArtifactFactory.createWireService());
+        SpringCompositeComponent context = new SpringCompositeComponent("parent", createSpringContext(), null,ArtifactFactory.createWireService());
         context.start();
         InboundWire<TestBean> inboundWire = ArtifactFactory.createInboundWire("fooService", TestBean.class);
         OutboundWire<TestBean> outboundWire = ArtifactFactory.createOutboundWire("fooService", TestBean.class);
         ArtifactFactory.terminateWire(outboundWire);
-        ServiceContext<TestBean> serviceContext = new ServiceContextExtension<TestBean>("fooService", context, ArtifactFactory.createWireService());
-        serviceContext.setInboundWire(inboundWire);
-        serviceContext.setOutboundWire(outboundWire);
+        Service<TestBean> service = new ServiceExtension<TestBean>("fooService", context, ArtifactFactory.createWireService());
+        service.setInboundWire(inboundWire);
+        service.setOutboundWire(outboundWire);
         Connector conntector = ArtifactFactory.createConnector();
         conntector.connect(inboundWire, outboundWire, true);
         // TODO fix below
         for (InboundInvocationChain chain : inboundWire.getInvocationChains().values()) {
             chain.setTargetInvoker(context.createTargetInvoker("foo", chain.getMethod()));
         }
-        context.registerContext(serviceContext);
-        assertEquals("bar", ((TestBean) context.getContext("fooService").getService()).echo("bar"));
+        context.register(service);
+        assertEquals("bar", ((TestBean) context.getChild("fooService").getService()).echo("bar"));
     }
 
 

Modified: incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/test/java/org/apache/tuscany/container/spring/SpringCompositeBuilderTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/test/java/org/apache/tuscany/container/spring/SpringCompositeBuilderTestCase.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/test/java/org/apache/tuscany/container/spring/SpringCompositeBuilderTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/containers/container.spring/src/test/java/org/apache/tuscany/container/spring/SpringCompositeBuilderTestCase.java Fri Jun  2 19:25:01 2006
@@ -9,11 +9,11 @@
 import org.apache.tuscany.core.builder.Connector;
 import org.apache.tuscany.spi.QualifiedName;
 import org.apache.tuscany.spi.builder.BuilderRegistry;
-import org.apache.tuscany.spi.context.CompositeContext;
-import org.apache.tuscany.spi.context.ServiceContext;
-import org.apache.tuscany.spi.extension.ServiceContextExtension;
-import org.apache.tuscany.spi.model.BoundService;
-import org.apache.tuscany.spi.model.Component;
+import org.apache.tuscany.spi.context.CompositeComponent;
+import org.apache.tuscany.spi.context.Service;
+import org.apache.tuscany.spi.extension.ServiceExtension;
+import org.apache.tuscany.spi.model.BoundServiceDefinition;
+import org.apache.tuscany.spi.model.ComponentDefinition;
 import org.apache.tuscany.spi.model.CompositeComponentType;
 import org.apache.tuscany.spi.wire.InboundWire;
 import org.apache.tuscany.spi.wire.OutboundWire;
@@ -38,9 +38,9 @@
         SpringImplementation impl = new SpringImplementation();
         impl.setComponentType(createComponentType());
         impl.setApplicationContext(createSpringContext());
-        Component<SpringImplementation> component = new Component<SpringImplementation>("spring", impl);
+        ComponentDefinition<SpringImplementation> componentDefinition = new ComponentDefinition<SpringImplementation>("spring", impl);
         Mock mock = mock(BuilderRegistry.class);
-        ServiceContextExtension<TestBean> serviceContext = new ServiceContextExtension<TestBean>("fooService", null, wireService);
+        ServiceExtension<TestBean> serviceContext = new ServiceExtension<TestBean>("fooService", null, wireService);
         InboundWire<TestBean> inboundWire = ArtifactFactory.createInboundWire("fooSerice", TestBean.class);
         OutboundWire<TestBean> outboundwire = ArtifactFactory.createOutboundWire("fooService", TestBean.class);
         outboundwire.setTargetName(new QualifiedName("foo"));
@@ -51,8 +51,8 @@
         ArtifactFactory.terminateWire(inboundWire);
         mock.expects(atLeastOnce()).method("build").will(returnValue(serviceContext));
         builder.setBuilderRegistry((BuilderRegistry) mock.proxy());
-        CompositeContext context = (CompositeContext) builder.build(null, component, null);
-        ServiceContext service = (ServiceContext) context.getContext("fooService");
+        CompositeComponent component = (CompositeComponent) builder.build(null, componentDefinition, null);
+        Service service = (Service) component.getChild("fooService");
         TestBean bean = (TestBean) service.getService();
         assertEquals("foo", bean.echo("foo"));
     }
@@ -66,15 +66,15 @@
 
     private CompositeComponentType createComponentType() {
         CompositeComponentType componentType = new CompositeComponentType();
-        BoundService<VMBinding> service = new BoundService<VMBinding>();
-        service.setName("FooService");
-        service.setBinding(new VMBinding());
+        BoundServiceDefinition<VMBinding> serviceDefinition = new BoundServiceDefinition<VMBinding>();
+        serviceDefinition.setName("FooService");
+        serviceDefinition.setBinding(new VMBinding());
         try {
-            service.setTarget(new URI("foo"));
+            serviceDefinition.setTarget(new URI("foo"));
         } catch (URISyntaxException e) {
             throw new AssertionError();
         }
-        componentType.add(service);
+        componentType.add(serviceDefinition);
         return componentType;
     }
 

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/LICENSE.txt
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/LICENSE.txt?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/LICENSE.txt (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/LICENSE.txt Fri Jun  2 19:25:01 2006
@@ -137,7 +137,7 @@
       with Licensor regarding such Contributions.
 
    6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
+      names, trademarks, serviceDefinition marks, or product names of the Licensor,
       except as required for reasonable and customary use in describing the
       origin of the Work and reproducing the content of the NOTICE file.
 

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/bootstrap/DefaultRuntime.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/bootstrap/DefaultRuntime.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/bootstrap/DefaultRuntime.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/bootstrap/DefaultRuntime.java Fri Jun  2 19:25:01 2006
@@ -16,33 +16,33 @@
  */
 package org.apache.tuscany.core.bootstrap;
 
-import org.apache.tuscany.core.system.context.SystemCompositeContext;
-import org.apache.tuscany.core.system.context.SystemCompositeContextImpl;
-import org.apache.tuscany.spi.bootstrap.RuntimeContext;
-import org.apache.tuscany.spi.bootstrap.ContextNames;
-import org.apache.tuscany.spi.context.CompositeContext;
+import org.apache.tuscany.core.system.context.SystemCompositeComponent;
+import org.apache.tuscany.core.system.context.SystemCompositeComponentImpl;
+import org.apache.tuscany.spi.bootstrap.RuntimeComponent;
+import org.apache.tuscany.spi.bootstrap.ComponentNames;
+import org.apache.tuscany.spi.context.CompositeComponent;
 import org.apache.tuscany.spi.deployer.Deployer;
 
 /**
  * @version $Rev$ $Date$
  */
-public class DefaultRuntime extends SystemCompositeContextImpl<Void> implements RuntimeContext<SystemCompositeContext> {
-    private final CompositeContext rootContext;
-    private final SystemCompositeContext systemContext;
+public class DefaultRuntime extends SystemCompositeComponentImpl<Void> implements RuntimeComponent<SystemCompositeComponent> {
+    private final CompositeComponent rootComponent;
+    private final SystemCompositeComponent systemContext;
     private final Deployer deployer;
 
-    public DefaultRuntime(SystemCompositeContext systemContext, CompositeContext rootContext) {
-        super(ContextNames.TUSCANY_RUNTIME, null, null);
+    public DefaultRuntime(SystemCompositeComponent systemContext, CompositeComponent rootComponent) {
+        super(ComponentNames.TUSCANY_RUNTIME, null, null);
         this.systemContext = systemContext;
-        this.rootContext = rootContext;
+        this.rootComponent = rootComponent;
         deployer = null;
     }
 
-    public CompositeContext getRootContext() {
-        return rootContext;
+    public CompositeComponent getRootComponent() {
+        return rootComponent;
     }
 
-    public SystemCompositeContext getSystemContext() {
+    public SystemCompositeComponent getSystemComponent() {
         return systemContext;
     }
 

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/builder/BuilderRegistryImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/builder/BuilderRegistryImpl.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/builder/BuilderRegistryImpl.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/builder/BuilderRegistryImpl.java Fri Jun  2 19:25:01 2006
@@ -27,15 +27,15 @@
 import org.apache.tuscany.spi.builder.BuilderConfigException;
 import org.apache.tuscany.spi.builder.BuilderRegistry;
 import org.apache.tuscany.spi.builder.ComponentBuilder;
-import org.apache.tuscany.spi.context.ComponentContext;
-import org.apache.tuscany.spi.context.CompositeContext;
-import org.apache.tuscany.spi.context.Context;
+import org.apache.tuscany.spi.context.Component;
+import org.apache.tuscany.spi.context.CompositeComponent;
+import org.apache.tuscany.spi.context.SCAObject;
 import org.apache.tuscany.spi.context.ScopeRegistry;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
 import org.apache.tuscany.spi.model.Binding;
-import org.apache.tuscany.spi.model.BoundReference;
-import org.apache.tuscany.spi.model.BoundService;
-import org.apache.tuscany.spi.model.Component;
+import org.apache.tuscany.spi.model.BoundReferenceDefinition;
+import org.apache.tuscany.spi.model.BoundServiceDefinition;
+import org.apache.tuscany.spi.model.ComponentDefinition;
 import org.apache.tuscany.spi.model.Implementation;
 
 /**
@@ -80,18 +80,18 @@
     }
 
     @SuppressWarnings("unchecked")
-    public <I extends Implementation<?>> ComponentContext<?> build(CompositeContext<?> parent, Component<I> component, DeploymentContext deploymentContext) {
-        Class<I> implClass = (Class<I>) component.getImplementation().getClass();
+    public <I extends Implementation<?>> Component<?> build(CompositeComponent<?> parent, ComponentDefinition<I> componentDefinition, DeploymentContext deploymentContext) {
+        Class<I> implClass = (Class<I>) componentDefinition.getImplementation().getClass();
         ComponentBuilder<I> componentBuilder = (ComponentBuilder<I>) componentBuilders.get(implClass);
         if (componentBuilder == null) {
             BuilderConfigException e = new BuilderConfigException("No builder registered for implementation");
             e.setIdentifier(implClass.getName());
-            e.addContextName(component.getName());
+            e.addContextName(componentDefinition.getName());
             throw e;
         }
 
-        ComponentContext<?> context = componentBuilder.build(parent, component, deploymentContext);
-        assert(component.getImplementation().getComponentType() != null): "Component type must be set";
+        Component<?> context = componentBuilder.build(parent, componentDefinition, deploymentContext);
+        assert(componentDefinition.getImplementation().getComponentType() != null): "ComponentDefinition type must be set";
         return context;
     }
 
@@ -117,17 +117,17 @@
     }
 
     @SuppressWarnings("unchecked")
-    public <B extends Binding> Context build(CompositeContext parent, BoundService<B> boundService, DeploymentContext deploymentContext) {
-        Class<B> bindingClass = (Class<B>) boundService.getBinding().getClass();
+    public <B extends Binding> SCAObject build(CompositeComponent parent, BoundServiceDefinition<B> boundServiceDefinition, DeploymentContext deploymentContext) {
+        Class<B> bindingClass = (Class<B>) boundServiceDefinition.getBinding().getClass();
         BindingBuilder<B> bindingBuilder = (BindingBuilder<B>) bindingBuilders.get(bindingClass);
-        return bindingBuilder.build(parent, boundService, deploymentContext);
+        return bindingBuilder.build(parent, boundServiceDefinition, deploymentContext);
     }
 
     @SuppressWarnings("unchecked")
-    public <B extends Binding> Context build(CompositeContext parent, BoundReference<B> boundReference, DeploymentContext deploymentContext) {
-        Class<B> bindingClass = (Class<B>) boundReference.getBinding().getClass();
+    public <B extends Binding> SCAObject build(CompositeComponent parent, BoundReferenceDefinition<B> boundReferenceDefinition, DeploymentContext deploymentContext) {
+        Class<B> bindingClass = (Class<B>) boundReferenceDefinition.getBinding().getClass();
         BindingBuilder<B> bindingBuilder = (BindingBuilder<B>) bindingBuilders.get(bindingClass);
-        return bindingBuilder.build(parent, boundReference, deploymentContext);
+        return bindingBuilder.build(parent, boundReferenceDefinition, deploymentContext);
     }
 
 }

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/builder/Connector.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/builder/Connector.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/builder/Connector.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/builder/Connector.java Fri Jun  2 19:25:01 2006
@@ -1,8 +1,8 @@
 package org.apache.tuscany.core.builder;
 
 import org.apache.tuscany.spi.builder.BuilderConfigException;
-import org.apache.tuscany.spi.context.Context;
-import org.apache.tuscany.spi.context.CompositeContext;
+import org.apache.tuscany.spi.context.SCAObject;
+import org.apache.tuscany.spi.context.CompositeComponent;
 import org.apache.tuscany.spi.wire.InboundWire;
 import org.apache.tuscany.spi.wire.OutboundWire;
 import org.apache.tuscany.spi.model.Scope;
@@ -15,12 +15,12 @@
  */
 public interface Connector {
 
-    <T> void connect(Context<T> source);
+    <T> void connect(SCAObject<T> source);
 
     <T> void connect(InboundWire<T> inboundWire, OutboundWire<T> outboundWire, boolean optimizable) throws BuilderConfigException;
 
-    <T> void connect(OutboundWire<T> outboundWire, CompositeContext<?> parent, Scope sourceScope) throws BuilderConfigException;
+    <T> void connect(OutboundWire<T> outboundWire, CompositeComponent<?> parent, Scope sourceScope) throws BuilderConfigException;
 
-    <T> void connect(OutboundWire<T> sourceWire, InboundWire<T> targetWire, Context<?> context, boolean optimizable);
+    <T> void connect(OutboundWire<T> sourceWire, InboundWire<T> targetWire, SCAObject<?> context, boolean optimizable);
 
 }

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java Fri Jun  2 19:25:01 2006
@@ -12,11 +12,11 @@
 import org.apache.tuscany.core.wire.OutboundAutowire;
 import org.apache.tuscany.spi.QualifiedName;
 import org.apache.tuscany.spi.builder.BuilderConfigException;
-import org.apache.tuscany.spi.context.AtomicContext;
-import org.apache.tuscany.spi.context.ComponentContext;
-import org.apache.tuscany.spi.context.CompositeContext;
-import org.apache.tuscany.spi.context.Context;
-import org.apache.tuscany.spi.context.ReferenceContext;
+import org.apache.tuscany.spi.context.AtomicComponent;
+import org.apache.tuscany.spi.context.Component;
+import org.apache.tuscany.spi.context.CompositeComponent;
+import org.apache.tuscany.spi.context.SCAObject;
+import org.apache.tuscany.spi.context.Reference;
 import org.apache.tuscany.spi.model.Scope;
 import org.apache.tuscany.spi.wire.InboundInvocationChain;
 import org.apache.tuscany.spi.wire.InboundWire;
@@ -33,12 +33,12 @@
  */
 public class ConnectorImpl implements Connector {
 
-    public <T> void connect(Context<T> source) {
-        CompositeContext parent = source.getParent();
+    public <T> void connect(SCAObject<T> source) {
+        CompositeComponent parent = source.getParent();
         Scope scope = source.getScope();
-        if (source instanceof AtomicContext) {
-            AtomicContext<T> sourceContext = (AtomicContext<T>) source;
-            for (List<OutboundWire> referenceWires : sourceContext.getOutboundWires().values()) {
+        if (source instanceof AtomicComponent) {
+            AtomicComponent<T> sourceComponent = (AtomicComponent<T>) source;
+            for (List<OutboundWire> referenceWires : sourceComponent.getOutboundWires().values()) {
                 for (OutboundWire<T> outboundWire : referenceWires) {
                     if (outboundWire instanceof OutboundAutowire) {
                         continue;
@@ -61,20 +61,20 @@
     }
 
     @SuppressWarnings("unchecked")
-    public <T> void connect(OutboundWire<T> sourceWire, CompositeContext<?> parent, Scope sourceScope) throws BuilderConfigException {
+    public <T> void connect(OutboundWire<T> sourceWire, CompositeComponent<?> parent, Scope sourceScope) throws BuilderConfigException {
         assert(sourceScope != null): "Source scope was null";
-        assert(sourceWire.getTargetName() != null): "Wire target name was null";
+        assert(sourceWire.getTargetName() != null): "WireDefinition target name was null";
         QualifiedName targetName = sourceWire.getTargetName();
-        Context<?> target = parent.getContext(targetName.getPartName());
+        SCAObject<?> target = parent.getChild(targetName.getPartName());
         if (target == null) {
             BuilderConfigException e = new BuilderConfigException("Target not found for reference" + sourceWire.getReferenceName());
             e.setIdentifier(targetName.getQualifiedName());
             throw e;
         }
 
-        if (target instanceof AtomicContext) {
-            AtomicContext<?> targetContext = (AtomicContext<?>) target;
-            InboundWire<T> targetWire = targetContext.getInboundWire(targetName.getPortName());
+        if (target instanceof AtomicComponent) {
+            AtomicComponent<?> targetComponent = (AtomicComponent<?>) target;
+            InboundWire<T> targetWire = targetComponent.getInboundWire(targetName.getPortName());
             if (targetWire == null) {
                 BuilderConfigException e = new BuilderConfigException("Target service not found for reference " + sourceWire.getReferenceName());
                 e.setIdentifier(targetName.getPortName());
@@ -84,8 +84,8 @@
                 throw new BuilderConfigException("Incompatible source and target interfaces");
             }
             connect(sourceWire, targetWire, target, isOptimizable(sourceScope, target.getScope()));
-        } else if (target instanceof ReferenceContext) {
-            InboundWire<T> targetWire = ((ReferenceContext) target).getInboundWire();
+        } else if (target instanceof Reference) {
+            InboundWire<T> targetWire = ((Reference) target).getInboundWire();
             assert(targetWire != null);
             if (!sourceWire.getBusinessInterface().isAssignableFrom(targetWire.getBusinessInterface())) {
                 throw new BuilderConfigException("Incompatible source and target interfaces");
@@ -117,7 +117,7 @@
         }
     }
 
-    public <T> void connect(OutboundWire<T> sourceWire, InboundWire<T> targetWire, Context<?> context, boolean optimizable) {
+    public <T> void connect(OutboundWire<T> sourceWire, InboundWire<T> targetWire, SCAObject<?> context, boolean optimizable) {
         Map<Method, InboundInvocationChain> targetChains = targetWire.getInvocationChains();
         // perform optimization, if possible
         if (optimizable && sourceWire.getInvocationChains().isEmpty() && targetChains.isEmpty()) {
@@ -132,10 +132,10 @@
                 e.setIdentifier(sourceWire.getReferenceName());
                 throw e;
             }
-            if (context instanceof ComponentContext) {
-                connect(outboundChain, inboundChain, ((ComponentContext) context).createTargetInvoker(targetWire.getServiceName(), inboundChain.getMethod()));
-            } else if (context instanceof ReferenceContext) {
-                connect(outboundChain, inboundChain, ((ReferenceContext) context).createTargetInvoker(targetWire.getServiceName(), inboundChain.getMethod()));
+            if (context instanceof Component) {
+                connect(outboundChain, inboundChain, ((Component) context).createTargetInvoker(targetWire.getServiceName(), inboundChain.getMethod()));
+            } else if (context instanceof Reference) {
+                connect(outboundChain, inboundChain, ((Reference) context).createTargetInvoker(targetWire.getServiceName(), inboundChain.getMethod()));
             }
         }
     }
@@ -151,7 +151,7 @@
                     MessageChannel channel = new MessageChannelImpl(handlers);
                     sourceChain.setTargetRequestChannel(channel);
                 } else {
-                    BuilderConfigException e = new BuilderConfigException("Service chain must have an interceptor");
+                    BuilderConfigException e = new BuilderConfigException("ServiceDefinition chain must have an interceptor");
                     e.setIdentifier(targetChain.getMethod().getName());
                     throw e;
                 }

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/composite/builder/CompositeBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/composite/builder/CompositeBuilder.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/composite/builder/CompositeBuilder.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/composite/builder/CompositeBuilder.java Fri Jun  2 19:25:01 2006
@@ -16,49 +16,49 @@
  */
 package org.apache.tuscany.core.composite.builder;
 
-import org.apache.tuscany.core.context.CompositeContextImpl;
+import org.apache.tuscany.core.context.CompositeComponentImpl;
 import org.apache.tuscany.spi.builder.BuilderConfigException;
-import org.apache.tuscany.spi.context.ComponentContext;
-import org.apache.tuscany.spi.context.CompositeContext;
-import org.apache.tuscany.spi.context.Context;
+import org.apache.tuscany.spi.context.Component;
+import org.apache.tuscany.spi.context.CompositeComponent;
+import org.apache.tuscany.spi.context.SCAObject;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
 import org.apache.tuscany.spi.extension.ComponentBuilderExtension;
-import org.apache.tuscany.spi.model.BoundReference;
-import org.apache.tuscany.spi.model.BoundService;
-import org.apache.tuscany.spi.model.Component;
+import org.apache.tuscany.spi.model.BoundReferenceDefinition;
+import org.apache.tuscany.spi.model.BoundServiceDefinition;
+import org.apache.tuscany.spi.model.ComponentDefinition;
 import org.apache.tuscany.spi.model.CompositeComponentType;
 import org.apache.tuscany.spi.model.CompositeImplementation;
 import org.apache.tuscany.spi.model.Implementation;
-import org.apache.tuscany.spi.model.Reference;
+import org.apache.tuscany.spi.model.ReferenceDefinition;
 import org.apache.tuscany.spi.model.ReferenceTarget;
-import org.apache.tuscany.spi.model.Service;
+import org.apache.tuscany.spi.model.ServiceDefinition;
 
 /**
  * @version $Rev$ $Date$
  */
 public class CompositeBuilder extends ComponentBuilderExtension<CompositeImplementation> {
 
-    public ComponentContext<?> build(CompositeContext<?> parent,
-                                  Component<CompositeImplementation> component,
+    public Component<?> build(CompositeComponent<?> parent,
+                                  ComponentDefinition<CompositeImplementation> componentDefinition,
                                   DeploymentContext deploymentContext) throws BuilderConfigException {
-        CompositeImplementation implementation = component.getImplementation();
+        CompositeImplementation implementation = componentDefinition.getImplementation();
         CompositeComponentType<?,?,?> componentType = implementation.getComponentType();
-        CompositeContextImpl<?> context = new CompositeContextImpl(component.getName(), parent, null, wireService);
-        for (ReferenceTarget target : component.getReferenceTargets().values()) {
-            Reference reference = target.getReference();
-            if (reference instanceof BoundReference) {
-                Context<?> refereceContext = builderRegistry.build(context, (BoundReference) reference, deploymentContext);
-                context.registerContext(refereceContext);
+        CompositeComponentImpl<?> context = new CompositeComponentImpl(componentDefinition.getName(), parent, null, wireService);
+        for (ReferenceTarget target : componentDefinition.getReferenceTargets().values()) {
+            ReferenceDefinition referenceDefinition = target.getReference();
+            if (referenceDefinition instanceof BoundReferenceDefinition) {
+                SCAObject<?> refereceSCAObject = builderRegistry.build(context, (BoundReferenceDefinition) referenceDefinition, deploymentContext);
+                context.register(refereceSCAObject);
             }
         }
-        for (Component<? extends Implementation<?>> child : componentType.getComponents().values()) {
-            Context<?> childContext = builderRegistry.build(context, child, deploymentContext);
-            context.registerContext(childContext);
+        for (ComponentDefinition<? extends Implementation<?>> child : componentType.getComponents().values()) {
+            SCAObject<?> childSCAObject = builderRegistry.build(context, child, deploymentContext);
+            context.register(childSCAObject);
         }
-        for (Service service : componentType.getServices().values()) {
-            if (service instanceof BoundService) {
-                Context<?> serviceContext = builderRegistry.build(context, (BoundService) service, deploymentContext);
-                context.registerContext(serviceContext);
+        for (ServiceDefinition serviceDefinition : componentType.getServices().values()) {
+            if (serviceDefinition instanceof BoundServiceDefinition) {
+                SCAObject<?> serviceSCAObject = builderRegistry.build(context, (BoundServiceDefinition) serviceDefinition, deploymentContext);
+                context.register(serviceSCAObject);
             }
         }
         return context;

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/composite/loader/CompositeLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/composite/loader/CompositeLoader.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/composite/loader/CompositeLoader.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/composite/loader/CompositeLoader.java Fri Jun  2 19:25:01 2006
@@ -24,10 +24,10 @@
 
 import org.apache.tuscany.spi.model.CompositeComponentType;
 import org.apache.tuscany.spi.model.ModelObject;
-import org.apache.tuscany.spi.model.Service;
-import org.apache.tuscany.spi.model.Reference;
+import org.apache.tuscany.spi.model.ServiceDefinition;
+import org.apache.tuscany.spi.model.ReferenceDefinition;
 import org.apache.tuscany.spi.model.Property;
-import org.apache.tuscany.spi.model.Component;
+import org.apache.tuscany.spi.model.ComponentDefinition;
 import org.apache.tuscany.spi.model.Implementation;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
 import org.apache.tuscany.spi.loader.LoaderException;
@@ -57,14 +57,14 @@
             switch (reader.next()) {
                 case START_ELEMENT:
                     ModelObject o = registry.load(reader, deploymentContext);
-                    if (o instanceof Service) {
-                        composite.add((Service) o);
-                    } else if (o instanceof Reference) {
-                        composite.add((Reference) o);
+                    if (o instanceof ServiceDefinition) {
+                        composite.add((ServiceDefinition) o);
+                    } else if (o instanceof ReferenceDefinition) {
+                        composite.add((ReferenceDefinition) o);
                     } else if (o instanceof Property<?>) {
                         composite.add((Property<?>) o);
-                    } else if (o instanceof Component<?>) {
-                        composite.add((Component<? extends Implementation>) o);
+                    } else if (o instanceof ComponentDefinition<?>) {
+                        composite.add((ComponentDefinition<? extends Implementation>) o);
                     }
                     reader.next();
                     break;



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message