You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2007/05/08 10:01:10 UTC

svn commit: r536114 - in /incubator/tuscany/java/sca: modules/binding-rmi/src/main/java/org/apache/tuscany/binding/rmi/ modules/core-spi/src/main/java/org/apache/tuscany/provider/ modules/core/src/main/java/org/apache/tuscany/core/runtime/ modules/core...

Author: jsdelfino
Date: Tue May  8 01:01:05 2007
New Revision: 536114

URL: http://svn.apache.org/viewvc?view=rev&rev=536114
Log:
Simplified runtime provider interfaces.

Added:
    incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ProviderActivator.java   (with props)
Removed:
    incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ImplementationActivator.java
    incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ReferenceBindingActivator.java
    incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ServiceBindingActivator.java
Modified:
    incubator/tuscany/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/binding/rmi/RMIBindingProvider.java
    incubator/tuscany/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/binding/rmi/RMIBindingProviderFactory.java
    incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/BindingProviderFactory.java
    incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ImplementationProvider.java
    incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ImplementationProviderFactory.java
    incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ReferenceBindingProvider.java
    incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ScopedImplementationProvider.java
    incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ServiceBindingProvider.java
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/DefaultCompositeActivator.java
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeSCABindingImpl.java
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeSCABindingProvider.java
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/scope/AbstractScopeContainer.java
    incubator/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/core/scope/AbstractScopeContainerTestCase.java
    incubator/tuscany/java/sca/modules/host-embedded/src/test/java/crud/provider/CRUDImplementationProvider.java
    incubator/tuscany/java/sca/modules/host-embedded/src/test/java/crud/provider/CRUDImplementationProviderFactory.java
    incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/invocation/JavaImplementationProvider.java
    incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/invocation/JavaImplementationProviderFactory.java
    incubator/tuscany/java/sca/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementation.java
    incubator/tuscany/java/sca/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementationProvider.java
    incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/provider/EchoBindingProviderFactory.java
    incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/provider/EchoReferenceBindingProvider.java
    incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/provider/EchoServiceBindingProvider.java
    incubator/tuscany/java/sca/samples/databinding-echo/src/main/java/echo/provider/EchoBindingProviderFactory.java
    incubator/tuscany/java/sca/samples/databinding-echo/src/main/java/echo/provider/EchoReferenceBindingProvider.java
    incubator/tuscany/java/sca/samples/databinding-echo/src/main/java/echo/provider/EchoServiceBindingProvider.java
    incubator/tuscany/java/sca/samples/implementation-crud/src/main/java/crud/provider/CRUDImplementationProvider.java
    incubator/tuscany/java/sca/samples/implementation-crud/src/main/java/crud/provider/CRUDImplementationProviderFactory.java

Modified: incubator/tuscany/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/binding/rmi/RMIBindingProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/binding/rmi/RMIBindingProvider.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/binding/rmi/RMIBindingProvider.java (original)
+++ incubator/tuscany/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/binding/rmi/RMIBindingProvider.java Tue May  8 01:01:05 2007
@@ -60,6 +60,9 @@
 public class RMIBindingProvider implements ReferenceBindingProvider,
     ServiceBindingProvider, MethodInterceptor {
 
+    private RuntimeComponent component;
+    private RuntimeComponentService service;
+    private RuntimeComponentReference reference;
     private RMIBinding binding;
     private RMIHost rmiHost;
     private RuntimeWire wire;
@@ -70,52 +73,60 @@
     // and the component match in their service contracts.
     private Interface serviceInterface;
     
-    public RMIBindingProvider(RMIBinding binding, RMIHost rmiHost) {
+    public RMIBindingProvider(RuntimeComponent component, RuntimeComponentService service, RMIBinding binding, RMIHost rmiHost) {
+        this.component = component;
+        this.service = service;
         this.binding = binding;
         this.rmiHost = rmiHost;
     }
 
-    public InterfaceContract getBindingInterfaceContract(RuntimeComponentService service) {
-        return service.getInterfaceContract();
-    }
-
-    public void start(RuntimeComponent component, RuntimeComponentReference reference) {
-    }
-
-    public void stop(RuntimeComponent component, RuntimeComponentReference reference) {
+    public RMIBindingProvider(RuntimeComponent component, RuntimeComponentReference reference, RMIBinding binding, RMIHost rmiHost) {
+        this.component = component;
+        this.reference = reference;
+        this.binding = binding;
+        this.rmiHost = rmiHost;
     }
 
-    public void start(RuntimeComponent component, RuntimeComponentService service) {
-        URI uri = URI.create(component.getURI() + "/" + binding.getName());
-        binding.setURI(uri.toString());
-        RuntimeComponentService componentService = (RuntimeComponentService) service;
-        
-        //TODO : Need to figure out why we do a get(0)... will this work always...
-        this.wire = componentService.getRuntimeWires().get(0);
-        this.serviceInterface = service.getInterfaceContract().getInterface();
-        
-        Remote rmiProxy = createRmiService();
-        
-        try {
-            rmiHost.registerService(binding.getRmiServiceName(),
-                                    getPort(binding.getRmiPort()),
-                                    rmiProxy);
-        } catch (RMIHostException e) {
-            throw new NoRemoteServiceException(e);
+    public InterfaceContract getBindingInterfaceContract() {
+        if (service != null)
+            return service.getInterfaceContract();
+        else
+            return reference.getInterfaceContract();
+    }
+
+    public void start() {
+        if (service != null) {
+            URI uri = URI.create(component.getURI() + "/" + binding.getName());
+            binding.setURI(uri.toString());
+            
+            //TODO : Need to figure out why we do a get(0)... will this work always...
+            this.wire = service.getRuntimeWires().get(0);
+            this.serviceInterface = service.getInterfaceContract().getInterface();
+            
+            Remote rmiProxy = createRmiService();
+            
+            try {
+                rmiHost.registerService(binding.getRmiServiceName(),
+                                        getPort(binding.getRmiPort()),
+                                        rmiProxy);
+            } catch (RMIHostException e) {
+                throw new NoRemoteServiceException(e);
+            }
         }
     }
 
-    public void stop(RuntimeComponent component, RuntimeComponentService service) {
-        try {
-            rmiHost.unregisterService(binding.getRmiServiceName(), 
-                                      getPort(binding.getRmiPort()));
-        } catch (RMIHostException e) {
-            throw new NoRemoteServiceException(e.getMessage());
+    public void stop() {
+        if (service != null) {
+            try {
+                rmiHost.unregisterService(binding.getRmiServiceName(), 
+                                          getPort(binding.getRmiPort()));
+            } catch (RMIHostException e) {
+                throw new NoRemoteServiceException(e.getMessage());
+            }
         }
-        
     }
 
-    public Invoker createInvoker(RuntimeComponent component, RuntimeComponentReference reference, Operation operation, boolean isCallback) {
+    public Invoker createInvoker(Operation operation, boolean isCallback) {
        try {
             Method remoteMethod = 
                 JavaInterfaceUtil.findMethod(((JavaInterface)reference.getInterfaceContract().getInterface()).getJavaClass(),
@@ -130,10 +141,6 @@
         }
     }
 
-    public InterfaceContract getBindingInterfaceContract(RuntimeComponentReference reference) {
-        return reference.getInterfaceContract();
-    }
-    
     protected Remote createRmiService() {
         Enhancer enhancer = new Enhancer();
         enhancer.setSuperclass(UnicastRemoteObject.class);

Modified: incubator/tuscany/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/binding/rmi/RMIBindingProviderFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/binding/rmi/RMIBindingProviderFactory.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/binding/rmi/RMIBindingProviderFactory.java (original)
+++ incubator/tuscany/java/sca/modules/binding-rmi/src/main/java/org/apache/tuscany/binding/rmi/RMIBindingProviderFactory.java Tue May  8 01:01:05 2007
@@ -17,6 +17,9 @@
 
 package org.apache.tuscany.binding.rmi;
 
+import org.apache.tuscany.core.RuntimeComponent;
+import org.apache.tuscany.core.RuntimeComponentReference;
+import org.apache.tuscany.core.RuntimeComponentService;
 import org.apache.tuscany.provider.BindingProviderFactory;
 import org.apache.tuscany.provider.ReferenceBindingProvider;
 import org.apache.tuscany.provider.ServiceBindingProvider;
@@ -37,11 +40,11 @@
         this.rmiHost = rmiHost;
     }
 
-    public ReferenceBindingProvider createReferenceBindingProvider() {
-        return new RMIBindingProvider(this, rmiHost);
+    public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component, RuntimeComponentReference reference) {
+        return new RMIBindingProvider(component, reference, this, rmiHost);
     }
-    
-    public ServiceBindingProvider createServiceBindingProvider() {
-        return new RMIBindingProvider(this, rmiHost);
+
+    public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, RuntimeComponentService service) {
+        return new RMIBindingProvider(component, service, this, rmiHost);
     }
 }

Modified: incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/BindingProviderFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/BindingProviderFactory.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/BindingProviderFactory.java (original)
+++ incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/BindingProviderFactory.java Tue May  8 01:01:05 2007
@@ -20,14 +20,33 @@
 package org.apache.tuscany.provider;
 
 import org.apache.tuscany.assembly.Binding;
+import org.apache.tuscany.core.RuntimeComponent;
+import org.apache.tuscany.core.RuntimeComponentReference;
+import org.apache.tuscany.core.RuntimeComponentService;
 
 /**
  * @version $Rev$ $Date$
  */
 public interface BindingProviderFactory extends Binding {
-    
-    ReferenceBindingProvider createReferenceBindingProvider();
-    
-    ServiceBindingProvider createServiceBindingProvider();
+
+    /**
+     * Creates a new reference binding provider for the given
+     * component and reference.
+     * 
+     * @param component
+     * @param reference
+     * @return
+     */
+    ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component, RuntimeComponentReference reference);
+
+    /**
+     * Creates a new service binding provider for the given
+     * component and service.
+     * 
+     * @param component
+     * @param service
+     * @return
+     */
+    ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, RuntimeComponentService service);
     
 }

Modified: incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ImplementationProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ImplementationProvider.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ImplementationProvider.java (original)
+++ incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ImplementationProvider.java Tue May  8 01:01:05 2007
@@ -19,7 +19,6 @@
 
 package org.apache.tuscany.provider;
 
-import org.apache.tuscany.core.RuntimeComponent;
 import org.apache.tuscany.core.RuntimeComponentService;
 import org.apache.tuscany.interfacedef.InterfaceContract;
 import org.apache.tuscany.interfacedef.Operation;
@@ -31,19 +30,19 @@
  * 
  * @version $Rev$ $Date$
  */
-public interface ImplementationProvider extends ImplementationActivator {
+public interface ImplementationProvider extends ProviderActivator {
+
     /**
      * Create an invoker for the component implementation in the invocation
      * chain. The invoker will be responsible for calling the implementation
      * logic for the given component.
      * 
-     * @param component The component that owns the component service
      * @param service The component service
      * @param operation The operation that the interceptor will handle
      * @return An invoker that handles the invocation logic, null should be
      *         returned if no invoker is required
      */
-    Invoker createInvoker(RuntimeComponent component, RuntimeComponentService service, Operation operation);
+    Invoker createInvoker(RuntimeComponentService service, Operation operation);
 
     /**
      * Create an invoker to call back to the given component
@@ -52,7 +51,7 @@
      * @return An invoker that handles the invocation logic, null should be
      *         returned if no invoker is required
      */
-    Invoker createCallbackInvoker(RuntimeComponent component, Operation operation);
+    Invoker createCallbackInvoker(Operation operation);
     
     /**
      * Get the effective interface contract imposed by the implementation.
@@ -63,9 +62,4 @@
      */
     InterfaceContract getImplementationInterfaceContract(RuntimeComponentService service);
   
-    /**
-     * Configure the component by adding additional metadata for the component
-     * @param component The runtime component
-     */
-    void configure(RuntimeComponent component);
 }

Modified: incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ImplementationProviderFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ImplementationProviderFactory.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ImplementationProviderFactory.java (original)
+++ incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ImplementationProviderFactory.java Tue May  8 01:01:05 2007
@@ -20,12 +20,20 @@
 package org.apache.tuscany.provider;
 
 import org.apache.tuscany.assembly.Implementation;
+import org.apache.tuscany.core.RuntimeComponent;
 
 /**
  * @version $Rev$ $Date$
  */
 public interface ImplementationProviderFactory extends Implementation {
     
-    ImplementationProvider createImplementationProvider();
+    /**
+     * Creates a new implementation provider for the given
+     * component.
+     * 
+     * @param component
+     * @return
+     */
+    ImplementationProvider createImplementationProvider(RuntimeComponent component);
     
 }

Added: incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ProviderActivator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ProviderActivator.java?view=auto&rev=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ProviderActivator.java (added)
+++ incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ProviderActivator.java Tue May  8 01:01:05 2007
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.provider;
+
+
+
+/**
+ * A component implementation can optionally implement this interface to control
+ * how a component is started ot stopped.
+ * 
+ * @version $Rev$ $Date$
+ */
+public interface ProviderActivator {
+    /**
+     * This method will be invoked when a component implemented by this
+     * implementation is activated.
+     */
+    void start();
+
+    /**
+     * This method will be invoked when a component implemented by this
+     * implementation is deactivated.
+     */
+    void stop();
+
+}

Propchange: incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ProviderActivator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ProviderActivator.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ReferenceBindingProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ReferenceBindingProvider.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ReferenceBindingProvider.java (original)
+++ incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ReferenceBindingProvider.java Tue May  8 01:01:05 2007
@@ -19,8 +19,6 @@
 
 package org.apache.tuscany.provider;
 
-import org.apache.tuscany.core.RuntimeComponent;
-import org.apache.tuscany.core.RuntimeComponentReference;
 import org.apache.tuscany.interfacedef.InterfaceContract;
 import org.apache.tuscany.interfacedef.Operation;
 import org.apache.tuscany.invocation.Invoker;
@@ -28,30 +26,28 @@
 /**
  * @version $Rev$ $Date$
  */
-public interface ReferenceBindingProvider extends ReferenceBindingActivator {
+public interface ReferenceBindingProvider extends ProviderActivator {
     /**
      * Create an invoker for the reference binding in the invocation chain.
      * The invoker is responsible for making the outbound invocation over
      * the binding protocol.
      * 
-     * @param model The service that defines the binding
      * @param operation The operation that the interceptor will handle
      * @param isCallback A flag to tell if the operation is for the callback
      * @return An invoker that handles the invocation logic, null should be
      *         returned if no invoker is required
      */
-    Invoker createInvoker(RuntimeComponent component, RuntimeComponentReference reference, Operation operation, boolean isCallback);
+    Invoker createInvoker(Operation operation, boolean isCallback);
 
     /**
      * Get the effective interface contract imposed by the binding. For example,
      * it will be interface contract introspected from the WSDL portType used by
      * the endpoint for a WebService binding.
      * 
-     * @param model The model object
      * @return The effective interface contract, if null is returned, the interface contract
      * for the component reference will be used
      */
-    InterfaceContract getBindingInterfaceContract(RuntimeComponentReference reference);
+    InterfaceContract getBindingInterfaceContract();
     
 
 }

Modified: incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ScopedImplementationProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ScopedImplementationProvider.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ScopedImplementationProvider.java (original)
+++ incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ScopedImplementationProvider.java Tue May  8 01:01:05 2007
@@ -19,7 +19,6 @@
 
 package org.apache.tuscany.provider;
 
-import org.apache.tuscany.core.RuntimeComponent;
 import org.apache.tuscany.scope.InstanceWrapper;
 import org.apache.tuscany.scope.Scope;
 
@@ -41,18 +40,16 @@
     /**
      * Indicate if the component needs to be eagerly initialized
      * 
-     * @param component The component
      * @return true if the component is marked to be eagerly initialized, false
      *         otherwise
      */
-    boolean isEagerInit(RuntimeComponent component);
+    boolean isEagerInit();
 
     /**
      * Create a wrapper for the component instance for the scope management
      * 
-     * @param component The component
      * @return A wrapper for the component instance
      */
-    InstanceWrapper createInstanceWrapper(RuntimeComponent component);
+    InstanceWrapper createInstanceWrapper();
 
 }

Modified: incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ServiceBindingProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ServiceBindingProvider.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ServiceBindingProvider.java (original)
+++ incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/provider/ServiceBindingProvider.java Tue May  8 01:01:05 2007
@@ -19,7 +19,6 @@
 
 package org.apache.tuscany.provider;
 
-import org.apache.tuscany.core.RuntimeComponentService;
 import org.apache.tuscany.interfacedef.InterfaceContract;
 
 /**
@@ -27,7 +26,7 @@
  * 
  * @version $Rev$ $Date$
  */
-public interface ServiceBindingProvider extends ServiceBindingActivator {
+public interface ServiceBindingProvider extends ProviderActivator {
     /**
      * Get the effective interface contract imposed by the binding. For example,
      * it will be interface contract introspected from the WSDL portType used by
@@ -37,5 +36,5 @@
      * @return The effective interface contract, if null is returned, the interface contract
      * for the component service will be used
      */
-    InterfaceContract getBindingInterfaceContract(RuntimeComponentService service);
+    InterfaceContract getBindingInterfaceContract();
 }

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/DefaultCompositeActivator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/DefaultCompositeActivator.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/DefaultCompositeActivator.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/DefaultCompositeActivator.java Tue May  8 01:01:05 2007
@@ -45,13 +45,10 @@
 import org.apache.tuscany.invocation.InvocationChain;
 import org.apache.tuscany.invocation.Invoker;
 import org.apache.tuscany.provider.BindingProviderFactory;
-import org.apache.tuscany.provider.ImplementationActivator;
 import org.apache.tuscany.provider.ImplementationProvider;
 import org.apache.tuscany.provider.ImplementationProviderFactory;
-import org.apache.tuscany.provider.ReferenceBindingActivator;
 import org.apache.tuscany.provider.ReferenceBindingProvider;
 import org.apache.tuscany.provider.ScopedImplementationProvider;
-import org.apache.tuscany.provider.ServiceBindingActivator;
 import org.apache.tuscany.provider.ServiceBindingProvider;
 import org.apache.tuscany.scope.Scope;
 import org.apache.tuscany.scope.ScopeRegistry;
@@ -104,7 +101,9 @@
             for (ComponentService service : component.getServices()) {
                 for (Binding binding : service.getBindings()) {
                     if (binding instanceof BindingProviderFactory) {
-                        ServiceBindingProvider bindingProvider = ((BindingProviderFactory)binding).createServiceBindingProvider();
+                        ServiceBindingProvider bindingProvider =
+                            ((BindingProviderFactory)binding).createServiceBindingProvider(
+                                                                                           (RuntimeComponent)component, (RuntimeComponentService)service);
                         if (bindingProvider != null) {
                             ((RuntimeComponentService)service).setBindingProvider(binding, bindingProvider);
                         }
@@ -114,7 +113,9 @@
             for (ComponentReference reference : component.getReferences()) {
                 for (Binding binding : reference.getBindings()) {
                     if (binding instanceof BindingProviderFactory) {
-                        ReferenceBindingProvider bindingProvider = ((BindingProviderFactory)binding).createReferenceBindingProvider();
+                        ReferenceBindingProvider bindingProvider =
+                            ((BindingProviderFactory)binding).createReferenceBindingProvider(
+                                                                                             (RuntimeComponent)component, (RuntimeComponentReference)reference);
                         if (bindingProvider != null) {
                             ((RuntimeComponentReference)reference).setBindingProvider(binding, bindingProvider);
                         }
@@ -126,10 +127,11 @@
             if (implementation instanceof Composite) {
                 configureComposite((Composite)implementation);
             } else if (implementation instanceof ImplementationProviderFactory) {
-                ImplementationProvider implementationProvider = ((ImplementationProviderFactory)implementation).createImplementationProvider();
+                ImplementationProvider implementationProvider =
+                    ((ImplementationProviderFactory)implementation).createImplementationProvider(
+                                                                                                 (RuntimeComponent)component);
                 if (implementationProvider != null) {
                     ((RuntimeComponent)component).setImplementationProvider(implementationProvider);
-                    implementationProvider.configure((RuntimeComponent)component);
                 }
                 setScopeContainer(component);
             }
@@ -145,9 +147,9 @@
             for (ComponentService service : component.getServices()) {
                 for (Binding binding : service.getBindings()) {
                     if (binding instanceof BindingProviderFactory) {
-                        ServiceBindingActivator bindingActivator = ((RuntimeComponentService)service).getBindingProvider(binding);
-                        if (bindingActivator != null) {
-                            bindingActivator.start((RuntimeComponent)component, (RuntimeComponentService)service);
+                        ServiceBindingProvider bindingProvider = ((RuntimeComponentService)service).getBindingProvider(binding);
+                        if (bindingProvider != null) {
+                            bindingProvider.start();
                         }
                     }
                 }
@@ -155,9 +157,9 @@
             for (ComponentReference reference : component.getReferences()) {
                 for (Binding binding : reference.getBindings()) {
                     if (binding instanceof BindingProviderFactory) {
-                        ReferenceBindingActivator bindingActivator = ((RuntimeComponentReference)reference).getBindingProvider(binding);
-                        if (bindingActivator != null) {
-                            bindingActivator.start((RuntimeComponent)component, (RuntimeComponentReference)reference);
+                        ReferenceBindingProvider bindingProvider = ((RuntimeComponentReference)reference).getBindingProvider(binding);
+                        if (bindingProvider != null) {
+                            bindingProvider.start();
                         }
                     }
                 }
@@ -167,9 +169,9 @@
             if (implementation instanceof Composite) {
                 startComposite((Composite)implementation);
             } else if (implementation instanceof ImplementationProviderFactory) {
-                ImplementationActivator implementationActivator = ((RuntimeComponent)component).getImplementationProvider();
-                if (implementationActivator != null) {
-                    implementationActivator.start((RuntimeComponent)component);
+                ImplementationProvider implementationProvider = ((RuntimeComponent)component).getImplementationProvider();
+                if (implementationProvider != null) {
+                    implementationProvider.start();
                 }
             }
 
@@ -192,9 +194,9 @@
             for (ComponentService service : component.getServices()) {
                 for (Binding binding : service.getBindings()) {
                     if (binding instanceof BindingProviderFactory) {
-                        ServiceBindingActivator bindingActivator = ((RuntimeComponentService)service).getBindingProvider(binding);
-                        if (bindingActivator != null) {
-                            bindingActivator.stop((RuntimeComponent)component, (RuntimeComponentService)service);
+                        ServiceBindingProvider bindingProvider = ((RuntimeComponentService)service).getBindingProvider(binding);
+                        if (bindingProvider != null) {
+                            bindingProvider.stop();
                         }
                     }
                 }
@@ -202,9 +204,9 @@
             for (ComponentReference reference : component.getReferences()) {
                 for (Binding binding : reference.getBindings()) {
                     if (binding instanceof BindingProviderFactory) {
-                        ReferenceBindingActivator bindingActivator = ((RuntimeComponentReference)reference).getBindingProvider(binding);
-                        if (bindingActivator != null) {
-                            bindingActivator.stop((RuntimeComponent)component, (RuntimeComponentReference)reference);
+                        ReferenceBindingProvider bindingProvider = ((RuntimeComponentReference)reference).getBindingProvider(binding);
+                        if (bindingProvider != null) {
+                            bindingProvider.stop();
                         }
                     }
                 }
@@ -213,9 +215,9 @@
             if (implementation instanceof Composite) {
                 stop((Composite)implementation);
             } else if (implementation instanceof ImplementationProviderFactory) {
-                ImplementationActivator implementationActivator = ((RuntimeComponent)component).getImplementationProvider();
-                if (implementationActivator != null) {
-                    implementationActivator.stop((RuntimeComponent)component);
+                ImplementationProvider implementationProvider = ((RuntimeComponent)component).getImplementationProvider();
+                if (implementationProvider != null) {
+                    implementationProvider.stop();
                 }
             }
 
@@ -272,8 +274,7 @@
         if (binding instanceof BindingProviderFactory) {
             ReferenceBindingProvider provider = ((RuntimeComponentReference)reference).getBindingProvider(binding);
             if (provider != null) {
-                InterfaceContract bindingContract = provider
-                    .getBindingInterfaceContract((RuntimeComponentReference)reference);
+                InterfaceContract bindingContract = provider.getBindingInterfaceContract();
                 if (bindingContract != null) {
                     interfaceContract = bindingContract;
                 }
@@ -403,7 +404,7 @@
         if (binding instanceof BindingProviderFactory) {
             ServiceBindingProvider provider = ((RuntimeComponentService)service).getBindingProvider(binding);
             if (provider != null) {
-                InterfaceContract bindingContract = provider.getBindingInterfaceContract((RuntimeComponentService)service);
+                InterfaceContract bindingContract = provider.getBindingInterfaceContract();
                 if (bindingContract != null) {
                     interfaceContract = bindingContract;
                 }
@@ -506,11 +507,9 @@
             if (provider != null) {
                 Invoker invoker = null;
                 if (!isCallback) {
-                    invoker = provider.createInvoker((RuntimeComponent)component,
-                                                             (RuntimeComponentService)service,
-                                                             operation);
+                    invoker = provider.createInvoker((RuntimeComponentService)service,operation);
                 } else {
-                    invoker = provider.createCallbackInvoker((RuntimeComponent)component, operation);
+                    invoker = provider.createCallbackInvoker(operation);
                 }
                 chain.addInvoker(invoker);
             }
@@ -536,10 +535,7 @@
         if (binding instanceof BindingProviderFactory) {
             ReferenceBindingProvider provider = ((RuntimeComponentReference)reference).getBindingProvider(binding);
             if (provider != null) {
-                Invoker invoker = provider.createInvoker((RuntimeComponent)component,
-                                                                     (RuntimeComponentReference)reference,
-                                                                     operation,
-                                                                     isCallback);
+                Invoker invoker = provider.createInvoker(operation, isCallback);
                 if (invoker != null) {
                     chain.addInvoker(invoker);
                 }

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeSCABindingImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeSCABindingImpl.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeSCABindingImpl.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeSCABindingImpl.java Tue May  8 01:01:05 2007
@@ -24,6 +24,9 @@
 
 import org.apache.tuscany.assembly.SCABinding;
 import org.apache.tuscany.assembly.impl.SCABindingImpl;
+import org.apache.tuscany.core.RuntimeComponent;
+import org.apache.tuscany.core.RuntimeComponentReference;
+import org.apache.tuscany.core.RuntimeComponentService;
 import org.apache.tuscany.core.RuntimeWire;
 import org.apache.tuscany.provider.BindingProviderFactory;
 import org.apache.tuscany.provider.ReferenceBindingProvider;
@@ -43,11 +46,11 @@
         return wires;
     }
 
-    public ReferenceBindingProvider createReferenceBindingProvider() {
-        return new RuntimeSCABindingProvider();
+    public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component, RuntimeComponentReference reference) {
+        return new RuntimeSCABindingProvider(component, reference);
     }
 
-    public ServiceBindingProvider createServiceBindingProvider() {
+    public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, RuntimeComponentService service) {
         return null;
     }
     

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeSCABindingProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeSCABindingProvider.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeSCABindingProvider.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/RuntimeSCABindingProvider.java Tue May  8 01:01:05 2007
@@ -33,18 +33,26 @@
  */
 public class RuntimeSCABindingProvider extends SCABindingImpl implements SCABinding, ReferenceBindingProvider {
     
-    public InterfaceContract getBindingInterfaceContract(RuntimeComponentReference reference) {
+    private RuntimeComponent component;
+    private RuntimeComponentReference reference;
+    
+    public RuntimeSCABindingProvider(RuntimeComponent component, RuntimeComponentReference reference) {
+        this.component = component;
+        this.reference = reference;
+    }
+    
+    public InterfaceContract getBindingInterfaceContract() {
         return reference.getInterfaceContract();
     }
 
-    public Invoker createInvoker(RuntimeComponent component, RuntimeComponentReference reference, Operation operation, boolean isCallback) {
+    public Invoker createInvoker(Operation operation, boolean isCallback) {
         return null;
     }
 
-    public void start(RuntimeComponent component, RuntimeComponentReference reference) {
+    public void start() {
     }
 
-    public void stop(RuntimeComponent component, RuntimeComponentReference reference) {
+    public void stop() {
     }
 
 }

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/scope/AbstractScopeContainer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/scope/AbstractScopeContainer.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/scope/AbstractScopeContainer.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/scope/AbstractScopeContainer.java Tue May  8 01:01:05 2007
@@ -68,7 +68,7 @@
     protected InstanceWrapper createInstanceWrapper() throws TargetResolutionException {
         ImplementationProvider implementationProvider = component.getImplementationProvider();
         if (implementationProvider instanceof ScopedImplementationProvider) {
-            return ((ScopedImplementationProvider)implementationProvider).createInstanceWrapper(component);
+            return ((ScopedImplementationProvider)implementationProvider).createInstanceWrapper();
         }
         return null;
     }
@@ -91,7 +91,7 @@
     protected boolean isEagerInit() {
         ImplementationProvider implementationProvider = ((RuntimeComponent)component).getImplementationProvider();
         if (implementationProvider instanceof ScopedImplementationProvider) {
-            return ((ScopedImplementationProvider)implementationProvider).isEagerInit(component);
+            return ((ScopedImplementationProvider)implementationProvider).isEagerInit();
         }
         return false;
     }

Modified: incubator/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/core/scope/AbstractScopeContainerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/core/scope/AbstractScopeContainerTestCase.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/core/scope/AbstractScopeContainerTestCase.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/test/java/org/apache/tuscany/core/scope/AbstractScopeContainerTestCase.java Tue May  8 01:01:05 2007
@@ -54,11 +54,11 @@
 
     protected void preRegisterComponent() throws Exception {
         scopeContainer.start();
-        EasyMock.expect(implementation.isEagerInit(component)).andStubReturn(false);
+        EasyMock.expect(implementation.isEagerInit()).andStubReturn(false);
     }
 
     protected void expectCreateWrapper() throws Exception {
-        EasyMock.expect(implementation.createInstanceWrapper(component)).andReturn(wrapper);
+        EasyMock.expect(implementation.createInstanceWrapper()).andReturn(wrapper);
         wrapper.start();
     }
     

Modified: incubator/tuscany/java/sca/modules/host-embedded/src/test/java/crud/provider/CRUDImplementationProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-embedded/src/test/java/crud/provider/CRUDImplementationProvider.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/host-embedded/src/test/java/crud/provider/CRUDImplementationProvider.java (original)
+++ incubator/tuscany/java/sca/modules/host-embedded/src/test/java/crud/provider/CRUDImplementationProvider.java Tue May  8 01:01:05 2007
@@ -42,21 +42,23 @@
  */
 public class CRUDImplementationProvider implements ImplementationProvider {
     
+    private RuntimeComponent component;
     private CRUDImplementation implementation;
 
     /**
      * Constructs a new CRUD implementation.
      */
-    public CRUDImplementationProvider(CRUDImplementation implementation) {
+    public CRUDImplementationProvider(RuntimeComponent component, CRUDImplementation implementation) {
+        this.component = component;
         this.implementation = implementation;
     }
 
-    public Invoker createInvoker(RuntimeComponent component, RuntimeComponentService service, Operation operation) {
+    public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
         CRUDInvoker invoker = new CRUDInvoker(operation, new ResourceManager(implementation.getDirectory()));
         return invoker;
     }
 
-    public Invoker createCallbackInvoker(RuntimeComponent component, Operation operation) {
+    public Invoker createCallbackInvoker(Operation operation) {
         CRUDInvoker invoker = new CRUDInvoker(operation, new ResourceManager(implementation.getDirectory()));
         return invoker;
     }
@@ -65,16 +67,12 @@
         return service.getInterfaceContract();
     }
 
-    public void start(RuntimeComponent component) {
+    public void start() {
         System.out.println("Starting " + component.getName());
     }
 
-    public void stop(RuntimeComponent component) {
+    public void stop() {
         System.out.println("Stopping " + component.getName());
-    }
-
-    public void configure(RuntimeComponent component) {
-        System.out.println("Configuring " + component.getName());
     }
 
 }

Modified: incubator/tuscany/java/sca/modules/host-embedded/src/test/java/crud/provider/CRUDImplementationProviderFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/host-embedded/src/test/java/crud/provider/CRUDImplementationProviderFactory.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/host-embedded/src/test/java/crud/provider/CRUDImplementationProviderFactory.java (original)
+++ incubator/tuscany/java/sca/modules/host-embedded/src/test/java/crud/provider/CRUDImplementationProviderFactory.java Tue May  8 01:01:05 2007
@@ -19,6 +19,7 @@
 package crud.provider;
 
 import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.core.RuntimeComponent;
 import org.apache.tuscany.interfacedef.java.JavaInterfaceFactory;
 import org.apache.tuscany.interfacedef.java.introspect.JavaInterfaceIntrospector;
 import org.apache.tuscany.provider.ImplementationProvider;
@@ -44,8 +45,7 @@
         super(assemblyFactory, javaFactory, introspector);
     }
 
-    
-    public ImplementationProvider createImplementationProvider() {
-        return new CRUDImplementationProvider(this);
+    public ImplementationProvider createImplementationProvider(RuntimeComponent component) {
+        return new CRUDImplementationProvider(component, this);
     }
 }

Modified: incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/invocation/JavaImplementationProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/invocation/JavaImplementationProvider.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/invocation/JavaImplementationProvider.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/invocation/JavaImplementationProvider.java Tue May  8 01:01:05 2007
@@ -47,14 +47,11 @@
  * @version $Rev$ $Date$
  */
 public class JavaImplementationProvider implements ScopedImplementationProvider {
-    private JavaPropertyValueObjectFactory propertyValueObjectFactory;
-    private DataBindingExtensionPoint dataBindingRegistry;
-    private ProxyFactory proxyService;
-    private WorkContext workContext;
     private JavaImplementation implementation;
     private JavaComponentInfo atomicComponent;
 
     public JavaImplementationProvider(
+                                      RuntimeComponent component,
                                       JavaImplementation implementation,
                                       ProxyFactory proxyService,
                                       WorkContext workContext,
@@ -62,13 +59,7 @@
                                       JavaPropertyValueObjectFactory propertyValueObjectFactory) {
         super();
         this.implementation = implementation;
-        this.proxyService = proxyService;
-        this.workContext = workContext;
-        this.dataBindingRegistry = dataBindingRegistry;
-        this.propertyValueObjectFactory = propertyValueObjectFactory;
-    }
 
-    public void configure(RuntimeComponent component) {
         try {
             PojoConfiguration configuration = new PojoConfiguration(implementation);
             configuration.setProxyFactory(proxyService);
@@ -140,7 +131,7 @@
         return atomicComponent.createInstance();
     }
 
-    public Invoker createInvoker(RuntimeComponent component, RuntimeComponentService service, Operation operation) {
+    public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
         try {
             return new TargetInvokerInvoker(atomicComponent.createTargetInvoker(operation));
         } catch (TargetInvokerCreationException e) {
@@ -148,7 +139,7 @@
         }
     }
 
-    public Invoker createCallbackInvoker(RuntimeComponent component, Operation operation) {
+    public Invoker createCallbackInvoker(Operation operation) {
         try {
             return new TargetInvokerInvoker(atomicComponent.createTargetInvoker(operation));
         } catch (TargetInvokerCreationException e) {
@@ -164,19 +155,19 @@
         return new Scope(implementation.getJavaScope().getScope());
     }
 
-    public void start(RuntimeComponent component) {
+    public void start() {
         atomicComponent.start();
     }
 
-    public void stop(RuntimeComponent component) {
+    public void stop() {
         atomicComponent.stop();
     }
 
-    public InstanceWrapper createInstanceWrapper(RuntimeComponent component) {
+    public InstanceWrapper createInstanceWrapper() {
         return atomicComponent.createInstanceWrapper();
     }
 
-    public boolean isEagerInit(RuntimeComponent component) {
+    public boolean isEagerInit() {
         return implementation.isEagerInit();
     }
 

Modified: incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/invocation/JavaImplementationProviderFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/invocation/JavaImplementationProviderFactory.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/invocation/JavaImplementationProviderFactory.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-java-runtime/src/main/java/org/apache/tuscany/implementation/java/invocation/JavaImplementationProviderFactory.java Tue May  8 01:01:05 2007
@@ -19,38 +19,15 @@
 
 package org.apache.tuscany.implementation.java.invocation;
 
-import java.net.URI;
-
-import org.apache.tuscany.assembly.ComponentService;
-import org.apache.tuscany.assembly.Service;
 import org.apache.tuscany.core.RuntimeComponent;
-import org.apache.tuscany.core.RuntimeComponentService;
-import org.apache.tuscany.core.scope.CompositeScopeContainer;
 import org.apache.tuscany.databinding.DataBindingExtensionPoint;
 import org.apache.tuscany.implementation.java.JavaImplementation;
 import org.apache.tuscany.implementation.java.context.JavaPropertyValueObjectFactory;
 import org.apache.tuscany.implementation.java.impl.JavaImplementationImpl;
-import org.apache.tuscany.implementation.java.impl.JavaResourceImpl;
-import org.apache.tuscany.implementation.java.injection.ResourceHost;
-import org.apache.tuscany.implementation.java.injection.ResourceObjectFactory;
-import org.apache.tuscany.interfacedef.InterfaceContract;
-import org.apache.tuscany.interfacedef.Operation;
-import org.apache.tuscany.invocation.Interceptor;
-import org.apache.tuscany.invocation.Invoker;
 import org.apache.tuscany.invocation.ProxyFactory;
-import org.apache.tuscany.provider.ImplementationActivator;
 import org.apache.tuscany.provider.ImplementationProvider;
 import org.apache.tuscany.provider.ImplementationProviderFactory;
-import org.apache.tuscany.provider.ScopedImplementationProvider;
-import org.apache.tuscany.scope.InstanceWrapper;
-import org.apache.tuscany.scope.Scope;
-import org.apache.tuscany.scope.ScopeContainer;
-import org.apache.tuscany.scope.ScopeNotFoundException;
-import org.apache.tuscany.scope.ScopeRegistry;
-import org.apache.tuscany.spi.ObjectFactory;
-import org.apache.tuscany.spi.component.TargetInvokerCreationException;
 import org.apache.tuscany.spi.component.WorkContext;
-import org.osoa.sca.ComponentContext;
 
 /**
  * @version $Rev$ $Date$
@@ -73,7 +50,7 @@
         this.propertyValueObjectFactory = propertyValueObjectFactory;
     }
 
-    public ImplementationProvider createImplementationProvider() {
-        return new JavaImplementationProvider(this, proxyService, workContext, dataBindingRegistry, propertyValueObjectFactory);
+    public ImplementationProvider createImplementationProvider(RuntimeComponent component) {
+        return new JavaImplementationProvider(component, this, proxyService, workContext, dataBindingRegistry, propertyValueObjectFactory);
     }
 }

Modified: incubator/tuscany/java/sca/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementation.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementation.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementation.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementation.java Tue May  8 01:01:05 2007
@@ -18,6 +18,7 @@
  */
 package org.apache.tuscany.sca.implementation.script;
 
+import org.apache.tuscany.core.RuntimeComponent;
 import org.apache.tuscany.implementation.spi.AbstractImplementation;
 import org.apache.tuscany.implementation.spi.PropertyValueObjectFactory;
 import org.apache.tuscany.provider.ImplementationProvider;
@@ -57,7 +58,7 @@
         this.scriptSrc = scriptSrc;
     }
 
-    public ImplementationProvider createImplementationProvider() {
-        return new ScriptImplementationProvider(this);
+    public ImplementationProvider createImplementationProvider(RuntimeComponent component) {
+        return new ScriptImplementationProvider(component, this);
     }
 }

Modified: incubator/tuscany/java/sca/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementationProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementationProvider.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementationProvider.java (original)
+++ incubator/tuscany/java/sca/modules/implementation-script/src/main/java/org/apache/tuscany/sca/implementation/script/ScriptImplementationProvider.java Tue May  8 01:01:05 2007
@@ -50,22 +50,24 @@
  */
 public class ScriptImplementationProvider implements ImplementationProvider {
 
+    protected RuntimeComponent component;
     protected ScriptImplementation implementation;
     protected ScriptEngine scriptEngine;
 
-    public ScriptImplementationProvider(ScriptImplementation implementation) {
+    public ScriptImplementationProvider(RuntimeComponent component, ScriptImplementation implementation) {
+        this.component = component;
         this.implementation = implementation;
     }
 
-    public Invoker createInvoker(RuntimeComponent component, RuntimeComponentService service, Operation operation) {
+    public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
         return new ScriptInvoker(this, operation.getName());
     }
 
-    public Invoker createCallbackInvoker(RuntimeComponent component, Operation operation) {
+    public Invoker createCallbackInvoker(Operation operation) {
         return new ScriptInvoker(this, operation.getName());
     }
     
-    public void start(RuntimeComponent component) {
+    public void start() {
         try {
             scriptEngine = getScriptEngineByExtension(implementation.getScriptLanguage());
             if (scriptEngine == null) {
@@ -94,10 +96,10 @@
         }
     }
     
-    public void stop(RuntimeComponent component) {
+    public void stop() {
     }
     
-    public void configure(RuntimeComponent component) {
+    public void configure() {
     }
     
     public InterfaceContract getImplementationInterfaceContract(RuntimeComponentService service) {

Modified: incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/provider/EchoBindingProviderFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/provider/EchoBindingProviderFactory.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/provider/EchoBindingProviderFactory.java (original)
+++ incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/provider/EchoBindingProviderFactory.java Tue May  8 01:01:05 2007
@@ -19,6 +19,9 @@
 
 package echo.provider;
 
+import org.apache.tuscany.core.RuntimeComponent;
+import org.apache.tuscany.core.RuntimeComponentReference;
+import org.apache.tuscany.core.RuntimeComponentService;
 import org.apache.tuscany.provider.BindingProviderFactory;
 import org.apache.tuscany.provider.ReferenceBindingProvider;
 import org.apache.tuscany.provider.ServiceBindingProvider;
@@ -33,12 +36,12 @@
  */
 public class EchoBindingProviderFactory extends EchoBindingImpl implements BindingProviderFactory {
 
-    public ReferenceBindingProvider createReferenceBindingProvider() {
-        return new EchoReferenceBindingProvider();
+    public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component, RuntimeComponentReference reference) {
+        return new EchoReferenceBindingProvider(component, reference);
     }
 
-    public ServiceBindingProvider createServiceBindingProvider() {
-        return new EchoServiceBindingProvider(this);
+    public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, RuntimeComponentService service) {
+        return new EchoServiceBindingProvider(component, service, this);
     }
     
 }

Modified: incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/provider/EchoReferenceBindingProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/provider/EchoReferenceBindingProvider.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/provider/EchoReferenceBindingProvider.java (original)
+++ incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/provider/EchoReferenceBindingProvider.java Tue May  8 01:01:05 2007
@@ -21,7 +21,6 @@
 
 import org.apache.tuscany.core.RuntimeComponent;
 import org.apache.tuscany.core.RuntimeComponentReference;
-import org.apache.tuscany.core.RuntimeComponentService;
 import org.apache.tuscany.interfacedef.InterfaceContract;
 import org.apache.tuscany.interfacedef.Operation;
 import org.apache.tuscany.invocation.Invoker;
@@ -34,10 +33,16 @@
  * @version $Rev$ $Date$
  */
 public class EchoReferenceBindingProvider implements ReferenceBindingProvider {
+    
+    private RuntimeComponent component;
+    private RuntimeComponentReference reference;
+    
+    public EchoReferenceBindingProvider(RuntimeComponent component, RuntimeComponentReference reference) {
+        this.component = component;
+        this.reference = reference;
+    }
 
-    public Invoker createInvoker(RuntimeComponent component,
-                                         RuntimeComponentReference reference,
-                                         Operation operation,
+    public Invoker createInvoker(Operation operation,
                                          boolean isCallback) {
         if (isCallback) {
             throw new UnsupportedOperationException();
@@ -46,18 +51,14 @@
         }
     }
 
-    public InterfaceContract getBindingInterfaceContract(RuntimeComponentReference reference) {
+    public InterfaceContract getBindingInterfaceContract() {
         return reference.getInterfaceContract();
     }
 
-    public void start(RuntimeComponent component, RuntimeComponentReference reference) {
-    }
-
-    public void stop(RuntimeComponent component, RuntimeComponentReference reference) {
+    public void start() {
     }
 
-    public InterfaceContract getBindingInterfaceContract(RuntimeComponentService service) {
-        return service.getInterfaceContract();
+    public void stop() {
     }
 
 }

Modified: incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/provider/EchoServiceBindingProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/provider/EchoServiceBindingProvider.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/provider/EchoServiceBindingProvider.java (original)
+++ incubator/tuscany/java/sca/samples/binding-echo/src/main/java/echo/provider/EchoServiceBindingProvider.java Tue May  8 01:01:05 2007
@@ -37,17 +37,21 @@
  */
 public class EchoServiceBindingProvider implements ServiceBindingProvider {
     
+    private RuntimeComponent component;
+    private RuntimeComponentService service;  
     private EchoBinding binding;
     
-    public EchoServiceBindingProvider(EchoBinding binding) {
+    public EchoServiceBindingProvider(RuntimeComponent component, RuntimeComponentService service, EchoBinding binding) {
+        this.component = component;
+        this.service = service;
         this.binding = binding;
     }
 
-    public InterfaceContract getBindingInterfaceContract(RuntimeComponentService service) {
+    public InterfaceContract getBindingInterfaceContract() {
         return service.getInterfaceContract();
     }
 
-    public void start(RuntimeComponent component, RuntimeComponentService service) {
+    public void start() {
 
         RuntimeComponentService componentService = (RuntimeComponentService) service;
         RuntimeWire wire = componentService.getRuntimeWire(binding);
@@ -58,7 +62,7 @@
         EchoServer.getServer().register(uri, new EchoService(chain.getHeadInvoker()));
     }
 
-    public void stop(RuntimeComponent component, RuntimeComponentService service) {
+    public void stop() {
         
         // Unregister from the hosting server
         String uri = component.getURI() + "/" + binding.getName();

Modified: incubator/tuscany/java/sca/samples/databinding-echo/src/main/java/echo/provider/EchoBindingProviderFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/databinding-echo/src/main/java/echo/provider/EchoBindingProviderFactory.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/samples/databinding-echo/src/main/java/echo/provider/EchoBindingProviderFactory.java (original)
+++ incubator/tuscany/java/sca/samples/databinding-echo/src/main/java/echo/provider/EchoBindingProviderFactory.java Tue May  8 01:01:05 2007
@@ -19,6 +19,9 @@
 
 package echo.provider;
 
+import org.apache.tuscany.core.RuntimeComponent;
+import org.apache.tuscany.core.RuntimeComponentReference;
+import org.apache.tuscany.core.RuntimeComponentService;
 import org.apache.tuscany.provider.BindingProviderFactory;
 import org.apache.tuscany.provider.ReferenceBindingProvider;
 import org.apache.tuscany.provider.ServiceBindingProvider;
@@ -33,12 +36,12 @@
  */
 public class EchoBindingProviderFactory extends EchoBindingImpl implements BindingProviderFactory {
 
-    public ReferenceBindingProvider createReferenceBindingProvider() {
-        return new EchoReferenceBindingProvider();
+    public ReferenceBindingProvider createReferenceBindingProvider(RuntimeComponent component, RuntimeComponentReference reference) {
+        return new EchoReferenceBindingProvider(component, reference);
     }
 
-    public ServiceBindingProvider createServiceBindingProvider() {
-        return new EchoServiceBindingProvider(this);
+    public ServiceBindingProvider createServiceBindingProvider(RuntimeComponent component, RuntimeComponentService service) {
+        return new EchoServiceBindingProvider(component, service, this);
     }
     
 }

Modified: incubator/tuscany/java/sca/samples/databinding-echo/src/main/java/echo/provider/EchoReferenceBindingProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/databinding-echo/src/main/java/echo/provider/EchoReferenceBindingProvider.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/samples/databinding-echo/src/main/java/echo/provider/EchoReferenceBindingProvider.java (original)
+++ incubator/tuscany/java/sca/samples/databinding-echo/src/main/java/echo/provider/EchoReferenceBindingProvider.java Tue May  8 01:01:05 2007
@@ -21,7 +21,6 @@
 
 import org.apache.tuscany.core.RuntimeComponent;
 import org.apache.tuscany.core.RuntimeComponentReference;
-import org.apache.tuscany.core.RuntimeComponentService;
 import org.apache.tuscany.interfacedef.InterfaceContract;
 import org.apache.tuscany.interfacedef.Operation;
 import org.apache.tuscany.invocation.Invoker;
@@ -34,10 +33,16 @@
  * @version $Rev$ $Date$
  */
 public class EchoReferenceBindingProvider implements ReferenceBindingProvider {
+    
+    private RuntimeComponent component;
+    private RuntimeComponentReference reference;
+    
+    public EchoReferenceBindingProvider(RuntimeComponent component, RuntimeComponentReference reference) {
+        this.component = component;
+        this.reference = reference;
+    }
 
-    public Invoker createInvoker(RuntimeComponent component,
-                                         RuntimeComponentReference reference,
-                                         Operation operation,
+    public Invoker createInvoker(Operation operation,
                                          boolean isCallback) {
         if (isCallback) {
             throw new UnsupportedOperationException();
@@ -46,18 +51,14 @@
         }
     }
 
-    public InterfaceContract getBindingInterfaceContract(RuntimeComponentReference reference) {
+    public InterfaceContract getBindingInterfaceContract() {
         return reference.getInterfaceContract();
     }
 
-    public void start(RuntimeComponent component, RuntimeComponentReference reference) {
-    }
-
-    public void stop(RuntimeComponent component, RuntimeComponentReference reference) {
+    public void start() {
     }
 
-    public InterfaceContract getBindingInterfaceContract(RuntimeComponentService service) {
-        return service.getInterfaceContract();
+    public void stop() {
     }
 
 }

Modified: incubator/tuscany/java/sca/samples/databinding-echo/src/main/java/echo/provider/EchoServiceBindingProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/databinding-echo/src/main/java/echo/provider/EchoServiceBindingProvider.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/samples/databinding-echo/src/main/java/echo/provider/EchoServiceBindingProvider.java (original)
+++ incubator/tuscany/java/sca/samples/databinding-echo/src/main/java/echo/provider/EchoServiceBindingProvider.java Tue May  8 01:01:05 2007
@@ -37,17 +37,21 @@
  */
 public class EchoServiceBindingProvider implements ServiceBindingProvider {
     
+    private RuntimeComponent component;
+    private RuntimeComponentService service;  
     private EchoBinding binding;
     
-    public EchoServiceBindingProvider(EchoBinding binding) {
+    public EchoServiceBindingProvider(RuntimeComponent component, RuntimeComponentService service, EchoBinding binding) {
+        this.component = component;
+        this.service = service;
         this.binding = binding;
     }
 
-    public InterfaceContract getBindingInterfaceContract(RuntimeComponentService service) {
+    public InterfaceContract getBindingInterfaceContract() {
         return service.getInterfaceContract();
     }
 
-    public void start(RuntimeComponent component, RuntimeComponentService service) {
+    public void start() {
 
         RuntimeComponentService componentService = (RuntimeComponentService) service;
         RuntimeWire wire = componentService.getRuntimeWire(binding);
@@ -58,7 +62,7 @@
         EchoServer.getServer().register(uri, new EchoService(chain.getHeadInvoker()));
     }
 
-    public void stop(RuntimeComponent component, RuntimeComponentService service) {
+    public void stop() {
         
         // Unregister from the hosting server
         String uri = component.getURI() + "/" + binding.getName();

Modified: incubator/tuscany/java/sca/samples/implementation-crud/src/main/java/crud/provider/CRUDImplementationProvider.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-crud/src/main/java/crud/provider/CRUDImplementationProvider.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/samples/implementation-crud/src/main/java/crud/provider/CRUDImplementationProvider.java (original)
+++ incubator/tuscany/java/sca/samples/implementation-crud/src/main/java/crud/provider/CRUDImplementationProvider.java Tue May  8 01:01:05 2007
@@ -42,21 +42,23 @@
  */
 public class CRUDImplementationProvider implements ImplementationProvider {
     
+    private RuntimeComponent component;
     private CRUDImplementation implementation;
 
     /**
      * Constructs a new CRUD implementation.
      */
-    public CRUDImplementationProvider(CRUDImplementation implementation) {
+    public CRUDImplementationProvider(RuntimeComponent component, CRUDImplementation implementation) {
+        this.component = component;
         this.implementation = implementation;
     }
 
-    public Invoker createInvoker(RuntimeComponent component, RuntimeComponentService service, Operation operation) {
+    public Invoker createInvoker(RuntimeComponentService service, Operation operation) {
         CRUDInvoker invoker = new CRUDInvoker(operation, new ResourceManager(implementation.getDirectory()));
         return invoker;
     }
 
-    public Invoker createCallbackInvoker(RuntimeComponent component, Operation operation) {
+    public Invoker createCallbackInvoker(Operation operation) {
         CRUDInvoker invoker = new CRUDInvoker(operation, new ResourceManager(implementation.getDirectory()));
         return invoker;
     }
@@ -65,16 +67,12 @@
         return service.getInterfaceContract();
     }
 
-    public void start(RuntimeComponent component) {
+    public void start() {
         System.out.println("Starting " + component.getName());
     }
 
-    public void stop(RuntimeComponent component) {
+    public void stop() {
         System.out.println("Stopping " + component.getName());
-    }
-
-    public void configure(RuntimeComponent component) {
-        System.out.println("Configuring " + component.getName());
     }
 
 }

Modified: incubator/tuscany/java/sca/samples/implementation-crud/src/main/java/crud/provider/CRUDImplementationProviderFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-crud/src/main/java/crud/provider/CRUDImplementationProviderFactory.java?view=diff&rev=536114&r1=536113&r2=536114
==============================================================================
--- incubator/tuscany/java/sca/samples/implementation-crud/src/main/java/crud/provider/CRUDImplementationProviderFactory.java (original)
+++ incubator/tuscany/java/sca/samples/implementation-crud/src/main/java/crud/provider/CRUDImplementationProviderFactory.java Tue May  8 01:01:05 2007
@@ -19,6 +19,7 @@
 package crud.provider;
 
 import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.core.RuntimeComponent;
 import org.apache.tuscany.interfacedef.java.JavaInterfaceFactory;
 import org.apache.tuscany.interfacedef.java.introspect.JavaInterfaceIntrospector;
 import org.apache.tuscany.provider.ImplementationProvider;
@@ -44,8 +45,7 @@
         super(assemblyFactory, javaFactory, introspector);
     }
 
-    
-    public ImplementationProvider createImplementationProvider() {
-        return new CRUDImplementationProvider(this);
+    public ImplementationProvider createImplementationProvider(RuntimeComponent component) {
+        return new CRUDImplementationProvider(component, this);
     }
 }



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