tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: r411009 - in /incubator/tuscany/sandbox/jboynes/sca: containers/container.groovy/src/main/java/org/apache/tuscany/container/groovy/ containers/container.java/src/main/java/org/apache/tuscany/container/java/ core2/src/main/java/org/apache/tu...
Date Fri, 02 Jun 2006 00:40:16 GMT
Author: jboynes
Date: Thu Jun  1 17:40:15 2006
New Revision: 411009

URL: http://svn.apache.org/viewvc?rev=411009&view=rev
Log:
Add SPI JavaDoc
Extract service interfaces for Loader and Builder

Added:
    incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/builder/Builder.java   (with props)
    incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/Loader.java   (with props)
Modified:
    incubator/tuscany/sandbox/jboynes/sca/containers/container.groovy/src/main/java/org/apache/tuscany/container/groovy/GroovyComponentBuilder.java
    incubator/tuscany/sandbox/jboynes/sca/containers/container.groovy/src/main/java/org/apache/tuscany/container/groovy/GroovyInstanceWrapper.java
    incubator/tuscany/sandbox/jboynes/sca/containers/container.java/src/main/java/org/apache/tuscany/container/java/JavaComponentBuilder.java
    incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/bootstrap/DefaultBootstrapper.java
    incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/builder/BuilderRegistryImpl.java
    incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/composite/builder/CompositeBuilder.java
    incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/context/AbstractCompositeContext.java
    incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/deployer/DeployerImpl.java
    incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/loader/ComponentTypeElementLoader.java
    incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/system/builder/SystemComponentBuilder.java
    incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/system/builder/SystemCompositeBuilder.java
    incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryTestCase.java
    incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/AbstractLifecycle.java
    incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/Lifecycle.java
    incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/builder/BuilderRegistry.java
    incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/builder/ComponentBuilder.java
    incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/deployer/Deployer.java
    incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/extension/ComponentBuilderExtension.java
    incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/extension/LoaderExtension.java
    incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/ComponentTypeLoader.java
    incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/LoaderRegistry.java
    incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/StAXElementLoader.java
    incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/StAXPropertyFactory.java

Modified: incubator/tuscany/sandbox/jboynes/sca/containers/container.groovy/src/main/java/org/apache/tuscany/container/groovy/GroovyComponentBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/containers/container.groovy/src/main/java/org/apache/tuscany/container/groovy/GroovyComponentBuilder.java?rev=411009&r1=411008&r2=411009&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/containers/container.groovy/src/main/java/org/apache/tuscany/container/groovy/GroovyComponentBuilder.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/containers/container.groovy/src/main/java/org/apache/tuscany/container/groovy/GroovyComponentBuilder.java Thu Jun  1 17:40:15 2006
@@ -24,7 +24,7 @@
         return GroovyImplementation.class;
     }
 
-    public ComponentContext build(CompositeContext parent, Component<GroovyImplementation> component, DeploymentContext deploymentContext) throws BuilderConfigException {
+    public ComponentContext<?> build(CompositeContext<?> parent, Component<GroovyImplementation> component, DeploymentContext deploymentContext) throws BuilderConfigException {
         List<Class<?>> services = new ArrayList<Class<?>>();
         Collection<Service> collection = component.getImplementation().getComponentType().getServices().values();
         for (Service service : collection) {

Modified: incubator/tuscany/sandbox/jboynes/sca/containers/container.groovy/src/main/java/org/apache/tuscany/container/groovy/GroovyInstanceWrapper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/containers/container.groovy/src/main/java/org/apache/tuscany/container/groovy/GroovyInstanceWrapper.java?rev=411009&r1=411008&r2=411009&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/containers/container.groovy/src/main/java/org/apache/tuscany/container/groovy/GroovyInstanceWrapper.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/containers/container.groovy/src/main/java/org/apache/tuscany/container/groovy/GroovyInstanceWrapper.java Thu Jun  1 17:40:15 2006
@@ -34,7 +34,7 @@
     public void start() throws CoreRuntimeException {
         try {
             context.init(groovyObject);
-            lifecycleState = STARTED;
+            lifecycleState = RUNNING;
         } catch (ObjectCreationException e) {
             lifecycleState = ERROR;
             throw e;

Modified: incubator/tuscany/sandbox/jboynes/sca/containers/container.java/src/main/java/org/apache/tuscany/container/java/JavaComponentBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/containers/container.java/src/main/java/org/apache/tuscany/container/java/JavaComponentBuilder.java?rev=411009&r1=411008&r2=411009&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/containers/container.java/src/main/java/org/apache/tuscany/container/java/JavaComponentBuilder.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/containers/container.java/src/main/java/org/apache/tuscany/container/java/JavaComponentBuilder.java Thu Jun  1 17:40:15 2006
@@ -13,6 +13,7 @@
 import org.apache.tuscany.spi.builder.BuilderConfigException;
 import org.apache.tuscany.spi.context.CompositeContext;
 import org.apache.tuscany.spi.context.ScopeContext;
+import org.apache.tuscany.spi.context.ComponentContext;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
 import org.apache.tuscany.spi.extension.ComponentBuilderExtension;
 import org.apache.tuscany.spi.model.Component;
@@ -24,7 +25,7 @@
  */
 public class JavaComponentBuilder extends ComponentBuilderExtension<JavaImplementation> {
 
-    public JavaAtomicContext build(CompositeContext parent, Component<JavaImplementation> component, DeploymentContext deploymentContext)
+    public ComponentContext<?> build(CompositeContext<?> parent, Component<JavaImplementation> component, DeploymentContext deploymentContext)
             throws BuilderConfigException {
         PojoComponentType<?, ?, ?> componentType = component.getImplementation().getComponentType();
 

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/bootstrap/DefaultBootstrapper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/bootstrap/DefaultBootstrapper.java?rev=411009&r1=411008&r2=411009&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/bootstrap/DefaultBootstrapper.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/bootstrap/DefaultBootstrapper.java Thu Jun  1 17:40:15 2006
@@ -71,8 +71,8 @@
 
     public Deployer createDeployer() {
         DeployerImpl deployer = new DeployerImpl();
-        deployer.setBuilderRegistry(builderRegistry);
-        deployer.setLoaderRegistry(loaderRegistry);
+        deployer.setBuilder(builderRegistry);
+        deployer.setLoader(loaderRegistry);
         deployer.setConnector(connector);
         return deployer;
     }

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=411009&r1=411008&r2=411009&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 Thu Jun  1 17:40:15 2006
@@ -75,8 +75,12 @@
         componentBuilders.put(implClass, builder);
     }
 
+    public <I extends Implementation<?>> void unregister(Class<I> implClass) {
+        componentBuilders.remove(implClass);
+    }
+
     @SuppressWarnings("unchecked")
-    public <I extends Implementation<?>> Context build(CompositeContext parent, Component<I> component, DeploymentContext deploymentContext) {
+    public <I extends Implementation<?>> ComponentContext<?> build(CompositeContext<?> parent, Component<I> component, DeploymentContext deploymentContext) {
         Class<I> implClass = (Class<I>) component.getImplementation().getClass();
         ComponentBuilder<I> componentBuilder = (ComponentBuilder<I>) componentBuilders.get(implClass);
         if (componentBuilder == null) {
@@ -86,7 +90,7 @@
             throw e;
         }
 
-        ComponentContext context = componentBuilder.build(parent, component, deploymentContext);
+        ComponentContext<?> context = componentBuilder.build(parent, component, deploymentContext);
         assert(component.getImplementation().getComponentType() != null): "Component type must be set";
         return context;
     }

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=411009&r1=411008&r2=411009&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 Thu Jun  1 17:40:15 2006
@@ -38,7 +38,7 @@
  */
 public class CompositeBuilder extends ComponentBuilderExtension<CompositeImplementation> {
 
-    public ComponentContext build(CompositeContext parent,
+    public ComponentContext<?> build(CompositeContext<?> parent,
                                   Component<CompositeImplementation> component,
                                   DeploymentContext deploymentContext) throws BuilderConfigException {
         CompositeImplementation implementation = component.getImplementation();

Modified: 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/AbstractCompositeContext.java?rev=411009&r1=411008&r2=411009&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/AbstractCompositeContext.java Thu Jun  1 17:40:15 2006
@@ -125,7 +125,7 @@
             registerAutowire((AtomicContext) child);
         } else if (child instanceof CompositeContext) {
             CompositeContext context = (CompositeContext) child;
-            if (lifecycleState == STARTED && context.getLifecycleState() == UNINITIALIZED) {
+            if (lifecycleState == RUNNING && context.getLifecycleState() == UNINITIALIZED) {
                 context.start();
             }
             registerAutowire(context);

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=411009&r1=411008&r2=411009&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 Thu Jun  1 17:40:15 2006
@@ -20,13 +20,14 @@
 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.ScopeContext;
 import org.apache.tuscany.spi.deployer.Deployer;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
-import org.apache.tuscany.spi.loader.LoaderRegistry;
 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.Implementation;
 
@@ -36,18 +37,18 @@
  * @version $Rev$ $Date$
  */
 public class DeployerImpl implements Deployer {
-    private LoaderRegistry loaderRegistry;
-    private BuilderRegistry builderRegistry;
+    private Loader loader;
+    private Builder builder;
     private Connector connector;
 
     @Autowire
-    public void setLoaderRegistry(LoaderRegistry loaderRegistry) {
-        this.loaderRegistry = loaderRegistry;
+    public void setLoader(Loader loader) {
+        this.loader = loader;
     }
 
     @Autowire
-    public void setBuilderRegistry(BuilderRegistry builderRegistry) {
-        this.builderRegistry = builderRegistry;
+    public void setBuilder(Builder builder) {
+        this.builder = builder;
     }
 
     @Autowire
@@ -55,13 +56,14 @@
         this.connector = connector;
     }
 
-    public <I extends Implementation<?>> void deploy(CompositeContext<?> parent, Component<I> component) throws LoaderException {
+    public <I extends Implementation<?>> Context<?> deploy(CompositeContext<?> parent, Component<I> component) throws LoaderException {
         ScopeContext moduleScope = new ModuleScopeContext();
         DeploymentContext deploymentContext = new DeploymentContext(null, null, moduleScope);
         load(component, deploymentContext);
         Context<?> context = build(parent, component, deploymentContext);
         connect(context);
         parent.registerContext(context);
+        return context;
     }
 
     /**
@@ -72,7 +74,7 @@
      * @param deploymentContext the current deployment context
      */
     protected <I extends Implementation<?>> void load(Component<I> component, DeploymentContext deploymentContext) throws LoaderException {
-        loaderRegistry.loadComponentType(component.getImplementation(), deploymentContext);
+        loader.loadComponentType(component.getImplementation(), deploymentContext);
     }
 
     /**
@@ -84,7 +86,7 @@
      * @return the new runtime context
      */
     protected <I extends Implementation<?>> Context<?> build(CompositeContext<?> parent, Component<I> component, DeploymentContext deploymentContext) {
-        return builderRegistry.build(parent, component, deploymentContext);
+        return builder.build(parent, component, deploymentContext);
     }
 
     /**

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=411009&r1=411008&r2=411009&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 Thu Jun  1 17:40:15 2006
@@ -49,7 +49,7 @@
 
     public ComponentType load(XMLStreamReader reader, DeploymentContext deploymentContext) throws XMLStreamException, LoaderException {
         assert AssemblyConstants.COMPONENT_TYPE.equals(reader.getName());
-        ComponentType componentType = new ComponentType();
+        ComponentType<Service,Reference,Property<?>> componentType = new ComponentType<Service, Reference, Property<?>>();
 
         while (true) {
             switch (reader.next()) {

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=411009&r1=411008&r2=411009&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 Thu Jun  1 17:40:15 2006
@@ -37,7 +37,7 @@
  */
 public class SystemComponentBuilder implements ComponentBuilder<SystemImplementation> {
 
-    public ComponentContext build(CompositeContext parent, Component<SystemImplementation> component, DeploymentContext deploymentContext) throws BuilderConfigException {
+    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();

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/system/builder/SystemCompositeBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/system/builder/SystemCompositeBuilder.java?rev=411009&r1=411008&r2=411009&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/system/builder/SystemCompositeBuilder.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/main/java/org/apache/tuscany/core/system/builder/SystemCompositeBuilder.java Thu Jun  1 17:40:15 2006
@@ -56,7 +56,7 @@
         this.builderRegistry = builderRegistry;
     }
 
-    public ComponentContext build(CompositeContext parent, Component<SystemCompositeImplementation> component, DeploymentContext deploymentContext) throws BuilderConfigException {
+    public ComponentContext<?> build(CompositeContext<?> parent, Component<SystemCompositeImplementation> component, DeploymentContext deploymentContext) throws BuilderConfigException {
         SystemCompositeImplementation impl = component.getImplementation();
         CompositeComponentType<?,?,?> componentType = impl.getComponentType();
         SystemCompositeContext<?> context = new SystemCompositeContextImpl(component.getName(), parent, getAutowireContext(parent));

Modified: incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryTestCase.java?rev=411009&r1=411008&r2=411009&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryTestCase.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/core2/src/test/java/org/apache/tuscany/core/builder/BuilderRegistryTestCase.java Thu Jun  1 17:40:15 2006
@@ -21,6 +21,7 @@
 import org.apache.tuscany.spi.model.CompositeImplementation;
 import org.apache.tuscany.spi.model.CompositeComponentType;
 import org.apache.tuscany.spi.builder.ComponentBuilder;
+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.deployer.DeploymentContext;
@@ -55,14 +56,14 @@
     }
 
     public static class GenerifiedBuilder implements ComponentBuilder<CompositeImplementation> {
-        public ComponentContext build(CompositeContext parent, Component<CompositeImplementation> component, DeploymentContext deploymentContext) {
+        public ComponentContext<?> build(CompositeContext<?> parent, Component<CompositeImplementation> component, DeploymentContext deploymentContext) {
             return null;
         }
     }
 
     @SuppressWarnings({"RawUseOfParameterizedType"})
     public static class RawBuilder implements ComponentBuilder {
-        public ComponentContext build(CompositeContext parent, Component component, DeploymentContext deploymentContext) {
+        public ComponentContext build(CompositeContext parent, Component component, DeploymentContext deploymentContext) throws BuilderConfigException {
             return null;
         }
     }

Modified: incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/AbstractLifecycle.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/AbstractLifecycle.java?rev=411009&r1=411008&r2=411009&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/AbstractLifecycle.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/AbstractLifecycle.java Thu Jun  1 17:40:15 2006
@@ -14,27 +14,37 @@
 package org.apache.tuscany.spi;
 
 /**
+ * Base class providing a simple implementation of Lifecycle.
+ *
  * @version $Rev$ $Date$
  */
 public abstract class AbstractLifecycle implements Lifecycle {
-    protected int lifecycleState = UNINITIALIZED;
+    protected volatile int lifecycleState = UNINITIALIZED;
 
     public int getLifecycleState() {
         return lifecycleState;
     }
 
+    /**
+     * Set the current state of the Lifecycle.
+     * @param lifecycleState the new state
+     */
     protected void setLifecycleState(int lifecycleState) {
         this.lifecycleState = lifecycleState;
     }
 
-    public void start() throws CoreRuntimeException {
-        setLifecycleState(STARTED);
+    public void start() {
+        setLifecycleState(RUNNING);
     }
 
-    public void stop() throws CoreRuntimeException {
+    public void stop() {
         setLifecycleState(STOPPED);
     }
 
+    /**
+     * Returns the current lifecycle as a String (for example, "RUNNING").
+     * @return the current lifecycle as a String
+     */
     public String toString() {
         switch (lifecycleState) {
             case (Lifecycle.CONFIG_ERROR):

Modified: incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/Lifecycle.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/Lifecycle.java?rev=411009&r1=411008&r2=411009&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/Lifecycle.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/Lifecycle.java Thu Jun  1 17:40:15 2006
@@ -28,8 +28,6 @@
     int INITIALIZING = 1;
     /* Instantiated and configured */
     int INITIALIZED = 2;
-    /* Started */
-    int STARTED = 4;
     /* Configured and initialized */
     int RUNNING = 4;
     /* In the process of being shutdown */

Added: incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/builder/Builder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/builder/Builder.java?rev=411009&view=auto
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/builder/Builder.java (added)
+++ incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/builder/Builder.java Thu Jun  1 17:40:15 2006
@@ -0,0 +1,54 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation or its licensors as applicable
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.tuscany.spi.builder;
+
+import org.apache.tuscany.spi.model.Implementation;
+import org.apache.tuscany.spi.model.Component;
+import org.apache.tuscany.spi.model.Binding;
+import org.apache.tuscany.spi.model.BoundService;
+import org.apache.tuscany.spi.model.BoundReference;
+import org.apache.tuscany.spi.context.Context;
+import org.apache.tuscany.spi.context.CompositeContext;
+import org.apache.tuscany.spi.context.ComponentContext;
+import org.apache.tuscany.spi.deployer.DeploymentContext;
+
+/**
+ * Service interface that builds runtime contexts from model objects.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface Builder {
+    /**
+     * Build a component context from a component definition.
+     *
+     * @param parent the context that will be the parent of the newly build context
+     * @param component the definition of the component
+     * @param deploymentContext the current deployment context
+     * @return a newly created component context
+     */
+    <I extends Implementation<?>> ComponentContext<?> build(CompositeContext<?> parent, Component<I> component, DeploymentContext deploymentContext);
+
+    /**
+     * TODO: JavaDoc this when we know if we will still register Services as contexts 
+     */
+    <B extends Binding> Context build(CompositeContext parent, BoundService<B> boundService, DeploymentContext deploymentContext);
+
+    /**
+     * TODO: JavaDoc this when we know if we will still register References as contexts
+     */
+    <B extends Binding> Context build(CompositeContext parent, BoundReference<B> boundReference, DeploymentContext deploymentContext);
+}

Propchange: incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/builder/Builder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/builder/Builder.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Modified: incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/builder/BuilderRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/builder/BuilderRegistry.java?rev=411009&r1=411008&r2=411009&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/builder/BuilderRegistry.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/builder/BuilderRegistry.java Thu Jun  1 17:40:15 2006
@@ -16,13 +16,7 @@
  */
 package org.apache.tuscany.spi.builder;
 
-import org.apache.tuscany.spi.context.CompositeContext;
-import org.apache.tuscany.spi.context.Context;
-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.Implementation;
 
 /**
@@ -31,18 +25,37 @@
  *
  * @version $Rev$ $Date$
  */
-public interface BuilderRegistry {
+public interface BuilderRegistry extends Builder {
+    /**
+     * Register a builder based on an implementation type specified in an annotation.
+     * The implementation type is obtained by reflecting the generic definition.
+     *
+     * @param builder the builder to register
+     */
     <I extends Implementation<?>> void register(ComponentBuilder<I> builder);
 
+    /**
+     * Register a builder for an implementation type.
+     *
+     * @param implClass the type of implementation that this builder can handle
+     * @param builder the builder to be registered
+     */
     <I extends Implementation<?>> void register(Class<I> implClass, ComponentBuilder<I> builder);
 
-    <I extends Implementation<?>> Context build(CompositeContext parent, Component<I> component, DeploymentContext deploymentContext);
-
+    /**
+     * Unregister a builder for an implementation type.
+     * @param implClass the implementation whose builder should be unregistered
+     */
+    <I extends Implementation<?>> void unregister(Class<I> implClass);
+
+    /**
+     * TODO: JavaDoc this once we know if we will be building contexts for bindings
+     */
     <B extends Binding> void register(BindingBuilder<B> builder);
 
+    /**
+     * TODO: JavaDoc this once we know if we will be building contexts for bindings
+     */
     <B extends Binding> void register(Class<B> implClass, BindingBuilder<B> builder);
 
-    <B extends Binding> Context build(CompositeContext parent, BoundService<B> boundService, DeploymentContext deploymentContext);
-
-    <B extends Binding> Context build(CompositeContext parent, BoundReference<B> boundReference, DeploymentContext deploymentContext);
 }

Modified: incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/builder/ComponentBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/builder/ComponentBuilder.java?rev=411009&r1=411008&r2=411009&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/builder/ComponentBuilder.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/builder/ComponentBuilder.java Thu Jun  1 17:40:15 2006
@@ -29,5 +29,5 @@
  * @version $Rev$ $Date$
  */
 public interface ComponentBuilder<I extends Implementation<?>> {
-    ComponentContext build(CompositeContext parent, Component<I> component, DeploymentContext deploymentContext) throws BuilderConfigException;
+    ComponentContext<?> build(CompositeContext<?> parent, Component<I> component, DeploymentContext deploymentContext) throws BuilderConfigException;
 }

Modified: incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/deployer/Deployer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/deployer/Deployer.java?rev=411009&r1=411008&r2=411009&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/deployer/Deployer.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/deployer/Deployer.java Thu Jun  1 17:40:15 2006
@@ -17,6 +17,7 @@
 package org.apache.tuscany.spi.deployer;
 
 import org.apache.tuscany.spi.context.CompositeContext;
+import org.apache.tuscany.spi.context.Context;
 import org.apache.tuscany.spi.model.Component;
 import org.apache.tuscany.spi.model.Implementation;
 import org.apache.tuscany.spi.loader.LoaderException;
@@ -29,9 +30,13 @@
 public interface Deployer {
     /**
      * Deploy a component as a child of the supplied parent.
+     * This operation creates a new context in the runtime to represent the supplied component.
+     * The type of context created will depend on the implementation of the component; for example,
+     * if the implementation of the component is a composite then typically a CompositeContext would be returned. 
      *
      * @param parent the parent context
      * @param component the component definition
+     * @return the newly deployed context for the component
      */
-    <I extends Implementation<?>> void deploy(CompositeContext<?> parent, Component<I> component) throws LoaderException;
+    <I extends Implementation<?>> Context<?> deploy(CompositeContext<?> parent, Component<I> component) throws LoaderException;
 }

Modified: incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/extension/ComponentBuilderExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/extension/ComponentBuilderExtension.java?rev=411009&r1=411008&r2=411009&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/extension/ComponentBuilderExtension.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/extension/ComponentBuilderExtension.java Thu Jun  1 17:40:15 2006
@@ -1,15 +1,16 @@
 package org.apache.tuscany.spi.extension;
 
-import org.apache.tuscany.spi.model.Implementation;
+import org.osoa.sca.annotations.Destroy;
+import org.osoa.sca.annotations.Init;
+
 import org.apache.tuscany.spi.annotation.Autowire;
 import org.apache.tuscany.spi.builder.BuilderRegistry;
 import org.apache.tuscany.spi.builder.ComponentBuilder;
-import org.apache.tuscany.spi.policy.PolicyBuilderRegistry;
 import org.apache.tuscany.spi.context.ScopeRegistry;
+import org.apache.tuscany.spi.model.Implementation;
+import org.apache.tuscany.spi.policy.PolicyBuilderRegistry;
 import org.apache.tuscany.spi.wire.WireService;
 
-import org.osoa.sca.annotations.Init;
-
 /**
  * An extension point for component builders. When adding support for new component types, implementations may
  * extend this class as a convenience.
@@ -18,9 +19,19 @@
  */
 @org.osoa.sca.annotations.Scope("MODULE")
 public abstract class ComponentBuilderExtension<I extends Implementation<?>> implements ComponentBuilder<I> {
-
+    /**
+     * The builder registry that this builder should register with; usually set by injection.
+     */
     protected BuilderRegistry builderRegistry;
+
+    /**
+     * The scope registry that this builder should use; usually set by injection.
+     */
     protected ScopeRegistry scopeRegistry;
+
+    /**
+     * The policy builder that this builder should use; usually set by injection.
+     */
     protected PolicyBuilderRegistry policyBuilderRegistry;
     protected WireService wireService;
 
@@ -46,8 +57,17 @@
 
     @Init(eager = true)
     public void init() {
-        builderRegistry.register(getImplementationType(),this);
+        builderRegistry.register(getImplementationType(), this);
+    }
+
+    @Destroy
+    public void destroy() {
+        builderRegistry.unregister(getImplementationType());
     }
 
+    /**
+     * Returns the Class of the implementation that this builder can handle.
+     * @return the type of implementation that this builder can handle
+     */
     protected abstract Class<I> getImplementationType();
 }

Modified: incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/extension/LoaderExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/extension/LoaderExtension.java?rev=411009&r1=411008&r2=411009&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/extension/LoaderExtension.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/extension/LoaderExtension.java Thu Jun  1 17:40:15 2006
@@ -18,12 +18,13 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.tuscany.spi.model.ModelObject;
+import org.osoa.sca.annotations.Destroy;
+import org.osoa.sca.annotations.Init;
+
 import org.apache.tuscany.spi.annotation.Autowire;
 import org.apache.tuscany.spi.loader.LoaderRegistry;
 import org.apache.tuscany.spi.loader.StAXElementLoader;
-import org.osoa.sca.annotations.Destroy;
-import org.osoa.sca.annotations.Init;
+import org.apache.tuscany.spi.model.ModelObject;
 
 /**
  * Support class for extending the Loader mechanism.
@@ -31,25 +32,52 @@
  * @version $Rev$ $Date$
  */
 public abstract class LoaderExtension<T extends ModelObject> implements StAXElementLoader<T> {
+    /**
+     * The LoaderRegistry that this loader should register with; usually set by injection.
+     * This registry may also be used to load sub-elements.
+     */
     protected LoaderRegistry registry;
 
+    /**
+     * Default constructor.
+     */
     protected LoaderExtension() {
     }
 
+    /**
+     * Constructor that allows the registry to be specified.
+     *
+     * @param registry the LoaderRegistry this loader should register with
+     */
     protected LoaderExtension(LoaderRegistry registry) {
         this.registry = registry;
     }
 
+    /**
+     * Set the registry this loader should register with.
+     * @param registry the registry this loader should register with
+     */
     @Autowire
     public void setRegistry(LoaderRegistry registry) {
         this.registry = registry;
     }
 
+    /**
+     * Initialize the loader.
+     * The base implementation registers this loader with the registry as a handler
+     * for the XML type returned by {@link #getXMLType()}. Implementations may override
+     * this to register the loader as a handler for multiple XML types.
+     */
     @Init(eager = true)
     public void start() {
         registry.registerLoader(getXMLType(), this);
     }
 
+    /**
+     * Destroy the loader.
+     * The base implementation unregisters the loader from the regsitry based on
+     * the type returned by {@link #getXMLType()}.
+     */
     @Destroy
     public void stop() {
         registry.unregisterLoader(getXMLType(), this);

Modified: incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/ComponentTypeLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/ComponentTypeLoader.java?rev=411009&r1=411008&r2=411009&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/ComponentTypeLoader.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/ComponentTypeLoader.java Thu Jun  1 17:40:15 2006
@@ -20,11 +20,18 @@
 import org.apache.tuscany.spi.model.Implementation;
 
 /**
+ * Loader that will load the ComponentType definition for the supplied implementation.
+ * The actual mechanism used to load that definition is determined by the Client and
+ * Implementation Specification for the implementaion type. In some cases the definition
+ * may be contained in a XML file related to the implementation artifact in some well
+ * defined manner; other implementations may obtain this information from introspection
+ * of the artifact itself (for example, by examining Java annotations).
+ * 
  * @version $Rev$ $Date$
  */
 public interface ComponentTypeLoader<I extends Implementation> {
     /**
-     * Load the component type information for the supplied implementation.
+     * Load the component type definition for the supplied implementation.
      *
      * @param implementation    the implementation whose component type information should be loaded
      * @param deploymentContext the current deployment context

Added: incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/Loader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/Loader.java?rev=411009&view=auto
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/Loader.java (added)
+++ incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/Loader.java Thu Jun  1 17:40:15 2006
@@ -0,0 +1,71 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation or its licensors as applicable
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.tuscany.spi.loader;
+
+import java.net.URL;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.spi.deployer.DeploymentContext;
+import org.apache.tuscany.spi.model.Implementation;
+import org.apache.tuscany.spi.model.ModelObject;
+
+/**
+ * System service for loading physical artifacts that represent SCDL configurations
+ * and creating the model objects that represent them.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface Loader {
+    /**
+     * Parse the supplied XML stream, dispatching to the appropriate registered loader
+     * for each element encountered in the stream.
+     * <p/>
+     * This method must be called with the XML cursor positioned on a START_ELEMENT event.
+     * When this method returns, the stream will be positioned on the corresponding
+     * END_ELEMENT event.
+     *
+     * @param reader            the XML stream to parse
+     * @param deploymentContext the current deployment context
+     * @return the model object obtained by parsing the current element on the stream
+     * @throws XMLStreamException if there was a problem reading the stream
+     */
+    ModelObject load(XMLStreamReader reader, DeploymentContext deploymentContext) throws XMLStreamException, LoaderException;
+
+    /**
+     * Load a model object from a specified location.
+     *
+     * @param url               the location of an XML document to be loaded
+     * @param type              the type of ModelObject that is expected to be in the document
+     * @param deploymentContext the current deployment context
+     * @return the model ojbect loaded from the document
+     * @throws LoaderException if there was a problem loading the document
+     */
+    <MO extends ModelObject> MO load(URL url, Class<MO> type, DeploymentContext deploymentContext) throws LoaderException;
+
+    /**
+     * Load the component type definition for a given implementation.
+     * How the component type information is located is defined by the implementation specification.
+     * It may include loading from an XML sidefile, introspection of some artifact related to the
+     * implementation, some combination of those techniques or any other implementation-defined mechanism.
+     *
+     * @param implementation    the implementation whose component type should be loaded
+     * @param deploymentContext the current deployment context
+     * @throws LoaderException if there was a problem loading the component type definition
+     */
+    <I extends Implementation<?>> void loadComponentType(I implementation, DeploymentContext deploymentContext) throws LoaderException;
+}

Propchange: incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/Loader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/Loader.java
------------------------------------------------------------------------------
    svn:keywords = Rev,Date

Modified: incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/LoaderRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/LoaderRegistry.java?rev=411009&r1=411008&r2=411009&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/LoaderRegistry.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/LoaderRegistry.java Thu Jun  1 17:40:15 2006
@@ -39,7 +39,7 @@
  *
  * @version $Rev$ $Date$
  */
-public interface LoaderRegistry {
+public interface LoaderRegistry extends Loader {
     /**
      * Register a loader. This operation will typically be called by a loader
      * during its initialization.
@@ -58,32 +58,6 @@
     <T extends ModelObject> void unregisterLoader(QName element, StAXElementLoader<T> loader);
 
     /**
-     * Parse the supplied XML stream dispatching to the appropriate registered loader
-     * for each element encountered in the stream.
-     * <p/>
-     * This method must be called with the XML cursor positioned on a START_ELEMENT event.
-     * When this method returns, the stream will be positioned on the corresponding
-     * END_ELEMENT event.
-     *
-     * @param reader            the XML stream to parse
-     * @param deploymentContext the current deployment context
-     * @return the model object obtained by parsing the current element on the stream
-     * @throws XMLStreamException if there was a problem reading the stream
-     */
-    ModelObject load(XMLStreamReader reader, DeploymentContext deploymentContext) throws XMLStreamException, LoaderException;
-
-    /**
-     * Load a model object from a specified locations.
-     *
-     * @param url               the location of an XML document to be loaded
-     * @param type              the type of ModelObject that is expected to be in the document
-     * @param deploymentContext the current deployment context
-     * @return the model ojbect loaded from the document
-     * @throws LoaderException if there was a problem loading the document
-     */
-    <MO extends ModelObject> MO load(URL url, Class<MO> type, DeploymentContext deploymentContext) throws LoaderException;
-
-    /**
      * Regsiter a component type loader.
      *
      * @param key    a type of implementation this loader can load component types for
@@ -97,16 +71,4 @@
      * @param key a type of implementation whose loader should be unregistered
      */
     <I extends Implementation<?>> void unregisterLoader(Class<I> key);
-
-    /**
-     * Load the component type definition for a given implementation.
-     * How the component type information is located is defined by the implementation specification.
-     * It may include loading from an XML sidefile, introspection of some artifact related to the
-     * implementation, some combination of those techniques or any other implementation-defined mechanism.
-     *
-     * @param implementation    the implementation whose component type should be loaded
-     * @param deploymentContext the current deployment context
-     * @throws LoaderException if there was a problem loading the component type definition
-     */
-    <I extends Implementation<?>> void loadComponentType(I implementation, DeploymentContext deploymentContext) throws LoaderException;
 }

Modified: incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/StAXElementLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/StAXElementLoader.java?rev=411009&r1=411008&r2=411009&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/StAXElementLoader.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/StAXElementLoader.java Thu Jun  1 17:40:15 2006
@@ -29,7 +29,7 @@
  */
 public interface StAXElementLoader<T extends ModelObject> {
     /**
-     * Build the model object for an element in an XML stream.
+     * Create the model object for an element in an XML stream.
      * When this method returns the stream will be positioned on the corresponding END_ELEMENT.
      *
      * @param reader the XML stream reader positioned on the applicable START_ELEMENT

Modified: incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/StAXPropertyFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/StAXPropertyFactory.java?rev=411009&r1=411008&r2=411009&view=diff
==============================================================================
--- incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/StAXPropertyFactory.java (original)
+++ incubator/tuscany/sandbox/jboynes/sca/spi/src/main/java/org/apache/tuscany/spi/loader/StAXPropertyFactory.java Thu Jun  1 17:40:15 2006
@@ -30,12 +30,17 @@
 public interface StAXPropertyFactory {
     /**
      * Return an ObjectFactory for instances of a property defined in an XML stream.
+     * The ObjectFactory must return instances that can safely be supplied to component
+     * implementations.
+     * If the instance is mutable and isolation between components is required,
+     * then the factory must clone or otherwise protect the implementation from
+     * unexpected modifications by other implementation instances.
      *
-     * @param reader the reader to use to access the XML stream
+     * @param reader   the reader to use to access the XML stream
      * @param property the Property definition that the resulting ObjectFactory must be able to assign to
      * @return an ObjectFactory that can produce instances that can be assigned to the supplied Property
-     * @throws javax.xml.stream.XMLStreamException if there is a problem reading the stream
-     * @throws LoaderException if there is a problem creating the ObjectFactory
+     * @throws XMLStreamException if there is a problem reading the stream
+     * @throws LoaderException    if there is a problem creating the ObjectFactory
      */
     <T> ObjectFactory<T> createObjectFactory(XMLStreamReader reader, Property<T> property) throws XMLStreamException, LoaderException;
 }



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