tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmar...@apache.org
Subject svn commit: r411356 [3/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
Copied: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/AbstractCompositeComponent.java (from r411328, incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/AbstractCompositeContext.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/AbstractCompositeComponent.java?p2=incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/AbstractCompositeComponent.java&p1=incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/AbstractCompositeContext.java&r1=411328&r2=411356&rev=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/AbstractCompositeContext.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/AbstractCompositeComponent.java Fri Jun  2 19:25:01 2006
@@ -7,19 +7,19 @@
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.tuscany.core.system.context.SystemServiceContext;
+import org.apache.tuscany.core.system.context.SystemService;
 import org.apache.tuscany.spi.CoreRuntimeException;
 import org.apache.tuscany.spi.annotation.Autowire;
-import org.apache.tuscany.spi.context.AtomicContext;
-import org.apache.tuscany.spi.context.CompositeContext;
-import org.apache.tuscany.spi.context.Context;
+import org.apache.tuscany.spi.context.AtomicComponent;
+import org.apache.tuscany.spi.context.CompositeComponent;
+import org.apache.tuscany.spi.context.SCAObject;
 import org.apache.tuscany.spi.context.DuplicateNameException;
 import org.apache.tuscany.spi.context.IllegalTargetException;
-import org.apache.tuscany.spi.context.ReferenceContext;
+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.context.Service;
 import org.apache.tuscany.spi.event.Event;
-import org.apache.tuscany.spi.extension.CompositeContextExtension;
+import org.apache.tuscany.spi.extension.CompositeComponentExtension;
 import org.apache.tuscany.spi.wire.TargetInvoker;
 import org.apache.tuscany.spi.wire.WireService;
 
@@ -29,7 +29,7 @@
  * @version $Rev: 399348 $ $Date: 2006-05-03 09:33:22 -0700 (Wed, 03 May 2006) $
  */
 @SuppressWarnings({"FieldAccessedSynchronizedAndUnsynchronized", "RawUseOfParameterizedType", "NonPrivateFieldAccessedInSynchronizedContext"})
-public abstract class AbstractCompositeContext<T> extends CompositeContextExtension<T> implements AutowireContext<T> {
+public abstract class AbstractCompositeComponent<T> extends CompositeComponentExtension<T> implements AutowireComponent<T> {
 
     public static final int DEFAULT_WAIT = 1000 * 60;
 
@@ -42,20 +42,20 @@
     protected boolean initialized;
 
     // a mapping of service type to component name
-    protected final Map<Class, Context> autowireInternal = new ConcurrentHashMap<Class, Context>();
-    protected final Map<Class, SystemServiceContext> autowireExternal = new ConcurrentHashMap<Class, SystemServiceContext>();
+    protected final Map<Class, SCAObject> autowireInternal = new ConcurrentHashMap<Class, SCAObject>();
+    protected final Map<Class, SystemService> autowireExternal = new ConcurrentHashMap<Class, SystemService>();
 
-    protected AutowireContext<?> autowireContext;
+    protected AutowireComponent<?> autowireContext;
 
     protected ScopeContext scopeContext;
 
-    public AbstractCompositeContext(String name, CompositeContext parent, AutowireContext autowireContext, WireService wireService) {
+    public AbstractCompositeComponent(String name, CompositeComponent parent, AutowireComponent autowireContext, WireService wireService) {
         super(name, parent, wireService);
         this.autowireContext = autowireContext;
     }
 
     @Autowire
-    public void setAutowireContext(AutowireContext context) {
+    public void setAutowireContext(AutowireComponent context) {
         autowireContext = context;
     }
 
@@ -66,13 +66,13 @@
     public void start() {
         synchronized (lock) {
             if (lifecycleState != UNINITIALIZED && lifecycleState != STOPPED) {
-                throw new IllegalStateException("Context not in UNINITIALIZED state");
+                throw new IllegalStateException("SCAObject not in UNINITIALIZED state");
             }
 
             if (scopeContext != null) {
                 scopeContext.start();
             }
-            for (Context child : children.values()) {
+            for (SCAObject child : children.values()) {
                 child.start();
             }
             initializeLatch.countDown();
@@ -85,7 +85,7 @@
         if (lifecycleState == STOPPED) {
             return;
         }
-        for (Context child : children.values()) {
+        for (SCAObject child : children.values()) {
             child.stop();
         }
         if (scopeContext != null) {
@@ -101,7 +101,7 @@
         lifecycleState = STOPPED;
     }
 
-    public void registerContext(Context child) {
+    public void register(SCAObject child) {
         if (children.get(child.getName()) != null) {
             DuplicateNameException e = new DuplicateNameException("A context is already registered with name");
             e.setIdentifier(child.getName());
@@ -109,27 +109,27 @@
             throw e;
         }
         children.put(child.getName(), child);
-        if (child instanceof ServiceContext) {
-            ServiceContext serviceContext = (ServiceContext) child;
+        if (child instanceof Service) {
+            Service service = (Service) child;
             synchronized (services) {
-                services.add(serviceContext);
+                services.add(service);
             }
-            registerAutowire(serviceContext);
-        } else if (child instanceof ReferenceContext) {
-            ReferenceContext context = (ReferenceContext) child;
+            registerAutowire(service);
+        } else if (child instanceof Reference) {
+            Reference context = (Reference) child;
             synchronized (references) {
                 references.add(context);
             }
             registerAutowire(context);
-        } else if (child instanceof AtomicContext) {
-            registerAutowire((AtomicContext) child);
-        } else if (child instanceof CompositeContext) {
-            CompositeContext context = (CompositeContext) child;
-            if (lifecycleState == RUNNING && context.getLifecycleState() == UNINITIALIZED) {
-                context.start();
+        } else if (child instanceof AtomicComponent) {
+            registerAutowire((AtomicComponent) child);
+        } else if (child instanceof CompositeComponent) {
+            CompositeComponent component = (CompositeComponent) child;
+            if (lifecycleState == RUNNING && component.getLifecycleState() == UNINITIALIZED) {
+                component.start();
             }
-            registerAutowire(context);
-            addListener(context);
+            registerAutowire(component);
+            addListener(component);
         }
 
     }
@@ -140,14 +140,14 @@
     }
 
     public <T> T resolveInstance(Class<T> instanceInterface) throws AutowireResolutionException {
-        if (AutowireContext.class.equals(instanceInterface)) {
+        if (AutowireComponent.class.equals(instanceInterface)) {
             return instanceInterface.cast(this);
         }
-        Context context = autowireInternal.get(instanceInterface);
+        SCAObject context = autowireInternal.get(instanceInterface);
         if (context != null) {
             try {
-                if (context instanceof AtomicContext || context instanceof ReferenceContext
-                        || context instanceof SystemServiceContext) {
+                if (context instanceof AtomicComponent || context instanceof Reference
+                        || context instanceof SystemService) {
                     return instanceInterface.cast(context.getService());
                 } else {
                     IllegalTargetException e = new IllegalTargetException("Autowire target must be a system service, atomic, or reference context");
@@ -173,7 +173,7 @@
     }
 
     public <T> T resolveExternalInstance(Class<T> instanceInterface) throws AutowireResolutionException {
-        SystemServiceContext context = autowireExternal.get(instanceInterface);
+        SystemService context = autowireExternal.get(instanceInterface);
         if (context != null) {
             try {
                 return instanceInterface.cast(context.getService());
@@ -190,7 +190,7 @@
         return null;// new BridgingInvoker(serviceName, operation, this);
     }
 
-    protected void registerAutowireExternal(Class<?> interfaze, SystemServiceContext context) {
+    protected void registerAutowireExternal(Class<?> interfaze, SystemService context) {
         assert interfaze != null;
         if (autowireExternal.containsKey(interfaze)) {
             return;
@@ -198,7 +198,7 @@
         autowireExternal.put(interfaze, context);
     }
 
-    protected void registerAutowireInternal(Class<?> interfaze, Context context) {
+    protected void registerAutowireInternal(Class<?> interfaze, SCAObject context) {
         assert interfaze != null: "Interface was null";
         if (autowireInternal.containsKey(interfaze)) {
             return;
@@ -206,27 +206,27 @@
         autowireInternal.put(interfaze, context);
     }
 
-    protected void registerAutowire(CompositeContext<?> context) {
-        List<ServiceContext> services = context.getServiceContexts();
-        for (ServiceContext service : services) {
+    protected void registerAutowire(CompositeComponent<?> component) {
+        List<Service> services = component.getServices();
+        for (Service service : services) {
             registerAutowireInternal(service.getInterface(), service);
         }
     }
 
-    protected void registerAutowire(AtomicContext<?> context) {
-        List<Class<?>> services = context.getServiceInterfaces();
+    protected void registerAutowire(AtomicComponent<?> component) {
+        List<Class<?>> services = component.getServiceInterfaces();
         for (Class<?> service : services) {
-            registerAutowireInternal(service, context);
+            registerAutowireInternal(service, component);
         }
     }
 
-    protected void registerAutowire(ReferenceContext context) {
+    protected void registerAutowire(Reference context) {
         registerAutowireInternal(context.getInterface(), context);
     }
 
-    protected void registerAutowire(ServiceContext context) {
-        if (context instanceof SystemServiceContext) {
-            SystemServiceContext systemContext = (SystemServiceContext) context;
+    protected void registerAutowire(Service context) {
+        if (context instanceof SystemService) {
+            SystemService systemContext = (SystemService) context;
             registerAutowireExternal(systemContext.getInterface(), systemContext);
         }
     }
@@ -238,9 +238,9 @@
         if (!initialized) {
             try {
                 /* block until the module has initialized */
-                boolean success = initializeLatch.await(AbstractCompositeContext.DEFAULT_WAIT, TimeUnit.MILLISECONDS);
+                boolean success = initializeLatch.await(AbstractCompositeComponent.DEFAULT_WAIT, TimeUnit.MILLISECONDS);
                 if (!success) {
-                    throw new ContextInitException("Timeout waiting for context to initialize");
+                    throw new ComponentInitException("Timeout waiting for context to initialize");
                 }
             } catch (InterruptedException e) { // should not happen
             }

Copied: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/AutowireComponent.java (from r411328, incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/AutowireContext.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/AutowireComponent.java?p2=incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/AutowireComponent.java&p1=incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/AutowireContext.java&r1=411328&r2=411356&rev=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/AutowireContext.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/AutowireComponent.java Fri Jun  2 19:25:01 2006
@@ -13,21 +13,20 @@
  */
 package org.apache.tuscany.core.context;
 
-import org.apache.tuscany.spi.context.CompositeContext;
+import org.apache.tuscany.spi.context.CompositeComponent;
 
 
 /**
- * A specialization of a CompositeContext that is able to automatically resolve references
- * for its children using service interfaces exposed by it or, recursively, any
- * of it parents.
+ * A specialization of a CompositeComponent that is able to automatically resolve references for its children
+ * using service interfaces exposed by it or, recursively, any of it parents.
  *
  * @version $Rev$ $Date$
  */
-public interface AutowireContext<S> extends CompositeContext<S> {
+public interface AutowireComponent<S> extends CompositeComponent<S> {
 
     /**
-     * Invoked by child contexts to return an an autowire target. Resolved targets may be entry points or
-     * components in the parent or its ancestors, or entry points in a sibling context
+     * Invoked by child components to return an an autowire target. Resolved targets may be services or
+     * components in the parent or its ancestors, or references in a sibling component
      *
      * @param instanceInterface the type of service being requested
      * @return a reference to the requested service or null if none can be found
@@ -36,10 +35,10 @@
     <T> T resolveInstance(Class<T> instanceInterface) throws AutowireResolutionException;
 
     /**
-     * Invoked by a parent context to return an autowire target in a child. Resolved targets must be entry points.
-     * For example, given a parent P and two siblings, A and B, A would request an autowire by invoking
-     * {@link #resolveInstance(Class<T>)} on P, which in turn could invoke the present method on B in order to resolve
-     * a target.
+     * Invoked by a parent component to return an autowire target in a child. Resolved targets must be
+     * services. For example, given a parent P and two siblings, A and B, A would request an autowire by
+     * invoking {@link #resolveInstance(Class<T>)} on P, which in turn could invoke the present method on B in
+     * order to resolve a target.
      *
      * @param instanceInterface the type of service being requested
      * @return a reference to the requested service or null if none can be found

Propchange: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/AutowireComponent.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/ComponentInitException.java (from r411328, incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/ContextInitException.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/ComponentInitException.java?p2=incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/ComponentInitException.java&p1=incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/ContextInitException.java&r1=411328&r2=411356&rev=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/ContextInitException.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/ComponentInitException.java Fri Jun  2 19:25:01 2006
@@ -1,23 +1,23 @@
 package org.apache.tuscany.core.context;
 
-import org.apache.tuscany.spi.context.ContextRuntimeException;
+import org.apache.tuscany.spi.context.ComponentRuntimeException;
 
 /**
  * @version $$Rev$$ $$Date$$
  */
-public class ContextInitException extends ContextRuntimeException {
-    public ContextInitException() {
+public class ComponentInitException extends ComponentRuntimeException {
+    public ComponentInitException() {
     }
 
-    public ContextInitException(String message) {
+    public ComponentInitException(String message) {
         super(message);
     }
 
-    public ContextInitException(String message, Throwable cause) {
+    public ComponentInitException(String message, Throwable cause) {
         super(message, cause);
     }
 
-    public ContextInitException(Throwable cause) {
+    public ComponentInitException(Throwable cause) {
         super(cause);
     }
 }

Copied: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/CompositeComponentImpl.java (from r411328, incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/CompositeContextImpl.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/CompositeComponentImpl.java?p2=incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/CompositeComponentImpl.java&p1=incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/CompositeContextImpl.java&r1=411328&r2=411356&rev=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/CompositeContextImpl.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/CompositeComponentImpl.java Fri Jun  2 19:25:01 2006
@@ -2,11 +2,11 @@
 
 import org.apache.tuscany.spi.QualifiedName;
 import org.apache.tuscany.spi.wire.WireService;
-import org.apache.tuscany.spi.context.AtomicContext;
-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.ServiceContext;
+import org.apache.tuscany.spi.context.AtomicComponent;
+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.Service;
 import org.apache.tuscany.spi.context.TargetException;
 import org.osoa.sca.ServiceUnavailableException;
 
@@ -16,9 +16,9 @@
  *
  * @version $Rev: 399348 $ $Date: 2006-05-03 09:33:22 -0700 (Wed, 03 May 2006) $
  */
-public class CompositeContextImpl<T> extends AbstractCompositeContext<T> {
+public class CompositeComponentImpl<T> extends AbstractCompositeComponent<T> {
 
-    public CompositeContextImpl(String name, CompositeContext parent, AutowireContext autowireContext, WireService wireService) {
+    public CompositeComponentImpl(String name, CompositeComponent parent, AutowireComponent autowireContext, WireService wireService) {
         super(name, parent, autowireContext,wireService);
     }
 
@@ -36,14 +36,14 @@
     public Object locateService(String name) throws ServiceUnavailableException {
         checkInit();
         QualifiedName qName = new QualifiedName(name);
-        Context context = children.get(qName.getPartName());
+        SCAObject context = children.get(qName.getPartName());
         if (context == null) {
-            throw new ServiceUnavailableException("Service not found [" + name + "]");
+            throw new ServiceUnavailableException("ServiceDefinition not found [" + name + "]");
         }
         try {
-            if (context instanceof AtomicContext) {
-                return ((AtomicContext) context).getService(qName.getPortName());
-            } else if (context instanceof ServiceContext || context instanceof ReferenceContext) {
+            if (context instanceof AtomicComponent) {
+                return ((AtomicComponent) context).getServiceInstance(qName.getPortName());
+            } else if (context instanceof Service || context instanceof Reference) {
                 return context.getService();
             } else {
                 throw new ServiceUnavailableException("Illegal target type [" + name + "]");

Copied: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/PojoAtomicComponent.java (from r411328, incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/PojoAtomicContext.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/PojoAtomicComponent.java?p2=incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/PojoAtomicComponent.java&p1=incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/PojoAtomicContext.java&r1=411328&r2=411356&rev=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/PojoAtomicContext.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/PojoAtomicComponent.java Fri Jun  2 19:25:01 2006
@@ -19,21 +19,21 @@
 import org.apache.tuscany.core.injection.WireObjectFactory;
 import org.apache.tuscany.spi.ObjectCreationException;
 import org.apache.tuscany.spi.ObjectFactory;
-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.InstanceWrapper;
 import org.apache.tuscany.spi.context.ScopeContext;
 import org.apache.tuscany.spi.context.TargetException;
-import org.apache.tuscany.spi.extension.AtomicContextExtension;
+import org.apache.tuscany.spi.extension.AtomicComponentExtension;
 import org.apache.tuscany.spi.wire.OutboundWire;
 import org.apache.tuscany.spi.wire.WireService;
 
 /**
- * Base implementation of an {@link AtomicContext} whose type is a Java class
+ * Base implementation of an {@link AtomicComponent} whose type is a Java class
  *
  * @version $$Rev$$ $$Date$$
  */
-public abstract class PojoAtomicContext<T> extends AtomicContextExtension<T> {
+public abstract class PojoAtomicComponent<T> extends AtomicComponentExtension<T> {
 
     protected boolean eagerInit;
     protected EventInvoker<Object> initInvoker;
@@ -43,17 +43,17 @@
     protected List<Injector> injectors;
     protected Map<String, Member> members;
 
-    public PojoAtomicContext(String name,
-                             CompositeContext<?> parent,
-                             ScopeContext scopeContext,
-                             Class<?> serviceInterface,
-                             ObjectFactory<?> objectFactory,
-                             boolean eagerInit,
-                             EventInvoker<Object> initInvoker,
-                             EventInvoker<Object> destroyInvoker,
-                             List<Injector> injectors,
-                             Map<String, Member> members,
-                             WireService wireService) {
+    public PojoAtomicComponent(String name,
+                               CompositeComponent<?> parent,
+                               ScopeContext scopeContext,
+                               Class<?> serviceInterface,
+                               ObjectFactory<?> objectFactory,
+                               boolean eagerInit,
+                               EventInvoker<Object> initInvoker,
+                               EventInvoker<Object> destroyInvoker,
+                               List<Injector> injectors,
+                               Map<String, Member> members,
+                               WireService wireService) {
         super(name, parent, scopeContext, wireService);
         assert (objectFactory != null) : "Object factory was null";
         if (eagerInit && initInvoker == null) {
@@ -71,17 +71,17 @@
 
     }
 
-    public PojoAtomicContext(String name,
-                             CompositeContext<?> parent,
-                             ScopeContext scopeContext,
-                             List<Class<?>> serviceInterfaces,
-                             ObjectFactory<?> objectFactory,
-                             boolean eagerInit,
-                             EventInvoker<Object> initInvoker,
-                             EventInvoker<Object> destroyInvoker,
-                             List<Injector> injectors,
-                             Map<String, Member> members,
-                             WireService wireService) {
+    public PojoAtomicComponent(String name,
+                               CompositeComponent<?> parent,
+                               ScopeContext scopeContext,
+                               List<Class<?>> serviceInterfaces,
+                               ObjectFactory<?> objectFactory,
+                               boolean eagerInit,
+                               EventInvoker<Object> initInvoker,
+                               EventInvoker<Object> destroyInvoker,
+                               List<Injector> injectors,
+                               Map<String, Member> members,
+                               WireService wireService) {
         super(name, parent, scopeContext, wireService);
         assert (objectFactory != null) : "Object factory was null";
         if (eagerInit && initInvoker == null) {

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/PojoInstanceWrapper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/PojoInstanceWrapper.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/PojoInstanceWrapper.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/PojoInstanceWrapper.java Fri Jun  2 19:25:01 2006
@@ -15,7 +15,7 @@
 
 import org.apache.tuscany.spi.AbstractLifecycle;
 import org.apache.tuscany.spi.CoreRuntimeException;
-import org.apache.tuscany.spi.context.AtomicContext;
+import org.apache.tuscany.spi.context.AtomicComponent;
 import org.apache.tuscany.spi.context.InstanceWrapper;
 
 /**
@@ -26,12 +26,12 @@
 public class PojoInstanceWrapper extends AbstractLifecycle implements InstanceWrapper {
 
     private Object instance;
-    private AtomicContext context;
+    private AtomicComponent component;
 
-    public PojoInstanceWrapper(AtomicContext context, Object instance) {
-        assert(context != null);
+    public PojoInstanceWrapper(AtomicComponent component, Object instance) {
+        assert(component != null);
         assert(instance != null);
-        this.context = context;
+        this.component = component;
         this.instance = instance;
     }
 
@@ -42,7 +42,7 @@
 
     public void start() throws CoreRuntimeException {
         try {
-            context.init(instance);
+            component.init(instance);
             lifecycleState = RUNNING;
         } catch (RuntimeException e) {
             lifecycleState = ERROR;
@@ -52,7 +52,7 @@
 
     public void stop() throws CoreRuntimeException {
         checkInit();
-        context.destroy(instance);
+        component.destroy(instance);
     }
 
     protected void checkInit() {

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/WorkContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/WorkContextImpl.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/WorkContextImpl.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/WorkContextImpl.java Fri Jun  2 19:25:01 2006
@@ -3,7 +3,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.tuscany.spi.context.CompositeContext;
+import org.apache.tuscany.spi.context.CompositeComponent;
 import org.apache.tuscany.spi.context.WorkContext;
 
 /**
@@ -23,22 +23,22 @@
      */
     private ThreadLocal<Map<Object, Object>> workContext = new InheritableThreadLocal<Map<Object, Object>>();
 
-    public CompositeContext getRemoteContext() {
+    public CompositeComponent getRemoteContext() {
         Map<Object, Object> map = workContext.get();
         if (map == null) {
             return null;
         }
-        return (CompositeContext) map.get(REMOTE_CONTEXT);
+        return (CompositeComponent) map.get(REMOTE_CONTEXT);
     }
 
 
-    public void setRemoteContext(CompositeContext context) {
+    public void setRemoteContext(CompositeComponent component) {
         Map<Object, Object> map = workContext.get();
         if (map == null) {
             map = new HashMap<Object, Object>();
             workContext.set(map);
         }
-        map.put(REMOTE_CONTEXT, context);
+        map.put(REMOTE_CONTEXT, component);
     }
 
     public Object getIdentifier(Object type) {

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/event/ModuleEvent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/event/ModuleEvent.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/event/ModuleEvent.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/event/ModuleEvent.java Fri Jun  2 19:25:01 2006
@@ -1,7 +1,7 @@
 package org.apache.tuscany.core.context.event;
 
 import org.apache.tuscany.spi.event.Event;
-import org.apache.tuscany.spi.context.CompositeContext;
+import org.apache.tuscany.spi.context.CompositeComponent;
 
 /**
  * Implemented by runtime events associated with a module, e.g. lifecycle events
@@ -10,6 +10,6 @@
  */
 public interface ModuleEvent extends Event {
 
-    public CompositeContext getContext();
+    public CompositeComponent getContext();
 
 }

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/event/ModuleStart.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/event/ModuleStart.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/event/ModuleStart.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/event/ModuleStart.java Fri Jun  2 19:25:01 2006
@@ -1,6 +1,6 @@
 package org.apache.tuscany.core.context.event;
 
-import org.apache.tuscany.spi.context.CompositeContext;
+import org.apache.tuscany.spi.context.CompositeComponent;
 
 /**
  * Propagated when a module starts
@@ -9,20 +9,20 @@
  */
 public class ModuleStart extends AbstractEvent implements ModuleEvent {
 
-    private CompositeContext context;
+    private CompositeComponent component;
     
     /**
      * Creates a module stop event
      * @param source the source of the event
-     * @param ctx the composite context associated the module being stopped
+     * @param ctx the composite component associated the module being stopped
      */
-    public ModuleStart(Object source, CompositeContext ctx) {
+    public ModuleStart(Object source, CompositeComponent ctx) {
         super(source);
-        context = ctx;
+        component = ctx;
     }
 
-    public CompositeContext getContext(){
-        return context;
+    public CompositeComponent getContext(){
+        return component;
     }
 
 }

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/event/ModuleStop.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/event/ModuleStop.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/event/ModuleStop.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/event/ModuleStop.java Fri Jun  2 19:25:01 2006
@@ -1,6 +1,6 @@
 package org.apache.tuscany.core.context.event;
 
-import org.apache.tuscany.spi.context.CompositeContext;
+import org.apache.tuscany.spi.context.CompositeComponent;
 
 /**
  * Propagated when a module stops
@@ -9,19 +9,19 @@
  */
 public class ModuleStop extends AbstractEvent implements ModuleEvent{
 
-    private CompositeContext context;
+    private CompositeComponent component;
 
     /**
      * Creates a module stop event
      * @param source the source of the event
-     * @param ctx the composite context associated the module being stopped
+     * @param ctx the composite component associated the module being stopped
      */
-    public ModuleStop(Object source, CompositeContext ctx) {
+    public ModuleStop(Object source, CompositeComponent ctx) {
         super(source);
-        context = ctx;
+        component = ctx;
     }
 
-    public CompositeContext getContext(){
-        return context;
+    public CompositeComponent getContext(){
+        return component;
     }
 }

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/AbstractScopeContext.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/AbstractScopeContext.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/AbstractScopeContext.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/AbstractScopeContext.java Fri Jun  2 19:25:01 2006
@@ -7,7 +7,7 @@
 import java.util.concurrent.CopyOnWriteArrayList;
 
 import org.apache.tuscany.spi.AbstractLifecycle;
-import org.apache.tuscany.spi.context.AtomicContext;
+import org.apache.tuscany.spi.context.AtomicComponent;
 import org.apache.tuscany.spi.context.InstanceWrapper;
 import org.apache.tuscany.spi.context.ScopeContext;
 import org.apache.tuscany.spi.context.TargetException;
@@ -83,8 +83,8 @@
         }
     }
 
-    public Object getInstance(AtomicContext context) throws TargetException {
-        InstanceWrapper ctx = getInstanceContext(context);
+    public Object getInstance(AtomicComponent component) throws TargetException {
+        InstanceWrapper ctx = getInstanceContext(component);
         if (ctx != null) {
             if (ctx.getLifecycleState() == UNINITIALIZED) {
                 ctx.start();

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/HttpSessionScopeContext.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/HttpSessionScopeContext.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/HttpSessionScopeContext.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/HttpSessionScopeContext.java Fri Jun  2 19:25:01 2006
@@ -9,7 +9,7 @@
 import org.apache.tuscany.core.context.event.HttpSessionEnd;
 import org.apache.tuscany.core.context.event.HttpSessionStart;
 import org.apache.tuscany.spi.model.Scope;
-import org.apache.tuscany.spi.context.AtomicContext;
+import org.apache.tuscany.spi.context.AtomicComponent;
 import org.apache.tuscany.spi.context.InstanceWrapper;
 import org.apache.tuscany.spi.context.TargetException;
 import org.apache.tuscany.spi.context.WorkContext;
@@ -24,7 +24,7 @@
 
     public static final Object HTTP_IDENTIFIER = new Object();
 
-    private final Map<AtomicContext, Map<Object, InstanceWrapper>> contexts;
+    private final Map<AtomicComponent, Map<Object, InstanceWrapper>> contexts;
     private final Map<Object, List<InstanceWrapper>> destroyQueues;
 
     public HttpSessionScopeContext(){
@@ -33,7 +33,7 @@
 
     public HttpSessionScopeContext(WorkContext workContext) {
         super("Session Scope", workContext);
-        contexts = new ConcurrentHashMap<AtomicContext, Map<Object, InstanceWrapper>>();
+        contexts = new ConcurrentHashMap<AtomicComponent, Map<Object, InstanceWrapper>>();
         destroyQueues = new ConcurrentHashMap<Object, List<InstanceWrapper>>();
     }
 
@@ -45,7 +45,7 @@
         checkInit();
         if (event instanceof HttpSessionStart) {
             Object key = ((HttpSessionStart) event).getId();
-            for (Map.Entry<AtomicContext, Map<Object, InstanceWrapper>> entry : contexts.entrySet()) {
+            for (Map.Entry<AtomicComponent, Map<Object, InstanceWrapper>> entry : contexts.entrySet()) {
                 if(entry.getKey().isEagerInit()){
                     getInstance(entry.getKey(),key);
                 }
@@ -70,23 +70,23 @@
         lifecycleState = STOPPED;
     }
 
-    public void register(AtomicContext context) {
-        contexts.put(context, new ConcurrentHashMap<Object, InstanceWrapper>());
-        context.addListener(this);
+    public void register(AtomicComponent component) {
+        contexts.put(component, new ConcurrentHashMap<Object, InstanceWrapper>());
+        component.addListener(this);
 
     }
 
-    public InstanceWrapper getInstanceContext(AtomicContext context) throws TargetException {
+    public InstanceWrapper getInstanceContext(AtomicComponent component) throws TargetException {
         Object key = workContext.getIdentifier(HTTP_IDENTIFIER);
-        assert(key != null):"HTTP session key not bound in work context";
-        return getInstance(context, key);
+        assert(key != null):"HTTP session key not bound in work component";
+        return getInstance(component, key);
     }
 
-    private InstanceWrapper getInstance(AtomicContext context, Object key) {
-        Map<Object, InstanceWrapper> wrappers = contexts.get(context);
+    private InstanceWrapper getInstance(AtomicComponent component, Object key) {
+        Map<Object, InstanceWrapper> wrappers = contexts.get(component);
         InstanceWrapper ctx = wrappers.get(key);
         if (ctx == null) {
-            ctx = context.createInstance();
+            ctx = component.createInstance();
             wrappers.put(key, ctx);
             List<InstanceWrapper> destroyQueue = destroyQueues.get(key);
             if (destroyQueue == null) {

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/ModuleScopeContext.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/ModuleScopeContext.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/ModuleScopeContext.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/ModuleScopeContext.java Fri Jun  2 19:25:01 2006
@@ -11,7 +11,7 @@
 import org.apache.tuscany.core.context.event.ModuleStop;
 import org.apache.tuscany.spi.model.Scope;
 import org.apache.tuscany.spi.CoreRuntimeException;
-import org.apache.tuscany.spi.context.AtomicContext;
+import org.apache.tuscany.spi.context.AtomicComponent;
 import org.apache.tuscany.spi.context.InstanceWrapper;
 import org.apache.tuscany.spi.context.TargetException;
 import org.apache.tuscany.spi.context.WorkContext;
@@ -24,7 +24,7 @@
  */
 public class ModuleScopeContext extends AbstractScopeContext {
 
-    private final Map<AtomicContext, InstanceWrapper> instanceContexts;
+    private final Map<AtomicComponent, InstanceWrapper> instanceContexts;
     // the queue of instanceContexts to destroy, in the order that their instances were created
     private final List<InstanceWrapper> destroyQueue;
     private static final InstanceWrapper EMPTY = new EmptyWrapper();
@@ -35,7 +35,7 @@
 
     public ModuleScopeContext(WorkContext workContext) {
         super("Module Scope", workContext);
-        instanceContexts = new ConcurrentHashMap<AtomicContext, InstanceWrapper>();
+        instanceContexts = new ConcurrentHashMap<AtomicComponent, InstanceWrapper>();
         destroyQueue = new ArrayList<InstanceWrapper>();
     }
 
@@ -88,19 +88,19 @@
         }
     }
 
-    public void register(AtomicContext context) {
+    public void register(AtomicComponent component) {
         checkInit();
-        instanceContexts.put(context, EMPTY);
+        instanceContexts.put(component, EMPTY);
     }
 
 
-    public InstanceWrapper getInstanceContext(AtomicContext context) throws TargetException {
+    public InstanceWrapper getInstanceContext(AtomicComponent component) throws TargetException {
         checkInit();
-        InstanceWrapper ctx = instanceContexts.get(context);
-        assert ctx != null : "Context not registered with scope: " + context;
+        InstanceWrapper ctx = instanceContexts.get(component);
+        assert ctx != null : "SCAObject not registered with scope: " + component;
         if (ctx == EMPTY) {
-            ctx = context.createInstance();
-            instanceContexts.put(context, ctx);
+            ctx = component.createInstance();
+            instanceContexts.put(component, ctx);
             synchronized (destroyQueue) {
                 destroyQueue.add(ctx);
             }
@@ -109,11 +109,11 @@
     }
 
     private void eagerInitContexts() throws CoreRuntimeException {
-        for (Map.Entry<AtomicContext, InstanceWrapper> entry : instanceContexts.entrySet()) {
-            AtomicContext context = entry.getKey();
-            if (context.isEagerInit()) {
-                InstanceWrapper instanceCtx = context.createInstance();
-                instanceContexts.put(context, instanceCtx);
+        for (Map.Entry<AtomicComponent, InstanceWrapper> entry : instanceContexts.entrySet()) {
+            AtomicComponent component = entry.getKey();
+            if (component.isEagerInit()) {
+                InstanceWrapper instanceCtx = component.createInstance();
+                instanceContexts.put(component, instanceCtx);
                 destroyQueue.add(instanceCtx);
             }
         }

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/RequestScopeContext.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/RequestScopeContext.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/RequestScopeContext.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/RequestScopeContext.java Fri Jun  2 19:25:01 2006
@@ -9,7 +9,7 @@
 import org.apache.tuscany.core.context.event.RequestEnd;
 import org.apache.tuscany.core.context.event.RequestStart;
 import org.apache.tuscany.spi.model.Scope;
-import org.apache.tuscany.spi.context.AtomicContext;
+import org.apache.tuscany.spi.context.AtomicComponent;
 import org.apache.tuscany.spi.context.InstanceWrapper;
 import org.apache.tuscany.spi.context.TargetException;
 import org.apache.tuscany.spi.context.WorkContext;
@@ -22,7 +22,7 @@
  */
 public class RequestScopeContext extends AbstractScopeContext {
 
-    private final Map<AtomicContext, Map<Thread, InstanceWrapper>> contexts;
+    private final Map<AtomicComponent, Map<Thread, InstanceWrapper>> contexts;
     private final Map<Thread, List<InstanceWrapper>> destroyQueues;
 
     public RequestScopeContext(){
@@ -31,7 +31,7 @@
 
     public RequestScopeContext(WorkContext workContext) {
         super("Request Scope", workContext);
-        contexts = new ConcurrentHashMap<AtomicContext, Map<Thread, InstanceWrapper>>();
+        contexts = new ConcurrentHashMap<AtomicComponent, Map<Thread, InstanceWrapper>>();
         destroyQueues = new ConcurrentHashMap<Thread, List<InstanceWrapper>>();
     }
 
@@ -42,7 +42,7 @@
     public void onEvent(Event event) {
         checkInit();
         if (event instanceof RequestStart) {
-            for (Map.Entry<AtomicContext, Map<Thread, InstanceWrapper>> entry : contexts.entrySet()) {
+            for (Map.Entry<AtomicComponent, Map<Thread, InstanceWrapper>> entry : contexts.entrySet()) {
                 if (entry.getKey().isEagerInit()) {
                     getInstance(entry.getKey());
                 }
@@ -67,16 +67,16 @@
         lifecycleState = STOPPED;
     }
 
-    public void register(AtomicContext context) {
-        contexts.put(context, new ConcurrentHashMap<Thread, InstanceWrapper>());
+    public void register(AtomicComponent component) {
+        contexts.put(component, new ConcurrentHashMap<Thread, InstanceWrapper>());
     }
 
-    public InstanceWrapper getInstanceContext(AtomicContext context) throws TargetException {
-        Map<Thread, InstanceWrapper> instanceContextMap = contexts.get(context);
-        assert(instanceContextMap != null):"Atomic context not registered";
+    public InstanceWrapper getInstanceContext(AtomicComponent component) throws TargetException {
+        Map<Thread, InstanceWrapper> instanceContextMap = contexts.get(component);
+        assert(instanceContextMap != null):"Atomic component not registered";
         InstanceWrapper ctx = instanceContextMap.get(Thread.currentThread());
         if (ctx == null) {
-            ctx = context.createInstance();
+            ctx = component.createInstance();
             instanceContextMap.put(Thread.currentThread(), ctx);
             List<InstanceWrapper> destroyQueue = destroyQueues.get(Thread.currentThread());
             if (destroyQueue == null) {

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/StatelessScopeContext.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/StatelessScopeContext.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/StatelessScopeContext.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/scope/StatelessScopeContext.java Fri Jun  2 19:25:01 2006
@@ -14,7 +14,7 @@
 package org.apache.tuscany.core.context.scope;
 
 import org.apache.tuscany.spi.model.Scope;
-import org.apache.tuscany.spi.context.AtomicContext;
+import org.apache.tuscany.spi.context.AtomicComponent;
 import org.apache.tuscany.spi.context.InstanceWrapper;
 import org.apache.tuscany.spi.context.TargetException;
 import org.apache.tuscany.spi.context.WorkContext;
@@ -57,12 +57,12 @@
     public void onEvent(Event event) {
     }
 
-    public void register(AtomicContext context) {
+    public void register(AtomicComponent component) {
         checkInit();
     }
 
-    public InstanceWrapper getInstanceContext(AtomicContext context) throws TargetException {
-        return context.createInstance();
+    public InstanceWrapper getInstanceContext(AtomicComponent component) throws TargetException {
+        return component.createInstance();
     }
 
 }

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java Fri Jun  2 19:25:01 2006
@@ -19,16 +19,15 @@
 import org.apache.tuscany.core.context.scope.ModuleScopeContext;
 import org.apache.tuscany.core.builder.Connector;
 import org.apache.tuscany.spi.annotation.Autowire;
-import org.apache.tuscany.spi.builder.BuilderRegistry;
 import org.apache.tuscany.spi.builder.Builder;
-import org.apache.tuscany.spi.context.CompositeContext;
-import org.apache.tuscany.spi.context.Context;
+import org.apache.tuscany.spi.context.CompositeComponent;
+import org.apache.tuscany.spi.context.SCAObject;
 import org.apache.tuscany.spi.context.ScopeContext;
 import org.apache.tuscany.spi.deployer.Deployer;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
 import org.apache.tuscany.spi.loader.LoaderException;
 import org.apache.tuscany.spi.loader.Loader;
-import org.apache.tuscany.spi.model.Component;
+import org.apache.tuscany.spi.model.ComponentDefinition;
 import org.apache.tuscany.spi.model.Implementation;
 
 /**
@@ -56,37 +55,37 @@
         this.connector = connector;
     }
 
-    public <I extends Implementation<?>> Context<?> deploy(CompositeContext<?> parent, Component<I> component) throws LoaderException {
+    public <I extends Implementation<?>> SCAObject<?> deploy(CompositeComponent<?> parent, ComponentDefinition<I> componentDefinition) throws LoaderException {
         ScopeContext moduleScope = new ModuleScopeContext();
         DeploymentContext deploymentContext = new DeploymentContext(null, null, moduleScope);
-        load(component, deploymentContext);
-        Context<?> context = build(parent, component, deploymentContext);
+        load(componentDefinition, deploymentContext);
+        SCAObject<?> context = build(parent, componentDefinition, deploymentContext);
         connect(context);
-        parent.registerContext(context);
+        parent.register(context);
         return context;
     }
 
     /**
-     * Load the component type information for the component being deployed.
+     * Load the componentDefinition type information for the componentDefinition being deployed.
      * For a typical deployment this will result in the SCDL definition being loaded.
      *
-     * @param component         the component being deployed
+     * @param componentDefinition         the componentDefinition being deployed
      * @param deploymentContext the current deployment context
      */
-    protected <I extends Implementation<?>> void load(Component<I> component, DeploymentContext deploymentContext) throws LoaderException {
-        loader.loadComponentType(component.getImplementation(), deploymentContext);
+    protected <I extends Implementation<?>> void load(ComponentDefinition<I> componentDefinition, DeploymentContext deploymentContext) throws LoaderException {
+        loader.loadComponentType(componentDefinition.getImplementation(), deploymentContext);
     }
 
     /**
-     * Build the runtime context for a loaded component.
+     * Build the runtime context for a loaded componentDefinition.
      *
      * @param parent            the context that will be the parent of the new sub-context
-     * @param component         the component being deployed
+     * @param componentDefinition         the componentDefinition being deployed
      * @param deploymentContext the current deployment context
      * @return the new runtime context
      */
-    protected <I extends Implementation<?>> Context<?> build(CompositeContext<?> parent, Component<I> component, DeploymentContext deploymentContext) {
-        return builder.build(parent, component, deploymentContext);
+    protected <I extends Implementation<?>> SCAObject<?> build(CompositeComponent<?> parent, ComponentDefinition<I> componentDefinition, DeploymentContext deploymentContext) {
+        return builder.build(parent, componentDefinition, deploymentContext);
     }
 
     /**
@@ -94,7 +93,7 @@
      *
      * @param context the context to connect
      */
-    protected void connect(Context<?> context) {
+    protected void connect(SCAObject<?> context) {
         connector.connect(context);
     }
 }

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/loader/ComponentLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/loader/ComponentLoader.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/loader/ComponentLoader.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/loader/ComponentLoader.java Fri Jun  2 19:25:01 2006
@@ -34,7 +34,7 @@
 import org.apache.tuscany.spi.loader.MissingImplementationException;
 import org.apache.tuscany.spi.loader.StAXPropertyFactory;
 import org.apache.tuscany.spi.loader.UndefinedPropertyException;
-import org.apache.tuscany.spi.model.Component;
+import org.apache.tuscany.spi.model.ComponentDefinition;
 import org.apache.tuscany.spi.model.ComponentType;
 import org.apache.tuscany.spi.model.Implementation;
 import org.apache.tuscany.spi.model.ModelObject;
@@ -45,7 +45,7 @@
 /**
  * @version $Rev$ $Date$
  */
-public class ComponentLoader extends LoaderExtension<Component<?>> {
+public class ComponentLoader extends LoaderExtension<ComponentDefinition<?>> {
     private StAXPropertyFactory defaultPropertyFactory;
 
     public ComponentLoader() {
@@ -65,7 +65,7 @@
         return AssemblyConstants.COMPONENT;
     }
 
-    public Component<?> load(XMLStreamReader reader, DeploymentContext deploymentContext) throws XMLStreamException, LoaderException {
+    public ComponentDefinition<?> load(XMLStreamReader reader, DeploymentContext deploymentContext) throws XMLStreamException, LoaderException {
         assert AssemblyConstants.COMPONENT.equals(reader.getName());
         String name = reader.getAttributeValue(null, "name");
         reader.nextTag();
@@ -76,8 +76,8 @@
             throw e;
         }
         Implementation<?> impl = (Implementation<?>) o;
-        Component<?> component = new Component<Implementation<?>>(impl);
-        component.setName(name);
+        ComponentDefinition<?> componentDefinition = new ComponentDefinition<Implementation<?>>(impl);
+        componentDefinition.setName(name);
         registry.loadComponentType(impl, deploymentContext);
 
         try {
@@ -86,25 +86,25 @@
                     case START_ELEMENT:
                         QName qname = reader.getName();
                         if (AssemblyConstants.PROPERTY.equals(qname)) {
-                            loadProperty(reader, deploymentContext, component);
+                            loadProperty(reader, deploymentContext, componentDefinition);
                         } else if (AssemblyConstants.REFERENCE.equals(qname)) {
-                            loadReference(reader, deploymentContext, component);
+                            loadReference(reader, deploymentContext, componentDefinition);
                         }
                         reader.next();
                         break;
                     case END_ELEMENT:
-                        return component;
+                        return componentDefinition;
                 }
             }
         } catch (LoaderException e) {
-            e.addContextName(component.getName());
+            e.addContextName(componentDefinition.getName());
             throw e;
         }
     }
 
-    protected void loadProperty(XMLStreamReader reader, DeploymentContext deploymentContext, Component<?> component) throws XMLStreamException, LoaderException {
+    protected void loadProperty(XMLStreamReader reader, DeploymentContext deploymentContext, ComponentDefinition<?> componentDefinition) throws XMLStreamException, LoaderException {
         String name = reader.getAttributeValue(null, "name");
-        Implementation<?> implementation = component.getImplementation();
+        Implementation<?> implementation = componentDefinition.getImplementation();
         ComponentType<?,?,?> componentType = implementation.getComponentType();
         Property<?> property = componentType.getProperties().get(name);
         if (property == null) {
@@ -112,7 +112,7 @@
             e.setIdentifier(name);
             throw e;
         }
-        component.add(createPropertyValue(reader, property, name));
+        componentDefinition.add(createPropertyValue(reader, property, name));
     }
 
     private <T> PropertyValue<T> createPropertyValue(XMLStreamReader reader, Property<T> property, String name) throws XMLStreamException, LoaderException {
@@ -121,7 +121,7 @@
         return new PropertyValue<T>(name, factory);
     }
 
-    protected void loadReference(XMLStreamReader reader, DeploymentContext deploymentContext, Component<?> component) throws XMLStreamException, LoaderException {
+    protected void loadReference(XMLStreamReader reader, DeploymentContext deploymentContext, ComponentDefinition<?> componentDefinition) throws XMLStreamException, LoaderException {
         String name = reader.getAttributeValue(null, "name");
         String target = reader.getAttributeValue(null, "target");
         ReferenceTarget referenceTarget = new ReferenceTarget();
@@ -133,7 +133,7 @@
             le.setIdentifier(target);
             throw le;
         }
-        component.add(referenceTarget);
+        componentDefinition.add(referenceTarget);
     }
 
 /*

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/loader/ComponentTypeElementLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/loader/ComponentTypeElementLoader.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/loader/ComponentTypeElementLoader.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/loader/ComponentTypeElementLoader.java Fri Jun  2 19:25:01 2006
@@ -25,8 +25,8 @@
 import org.apache.tuscany.spi.model.ComponentType;
 import org.apache.tuscany.spi.model.ModelObject;
 import org.apache.tuscany.spi.model.Property;
-import org.apache.tuscany.spi.model.Reference;
-import org.apache.tuscany.spi.model.Service;
+import org.apache.tuscany.spi.model.ReferenceDefinition;
+import org.apache.tuscany.spi.model.ServiceDefinition;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
 import org.apache.tuscany.spi.loader.LoaderException;
 import org.apache.tuscany.spi.loader.LoaderRegistry;
@@ -49,16 +49,16 @@
 
     public ComponentType load(XMLStreamReader reader, DeploymentContext deploymentContext) throws XMLStreamException, LoaderException {
         assert AssemblyConstants.COMPONENT_TYPE.equals(reader.getName());
-        ComponentType<Service,Reference,Property<?>> componentType = new ComponentType<Service, Reference, Property<?>>();
+        ComponentType<ServiceDefinition,ReferenceDefinition,Property<?>> componentType = new ComponentType<ServiceDefinition, ReferenceDefinition, Property<?>>();
 
         while (true) {
             switch (reader.next()) {
                 case START_ELEMENT:
                     ModelObject o = registry.load(reader, deploymentContext);
-                    if (o instanceof Service) {
-                        componentType.add((Service) o);
-                    } else if (o instanceof Reference) {
-                        componentType.add((Reference) o);
+                    if (o instanceof ServiceDefinition) {
+                        componentType.add((ServiceDefinition) o);
+                    } else if (o instanceof ReferenceDefinition) {
+                        componentType.add((ReferenceDefinition) o);
                     } else if (o instanceof Property) {
                         componentType.add((Property<?>) o);
                     }

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/loader/ReferenceLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/loader/ReferenceLoader.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/loader/ReferenceLoader.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/loader/ReferenceLoader.java Fri Jun  2 19:25:01 2006
@@ -24,7 +24,7 @@
 
 import org.apache.tuscany.spi.model.ModelObject;
 import org.apache.tuscany.spi.model.Multiplicity;
-import org.apache.tuscany.spi.model.Reference;
+import org.apache.tuscany.spi.model.ReferenceDefinition;
 import org.apache.tuscany.spi.model.ServiceContract;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
 import org.apache.tuscany.spi.loader.LoaderException;
@@ -34,7 +34,7 @@
 /**
  * @version $Rev$ $Date$
  */
-public class ReferenceLoader extends LoaderExtension<Reference> {
+public class ReferenceLoader extends LoaderExtension<ReferenceDefinition> {
     public ReferenceLoader() {
     }
 
@@ -46,23 +46,23 @@
         return AssemblyConstants.REFERENCE;
     }
 
-    public Reference load(XMLStreamReader reader, DeploymentContext deploymentContext) throws XMLStreamException, LoaderException {
+    public ReferenceDefinition load(XMLStreamReader reader, DeploymentContext deploymentContext) throws XMLStreamException, LoaderException {
         assert AssemblyConstants.REFERENCE.equals(reader.getName());
-        Reference reference = new Reference();
-        reference.setName(reader.getAttributeValue(null, "name"));
-        reference.setMultiplicity(StAXUtil.multiplicity(reader.getAttributeValue(null, "multiplicity"), Multiplicity.ONE_ONE));
+        ReferenceDefinition referenceDefinition = new ReferenceDefinition();
+        referenceDefinition.setName(reader.getAttributeValue(null, "name"));
+        referenceDefinition.setMultiplicity(StAXUtil.multiplicity(reader.getAttributeValue(null, "multiplicity"), Multiplicity.ONE_ONE));
 
         while (true) {
             switch (reader.next()) {
                 case START_ELEMENT:
                     ModelObject o = registry.load(reader, deploymentContext);
                     if (o instanceof ServiceContract) {
-                        reference.setServiceContract((ServiceContract) o);
+                        referenceDefinition.setServiceContract((ServiceContract) o);
                     }
                     reader.next();
                     break;
                 case END_ELEMENT:
-                    return reference;
+                    return referenceDefinition;
             }
         }
     }

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/loader/ServiceLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/loader/ServiceLoader.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/loader/ServiceLoader.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/loader/ServiceLoader.java Fri Jun  2 19:25:01 2006
@@ -23,10 +23,10 @@
 import javax.xml.stream.XMLStreamReader;
 
 import org.apache.tuscany.spi.model.ModelObject;
-import org.apache.tuscany.spi.model.Service;
+import org.apache.tuscany.spi.model.ServiceDefinition;
 import org.apache.tuscany.spi.model.ServiceContract;
 import org.apache.tuscany.spi.model.Binding;
-import org.apache.tuscany.spi.model.BoundService;
+import org.apache.tuscany.spi.model.BoundServiceDefinition;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
 import org.apache.tuscany.spi.loader.LoaderException;
 import org.apache.tuscany.spi.loader.LoaderRegistry;
@@ -35,7 +35,7 @@
 /**
  * @version $Rev$ $Date$
  */
-public class ServiceLoader extends LoaderExtension<Service> {
+public class ServiceLoader extends LoaderExtension<ServiceDefinition> {
     public ServiceLoader() {
     }
 
@@ -47,7 +47,7 @@
         return AssemblyConstants.SERVICE;
     }
 
-    public Service load(XMLStreamReader reader, DeploymentContext deploymentContext) throws XMLStreamException, LoaderException {
+    public ServiceDefinition load(XMLStreamReader reader, DeploymentContext deploymentContext) throws XMLStreamException, LoaderException {
         assert AssemblyConstants.SERVICE.equals(reader.getName());
         String name = reader.getAttributeValue(null, "name");
         Binding binding = null;
@@ -65,9 +65,9 @@
                     break;
                 case END_ELEMENT:
                     if (binding != null) {
-                        return new BoundService<Binding>(name, serviceContract, binding, null);
+                        return new BoundServiceDefinition<Binding>(name, serviceContract, binding, null);
                     } else {
-                        return new Service(name, serviceContract);
+                        return new ServiceDefinition(name, serviceContract);
                     }
             }
         }

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/model/PojoComponentType.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/model/PojoComponentType.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/model/PojoComponentType.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/model/PojoComponentType.java Fri Jun  2 19:25:01 2006
@@ -10,14 +10,14 @@
 import org.apache.tuscany.core.injection.Injector;
 import org.apache.tuscany.spi.model.ComponentType;
 import org.apache.tuscany.spi.model.Scope;
-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;
 
 /**
  * @version $$Rev$$ $$Date$$
  */
-public class PojoComponentType<S extends Service, R extends Reference, P extends Property<?>> extends ComponentType<S,R,P> {
+public class PojoComponentType<S extends ServiceDefinition, R extends ReferenceDefinition, P extends Property<?>> extends ComponentType<S,R,P> {
 
     private Scope lifecycleScope = Scope.UNDEFINED;
     private EventInvoker<Object> initInvoker;

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/policy/PolicyBuilderRegistryImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/policy/PolicyBuilderRegistryImpl.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/policy/PolicyBuilderRegistryImpl.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/policy/PolicyBuilderRegistryImpl.java Fri Jun  2 19:25:01 2006
@@ -3,8 +3,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.tuscany.spi.model.Reference;
-import org.apache.tuscany.spi.model.Service;
+import org.apache.tuscany.spi.model.ReferenceDefinition;
+import org.apache.tuscany.spi.model.ServiceDefinition;
 import org.apache.tuscany.spi.builder.BuilderException;
 import org.apache.tuscany.spi.policy.PolicyBuilderRegistry;
 import org.apache.tuscany.spi.policy.SourcePolicyBuilder;
@@ -40,18 +40,18 @@
     }
 
 
-    public void buildSource(Reference reference, OutboundWire wire) throws BuilderException {
+    public void buildSource(ReferenceDefinition referenceDefinition, OutboundWire wire) throws BuilderException {
         for (List<SourcePolicyBuilder> builders : sourceBuilders) {
             for (SourcePolicyBuilder builder : builders) {
-                builder.build(reference,wire);
+                builder.build(referenceDefinition,wire);
             }
         }
     }
 
-    public void buildTarget(Service service, InboundWire wire) throws BuilderException {
+    public void buildTarget(ServiceDefinition serviceDefinition, InboundWire wire) throws BuilderException {
         for (List<TargetPolicyBuilder> builders : targetBuilders) {
             for (TargetPolicyBuilder builder : builders) {
-                builder.build(service,wire);
+                builder.build(serviceDefinition,wire);
             }
         }
     }

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/policy/async/AsyncPolicyBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/policy/async/AsyncPolicyBuilder.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/policy/async/AsyncPolicyBuilder.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/policy/async/AsyncPolicyBuilder.java Fri Jun  2 19:25:01 2006
@@ -3,7 +3,7 @@
 import javax.resource.spi.work.WorkManager;
 
 import org.apache.tuscany.core.monitor.NullMonitorFactory;
-import org.apache.tuscany.spi.model.Service;
+import org.apache.tuscany.spi.model.ServiceDefinition;
 import org.apache.tuscany.spi.annotation.Autowire;
 import org.apache.tuscany.spi.builder.BuilderException;
 import org.apache.tuscany.spi.policy.PolicyBuilderRegistry;
@@ -50,7 +50,7 @@
         this.workManager = workManager;
     }
 
-    public void build(Service service, InboundWire<?> wire) throws BuilderException {
+    public void build(ServiceDefinition serviceDefinition, InboundWire<?> wire) throws BuilderException {
         for (InboundInvocationChain chain : wire.getInvocationChains().values()) {
             // TODO fix this - it should be represented by the model and not through an annotation
             if (chain.getMethod().getAnnotation(OneWay.class) != null) {

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/system/builder/SystemBindingBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/system/builder/SystemBindingBuilder.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/system/builder/SystemBindingBuilder.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/system/builder/SystemBindingBuilder.java Fri Jun  2 19:25:01 2006
@@ -1,9 +1,9 @@
 package org.apache.tuscany.core.system.builder;
 
-import org.apache.tuscany.core.context.AutowireContext;
-import org.apache.tuscany.core.system.context.SystemReferenceContextImpl;
-import org.apache.tuscany.core.system.context.SystemServiceContext;
-import org.apache.tuscany.core.system.context.SystemServiceContextImpl;
+import org.apache.tuscany.core.context.AutowireComponent;
+import org.apache.tuscany.core.system.context.SystemReferenceImpl;
+import org.apache.tuscany.core.system.context.SystemService;
+import org.apache.tuscany.core.system.context.SystemServiceImpl;
 import org.apache.tuscany.core.system.model.SystemBinding;
 import org.apache.tuscany.core.system.wire.SystemInboundWireImpl;
 import org.apache.tuscany.core.system.wire.SystemOutboundAutowire;
@@ -12,12 +12,12 @@
 import org.apache.tuscany.core.system.wire.SystemOutboundWire;
 import org.apache.tuscany.spi.QualifiedName;
 import org.apache.tuscany.spi.builder.BindingBuilder;
-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.model.BoundReference;
-import org.apache.tuscany.spi.model.BoundService;
+import org.apache.tuscany.spi.model.BoundReferenceDefinition;
+import org.apache.tuscany.spi.model.BoundServiceDefinition;
 import org.apache.tuscany.spi.wire.OutboundWire;
 
 /**
@@ -25,25 +25,25 @@
  */
 public class SystemBindingBuilder implements BindingBuilder<SystemBinding> {
 
-    public Context build(CompositeContext parent, BoundService<SystemBinding> boundService, DeploymentContext deploymentContext) {
-        Class<?> interfaze = boundService.getServiceContract().getInterfaceClass();
-        QualifiedName targetName = new QualifiedName(boundService.getTarget().getPath());
-        ComponentContext target = (ComponentContext) parent.getContext(targetName.getPartName());
-        SystemInboundWire<?> inboundWire = new SystemInboundWireImpl(boundService.getName(), interfaze, target);
-        SystemOutboundWire<?> outboundWire = new SystemOutboundWireImpl(boundService.getName(), targetName, interfaze);
-        SystemServiceContext context = new SystemServiceContextImpl(boundService.getName(), parent);
+    public SCAObject build(CompositeComponent parent, BoundServiceDefinition<SystemBinding> boundServiceDefinition, DeploymentContext deploymentContext) {
+        Class<?> interfaze = boundServiceDefinition.getServiceContract().getInterfaceClass();
+        QualifiedName targetName = new QualifiedName(boundServiceDefinition.getTarget().getPath());
+        Component target = (Component) parent.getChild(targetName.getPartName());
+        SystemInboundWire<?> inboundWire = new SystemInboundWireImpl(boundServiceDefinition.getName(), interfaze, target);
+        SystemOutboundWire<?> outboundWire = new SystemOutboundWireImpl(boundServiceDefinition.getName(), targetName, interfaze);
+        SystemService context = new SystemServiceImpl(boundServiceDefinition.getName(), parent);
         context.setInboundWire(inboundWire);
         context.setOutboundWire(outboundWire);
         return context;
     }
 
-    public Context build(CompositeContext parent, BoundReference<SystemBinding> boundReference, DeploymentContext deploymentContext) {
-        assert(parent.getParent() instanceof AutowireContext):"Grandparent not an instance of " + AutowireContext.class.getName();
-        AutowireContext autowireContext = (AutowireContext) parent.getParent();
-        Class<?> interfaze = boundReference.getServiceContract().getInterfaceClass();
-        SystemReferenceContextImpl ctx = new SystemReferenceContextImpl(boundReference.getName(), interfaze, parent);
-        SystemInboundWire<?> inboundWire = new SystemInboundWireImpl(boundReference.getName(), interfaze);
-        OutboundWire<?> outboundWire = new SystemOutboundAutowire(boundReference.getName(), interfaze, autowireContext);
+    public SCAObject build(CompositeComponent parent, BoundReferenceDefinition<SystemBinding> boundReferenceDefinition, DeploymentContext deploymentContext) {
+        assert(parent.getParent() instanceof AutowireComponent):"Grandparent not an instance of " + AutowireComponent.class.getName();
+        AutowireComponent autowireContext = (AutowireComponent) parent.getParent();
+        Class<?> interfaze = boundReferenceDefinition.getServiceContract().getInterfaceClass();
+        SystemReferenceImpl ctx = new SystemReferenceImpl(boundReferenceDefinition.getName(), interfaze, parent);
+        SystemInboundWire<?> inboundWire = new SystemInboundWireImpl(boundReferenceDefinition.getName(), interfaze);
+        OutboundWire<?> outboundWire = new SystemOutboundAutowire(boundReferenceDefinition.getName(), interfaze, autowireContext);
         ctx.setInboundWire(inboundWire);
         ctx.setOutboundWire(outboundWire);
         return ctx;

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/system/builder/SystemComponentBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/system/builder/SystemComponentBuilder.java?rev=411356&r1=411355&r2=411356&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/system/builder/SystemComponentBuilder.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/system/builder/SystemComponentBuilder.java Fri Jun  2 19:25:01 2006
@@ -6,13 +6,13 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.tuscany.core.context.AutowireContext;
+import org.apache.tuscany.core.context.AutowireComponent;
 import org.apache.tuscany.core.injection.ContextInjector;
 import org.apache.tuscany.core.injection.Injector;
 import org.apache.tuscany.core.injection.PojoObjectFactory;
 import org.apache.tuscany.core.model.PojoComponentType;
-import org.apache.tuscany.core.system.context.SystemAtomicContext;
-import org.apache.tuscany.core.system.context.SystemAtomicContextImpl;
+import org.apache.tuscany.core.system.context.SystemAtomicComponent;
+import org.apache.tuscany.core.system.context.SystemAtomicComponentImpl;
 import org.apache.tuscany.core.system.model.SystemImplementation;
 import org.apache.tuscany.core.system.wire.SystemInboundWireImpl;
 import org.apache.tuscany.core.system.wire.SystemOutboundAutowire;
@@ -23,13 +23,13 @@
 import org.apache.tuscany.spi.QualifiedName;
 import org.apache.tuscany.spi.builder.BuilderConfigException;
 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.Component;
+import org.apache.tuscany.spi.context.CompositeComponent;
 import org.apache.tuscany.spi.context.ScopeContext;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
-import org.apache.tuscany.spi.model.Component;
+import org.apache.tuscany.spi.model.ComponentDefinition;
 import org.apache.tuscany.spi.model.ReferenceTarget;
-import org.apache.tuscany.spi.model.Service;
+import org.apache.tuscany.spi.model.ServiceDefinition;
 import org.apache.tuscany.spi.wire.OutboundWire;
 
 /**
@@ -37,20 +37,20 @@
  */
 public class SystemComponentBuilder implements ComponentBuilder<SystemImplementation> {
 
-    public ComponentContext<?> build(CompositeContext<?> parent, Component<SystemImplementation> component, DeploymentContext deploymentContext) throws BuilderConfigException {
-        assert(parent instanceof AutowireContext): "Parent must implement " + AutowireContext.class.getName();
-        AutowireContext autowireContext = (AutowireContext) parent;
-        PojoComponentType<?,?,?> componentType = component.getImplementation().getComponentType();
+    public Component<?> build(CompositeComponent<?> parent, ComponentDefinition<SystemImplementation> componentDefinition, DeploymentContext deploymentContext) throws BuilderConfigException {
+        assert(parent instanceof AutowireComponent): "Parent must implement " + AutowireComponent.class.getName();
+        AutowireComponent autowireContext = (AutowireComponent) parent;
+        PojoComponentType<?,?,?> componentType = componentDefinition.getImplementation().getComponentType();
         List<Class<?>> serviceInterfaces = new ArrayList<Class<?>>();
-        for (Service service : componentType.getServices().values()) {
-            serviceInterfaces.add(service.getServiceContract().getInterfaceClass());
+        for (ServiceDefinition serviceDefinition : componentType.getServices().values()) {
+            serviceInterfaces.add(serviceDefinition.getServiceContract().getInterfaceClass());
         }
         Constructor<?> constr;
         try {
-            constr = JavaIntrospectionHelper.getDefaultConstructor(component.getImplementation().getImplementationClass());
+            constr = JavaIntrospectionHelper.getDefaultConstructor(componentDefinition.getImplementation().getImplementationClass());
         } catch (NoSuchMethodException e) {
-            BuilderConfigException bce = new BuilderConfigException("Error building component", e);
-            bce.setIdentifier(component.getName());
+            BuilderConfigException bce = new BuilderConfigException("Error building componentDefinition", e);
+            bce.setIdentifier(componentDefinition.getName());
             bce.addContextName(parent.getName());
             throw bce;
         }
@@ -65,15 +65,15 @@
                 if (contextType.isAssignableFrom(parent.getClass())) {
                     ((ContextInjector) injector).setContext(parent);
                 } else {
-                    BuilderConfigException e = new BuilderConfigException("Context not found for type");
+                    BuilderConfigException e = new BuilderConfigException("SCAObject not found for type");
                     e.setIdentifier(contextType.getName());
                     throw e;
                 }
             }
         }
         ScopeContext scopeContext = deploymentContext.getModuleScope();
-        SystemAtomicContext systemContext =
-                new SystemAtomicContextImpl(component.getName(),
+        SystemAtomicComponent systemContext =
+                new SystemAtomicComponentImpl(componentDefinition.getName(),
                         parent,
                         scopeContext,
                         serviceInterfaces,
@@ -84,19 +84,19 @@
                         injectors,
                         members);
 
-        for (Service service : componentType.getServices().values()) {
-            Class interfaze = service.getServiceContract().getInterfaceClass();
-            SystemInboundWire<?> wire = new SystemInboundWireImpl(service.getName(), interfaze, systemContext);
+        for (ServiceDefinition serviceDefinition : componentType.getServices().values()) {
+            Class interfaze = serviceDefinition.getServiceContract().getInterfaceClass();
+            SystemInboundWire<?> wire = new SystemInboundWireImpl(serviceDefinition.getName(), interfaze, systemContext);
             systemContext.addInboundWire(wire);
         }
-        for (ReferenceTarget target : component.getReferenceTargets().values()) {
+        for (ReferenceTarget target : componentDefinition.getReferenceTargets().values()) {
             String referenceName = target.getReferenceName();
             Class interfaze = target.getReference().getServiceContract().getInterfaceClass();
             Member member = componentType.getReferenceMember(referenceName);
             if (member == null) {
-                BuilderConfigException e = new BuilderConfigException("Reference not found");
+                BuilderConfigException e = new BuilderConfigException("ReferenceDefinition not found");
                 e.setIdentifier(target.getReferenceName());
-                e.addContextName(component.getName());
+                e.addContextName(componentDefinition.getName());
                 e.addContextName(parent.getName());
                 throw e;
             }



---------------------------------------------------------------------
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