You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jm...@apache.org on 2007/02/17 09:35:25 UTC

svn commit: r508732 [7/8] - in /incubator/tuscany/java/sca: kernel/core/src/main/java/org/apache/tuscany/core/binding/local/ kernel/core/src/main/java/org/apache/tuscany/core/bootstrap/ kernel/core/src/main/java/org/apache/tuscany/core/builder/ kernel/...

Copied: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKInvocationHandlerTestCase.java (from r507339, incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKOutboundInvocationHandlerTestCase.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKInvocationHandlerTestCase.java?view=diff&rev=508732&p1=incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKOutboundInvocationHandlerTestCase.java&r1=507339&p2=incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKInvocationHandlerTestCase.java&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKOutboundInvocationHandlerTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKInvocationHandlerTestCase.java Sat Feb 17 00:35:19 2007
@@ -22,12 +22,10 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.Type;
+import java.net.URI;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 import java.util.UUID;
-import java.net.URI;
 
 import org.apache.tuscany.spi.component.WorkContext;
 import org.apache.tuscany.spi.idl.java.JavaServiceContract;
@@ -36,87 +34,80 @@
 import org.apache.tuscany.spi.model.Operation;
 import org.apache.tuscany.spi.model.Scope;
 import org.apache.tuscany.spi.model.ServiceContract;
+import org.apache.tuscany.spi.wire.InvocationChain;
 import org.apache.tuscany.spi.wire.InvocationRuntimeException;
 import org.apache.tuscany.spi.wire.Message;
-import org.apache.tuscany.spi.wire.OutboundInvocationChain;
-import org.apache.tuscany.spi.wire.OutboundWire;
 import org.apache.tuscany.spi.wire.TargetInvoker;
+import org.apache.tuscany.spi.wire.Wire;
 
 import junit.framework.TestCase;
 import org.apache.tuscany.core.component.WorkContextImpl;
-import org.apache.tuscany.core.wire.OutboundWireImpl;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
+import org.apache.tuscany.core.wire.InvocationChainImpl;
+import org.apache.tuscany.core.wire.WireImpl;
 
 /**
  * @version $Rev$ $Date$
  */
-public class JDKOutboundInvocationHandlerTestCase extends TestCase {
+public class JDKInvocationHandlerTestCase extends TestCase {
 
     public void testToString() {
-        OutboundWireImpl wire = new OutboundWireImpl();
+        Wire wire = new WireImpl();
         ServiceContract contract = new JavaServiceContract(Foo.class);
         contract.setInteractionScope(InteractionScope.NONCONVERSATIONAL);
-        wire.setServiceContract(contract);
+        wire.setSourceContract(contract);
         wire.setSourceUri(URI.create("foo#bar"));
-        JDKOutboundInvocationHandler handler = new JDKOutboundInvocationHandler(Foo.class, wire, null);
+        JDKInvocationHandler handler = new JDKInvocationHandler(Foo.class, wire, null);
         Foo foo = (Foo) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{Foo.class}, handler);
         assertNotNull(foo.toString());
     }
 
     public void testHashCode() {
-        OutboundWireImpl wire = new OutboundWireImpl();
+        Wire wire = new WireImpl();
         ServiceContract contract = new JavaServiceContract(Foo.class);
         contract.setInteractionScope(InteractionScope.NONCONVERSATIONAL);
-        wire.setServiceContract(contract);
+        wire.setSourceContract(contract);
         wire.setSourceUri(URI.create("foo#bar"));
-        JDKOutboundInvocationHandler handler = new JDKOutboundInvocationHandler(Foo.class, wire, null);
+        JDKInvocationHandler handler = new JDKInvocationHandler(Foo.class, wire, null);
         Foo foo = (Foo) Proxy.newProxyInstance(getClass().getClassLoader(), new Class[]{Foo.class}, handler);
         assertNotNull(foo.hashCode());
     }
 
     public void testConversational() throws Throwable {
-        OutboundWire outboundWire = createMock(OutboundWire.class);
-        Map<Operation<?>, OutboundInvocationChain> outboundChains =
-            new HashMap<Operation<?>, OutboundInvocationChain>();
+        Wire wire = new WireImpl();
         DataType<Type> type1 = new DataType<Type>(String.class, String.class);
         List<DataType<Type>> types = new ArrayList<DataType<Type>>();
         types.add(type1);
         DataType<List<DataType<Type>>> inputType1 = new DataType<List<DataType<Type>>>(Object[].class, types);
         DataType<Type> outputType1 = new DataType<Type>(String.class, String.class);
         Operation<Type> op1 = new Operation<Type>("test", inputType1, outputType1, null);
-        ServiceContract<Type> outboundContract = new JavaServiceContract(Foo.class);
-        outboundContract.setInteractionScope(InteractionScope.CONVERSATIONAL);
-        op1.setServiceContract(outboundContract);
+        ServiceContract<Type> contract = new JavaServiceContract(Foo.class);
+        contract.setInteractionScope(InteractionScope.CONVERSATIONAL);
+        op1.setServiceContract(contract);
 
         WorkContext wc = new WorkContextImpl();
         MockInvoker invoker = new MockInvoker(wc);
-        OutboundInvocationChain outboundChain = createMock(OutboundInvocationChain.class);
-        expect(outboundChain.getTargetInvoker()).andReturn(invoker).anyTimes();
-        expect(outboundChain.getHeadInterceptor()).andReturn(null).anyTimes();
-        replay(outboundChain);
-        outboundChains.put(op1, outboundChain);
-        expect(outboundWire.getOutboundInvocationChains()).andReturn(outboundChains).anyTimes();
+
+        InvocationChain chain = new InvocationChainImpl(op1);
+        chain.setTargetInvoker(invoker);
+        wire.addInvocationChain(op1, chain);
         URI uri = URI.create("fooRef");
-        expect(outboundWire.getSourceUri()).andReturn(uri).atLeastOnce();
-        expect(outboundWire.getServiceContract()).andReturn(outboundContract).anyTimes();
-        replay(outboundWire);
+        wire.setSourceUri(uri);
+        wire.setSourceContract(contract);
 
         String convID = UUID.randomUUID().toString();
         wc.setIdentifier(Scope.CONVERSATION, convID);
         invoker.setCurrentConversationID(convID);
 
-        outboundContract.setRemotable(true);
+        contract.setRemotable(true);
         invoker.setRemotableTest(true);
-        JDKOutboundInvocationHandler handler = new JDKOutboundInvocationHandler(Foo.class, outboundWire, wc);
+        JDKInvocationHandler handler = new JDKInvocationHandler(Foo.class, wire, wc);
         handler.invoke(Foo.class.getMethod("test", String.class), new Object[]{"bar"});
         String currentConvID = (String) wc.getIdentifier(Scope.CONVERSATION);
         assertSame(convID, currentConvID);
 
-        outboundContract.setRemotable(false);
+        contract.setRemotable(false);
         invoker.setRemotableTest(false);
-        JDKOutboundInvocationHandler handler2 = new JDKOutboundInvocationHandler(Foo.class, outboundWire, wc);
+        JDKInvocationHandler handler2 = new JDKInvocationHandler(Foo.class, wire, wc);
         handler2.invoke(Foo.class.getMethod("test", String.class), new Object[]{"bar"});
         currentConvID = (String) wc.getIdentifier(Scope.CONVERSATION);
         assertSame(convID, currentConvID);

Propchange: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKInvocationHandlerTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKInvocationHandlerTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKProxyTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKProxyTestCase.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKProxyTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKProxyTestCase.java Sat Feb 17 00:35:19 2007
@@ -19,40 +19,34 @@
 package org.apache.tuscany.core.wire.jdk;
 
 import java.lang.reflect.Proxy;
-import java.util.HashMap;
-import java.util.Map;
 import java.net.URI;
 
-import org.apache.tuscany.spi.model.Operation;
-import org.apache.tuscany.spi.wire.InboundInvocationChain;
-import org.apache.tuscany.spi.wire.InboundWire;
+import org.apache.tuscany.spi.model.ServiceContract;
+import org.apache.tuscany.spi.wire.Wire;
 
 import junit.framework.TestCase;
-import org.easymock.EasyMock;
+import org.apache.tuscany.core.wire.WireImpl;
 
 /**
  * @version $Rev$ $Date$
  */
 public class JDKProxyTestCase extends TestCase {
     private JDKWireService wireService;
-    private InboundWire inboundWire;
-    private Map<Operation<?>, InboundInvocationChain> chains;
 
     public void testCreateProxy() {
         URI uri = URI.create("#service");
-        EasyMock.expect(inboundWire.getSourceUri()).andReturn(uri).atLeastOnce();
-        EasyMock.expect(inboundWire.getInboundInvocationChains()).andReturn(chains);
-        EasyMock.replay(inboundWire);
-        TestInterface intf = wireService.createProxy(TestInterface.class, inboundWire);
-        assertTrue(Proxy.isProxyClass(intf.getClass()));
-        EasyMock.verify(inboundWire);
+        Wire wire = new WireImpl();
+        wire.setSourceUri(uri);
+        ServiceContract contract = new ServiceContract() {
+        };
+        wire.setSourceContract(contract);
+        TestInterface proxy = wireService.createProxy(TestInterface.class, wire);
+        assertTrue(Proxy.isProxyClass(proxy.getClass()));
     }
 
     protected void setUp() throws Exception {
         super.setUp();
         wireService = new JDKWireService();
-        inboundWire = EasyMock.createMock(InboundWire.class);
-        chains = new HashMap<Operation<?>, InboundInvocationChain>();
     }
 
     public static interface TestInterface {

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/builder/Connector.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/builder/Connector.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/builder/Connector.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/builder/Connector.java Sat Feb 17 00:35:19 2007
@@ -18,35 +18,33 @@
  */
 package org.apache.tuscany.spi.builder;
 
-import org.apache.tuscany.spi.component.SCAObject;
-import org.apache.tuscany.spi.wire.InboundWire;
-import org.apache.tuscany.spi.wire.OutboundWire;
+import org.apache.tuscany.spi.model.ComponentDefinition;
+import org.apache.tuscany.spi.model.Implementation;
+import org.apache.tuscany.spi.model.physical.WireDefinition;
 
 /**
- * Implementations are responsible for bridging invocation chains as an assembly is converted to runtime artifacts
+ * Implementations are responsible for creating a wires between source and target artifacts
  *
  * @version $$Rev$$ $$Date$$
  */
 public interface Connector {
 
     /**
-     * Connects the given source's wires to corresponding wires to a target. Wires are connected by bridging invocation
-     * chains.
+     * Recursively connects component references and its children. This method will eventially be replaced by one that
+     * just takes a WireDefinition
      *
-     * @param source the source, i.e. a <code>ServiceBinding</code>, <code>Component</code>, or <code>Reference</code>
+     * @param definition the component definition to connect
      * @throws WiringException
+     * @deprecated
      */
-    void connect(SCAObject source) throws WiringException;
+    void connect(ComponentDefinition<? extends Implementation<?>> definition) throws WiringException;
 
     /**
-     * Bridges the invocation chains associated with an inbound and outbound wire.
+     * Placeholder for the connect operation using federated deployment
      *
-     * @param source      the inbound wire source
-     * @param inbound     the wire to bridge from
-     * @param outbound    the target wire
-     * @param optimizable if the bridge may be optimized @throws WiringException
+     * @param definition metadata describing the wire to create
+     * @throws WiringException
      */
-    void connect(SCAObject source, InboundWire inbound, SCAObject target, OutboundWire outbound, boolean optimizable)
-        throws WiringException;
+    void connect(WireDefinition definition) throws WiringException;
 
 }

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/AtomicComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/AtomicComponent.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/AtomicComponent.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/AtomicComponent.java Sat Feb 17 00:35:19 2007
@@ -18,11 +18,7 @@
  */
 package org.apache.tuscany.spi.component;
 
-import java.util.List;
-
 import org.apache.tuscany.spi.ObjectCreationException;
-import org.apache.tuscany.spi.wire.InboundWire;
-import org.apache.tuscany.spi.wire.OutboundWire;
 
 /**
  * The runtime instantiation of an SCA atomic, or leaf-type, component
@@ -66,24 +62,6 @@
      * @return the maximum age a conversation may remain active in milliseconds if the implementation is conversational
      */
     long getMaxAge();
-
-    /**
-     * Adds a target-side wire. Target-side wire factories contain the invocation chains associated with the destination
-     * service of a wire
-     */
-    void addInboundWire(InboundWire wire);
-
-    /**
-     * Adds a source-side wire for the given reference. Source-side wires contain the invocation chains for a reference
-     * in the implementation associated with the instance wrapper created by this configuration.
-     */
-    void addOutboundWire(OutboundWire wire);
-
-    /**
-     * Adds a set of source-side multiplicity wires for the given reference. Source-side wires contain the invocation
-     * chains for a reference in the implementation associated with the instance wrapper created by this configuration.
-     */
-    void addOutboundWires(List<OutboundWire> wires);
 
     /**
      * Notifies the given instance of an initialization event.

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/Component.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/Component.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/Component.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/Component.java Sat Feb 17 00:35:19 2007
@@ -18,25 +18,21 @@
  */
 package org.apache.tuscany.spi.component;
 
-import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 
 import org.osoa.sca.ComponentContext;
 
-import org.apache.tuscany.spi.model.Operation;
 import org.apache.tuscany.spi.model.PropertyValue;
 import org.apache.tuscany.spi.model.Scope;
-import org.apache.tuscany.spi.wire.InboundWire;
-import org.apache.tuscany.spi.wire.OutboundWire;
-import org.apache.tuscany.spi.wire.TargetInvoker;
+import org.apache.tuscany.spi.wire.Wire;
 
 /**
  * The runtime instantiation of an SCA component
  *
  * @version $$Rev$$ $$Date$$
  */
-public interface Component extends SCAObject {
+public interface Component extends Invocable {
 
     /**
      * Returns the component scope
@@ -60,6 +56,13 @@
     void setScopeContainer(ScopeContainer scopeContainer);
 
     /**
+     * Returns a collection of wires for the component associated with a reference name
+     *
+     * @return a collection of wires for the component associated with a reference name
+     */
+    List<Wire> getWires(String name);
+
+    /**
      * Returns the default property values associated with the component.
      *
      * @return default property values associated with the component.
@@ -81,45 +84,24 @@
     boolean isOptimizable();
 
     /**
-     * Returns the wire associated with the given service name or null if not found.
+     * Attaches a callback wire to the comoponent
      *
-     * @return the wire associated with the given service name or null if not found.
+     * @param wire the wire to attach
      */
-    InboundWire getInboundWire(String serviceName);
+    void attachCallbackWire(Wire wire);
 
     /**
-     * Returns the inbound wire associated with the given target name or null if not found.  Targets can be services or
-     * references in the case of composites.
+     * Attaches a wire to a component reference
      *
-     * @param targetName the target service name or null if the default service should be returned
-     * @return the wire associated with the given service name or null if not found.
+     * @param wire the wire to attach
      */
-    InboundWire getTargetWire(String targetName);
+    void attachWire(Wire wire);
 
     /**
-     * Returns a map of inbound wires.
+     * Attaches a set of wires to a comoponent reference. Used for multiplicity.
      *
-     * @return a map of inbound wires.
+     * @param wires the wire to attach
      */
-    Collection<InboundWire> getInboundWires();
+    void attachWires(List<Wire> wires);
 
-    /**
-     * Returns a map of source-side wires for references. There may be 1..n wires per reference.
-     *
-     * @return a map of source-side wires for references.
-     */
-    Map<String, List<OutboundWire>> getOutboundWires();
-
-    /**
-     * Callback to create a {@link org.apache.tuscany.spi.wire.TargetInvoker} which dispatches to a service offered by
-     * the component
-     *
-     * @param targetName   the service name
-     * @param operation    the operation to invoke
-     * @param callbackWire the callback wire or null if the associated wire is unidirectional
-     * @return the target invoker
-     * @throws TargetInvokerCreationException
-     */
-    TargetInvoker createTargetInvoker(String targetName, Operation operation, InboundWire callbackWire)
-        throws TargetInvokerCreationException;
 }

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/CompositeComponent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/CompositeComponent.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/CompositeComponent.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/CompositeComponent.java Sat Feb 17 00:35:19 2007
@@ -58,11 +58,27 @@
     void register(Reference reference) throws RegistrationException;
 
     /**
+     * Returns the service with the given name or null if not found
+     *
+     * @param name the service name which is relative to the composite
+     * @return the service with the given name or null if not found
+     */
+    Service getService(String name);
+
+    /**
      * Returns the services for the component
      *
      * @return the services for the component
      */
     List<Service> getServices();
+
+    /**
+     * Returns the reference with the given name or null if not found
+     *
+     * @param name the reference name which is relative to the composite
+     * @return the reference with the given name or null if not found
+     */
+    Reference getReference(String name);
 
     /**
      * Returns the references for the component

Added: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/Invocable.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/Invocable.java?view=auto&rev=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/Invocable.java (added)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/Invocable.java Sat Feb 17 00:35:19 2007
@@ -0,0 +1,40 @@
+/*
+ * 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.spi.component;
+
+import org.apache.tuscany.spi.model.Operation;
+import org.apache.tuscany.spi.wire.TargetInvoker;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface Invocable extends SCAObject {
+
+    /**
+     * Callback to create a {@link org.apache.tuscany.spi.wire.TargetInvoker} which dispatches to a service offered this
+     * artifact
+     *
+     * @param targetName the service name
+     * @param operation  the operation to invoke
+     * @return the target invoker
+     * @throws TargetInvokerCreationException
+     */
+    TargetInvoker createTargetInvoker(String targetName, Operation operation) throws TargetInvokerCreationException;
+
+}

Propchange: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/Invocable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/Invocable.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ReferenceBinding.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ReferenceBinding.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ReferenceBinding.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ReferenceBinding.java Sat Feb 17 00:35:19 2007
@@ -18,20 +18,18 @@
  */
 package org.apache.tuscany.spi.component;
 
+import java.net.URI;
 import javax.xml.namespace.QName;
 
-import org.apache.tuscany.spi.model.Operation;
 import org.apache.tuscany.spi.model.ServiceContract;
-import org.apache.tuscany.spi.wire.InboundWire;
-import org.apache.tuscany.spi.wire.OutboundWire;
-import org.apache.tuscany.spi.wire.TargetInvoker;
+import org.apache.tuscany.spi.wire.Wire;
 
 /**
  * Manages an SCA reference configured with a binding
  *
  * @version $Rev$ $Date$
  */
-public interface ReferenceBinding extends SCAObject {
+public interface ReferenceBinding extends Invocable {
 
     /**
      * Returns the binding qualified name
@@ -39,50 +37,29 @@
      * @return the binding qualified name
      */
     QName getBindingType();
-    
-    /**
-     * Sets the parent reference for the binding
-     *
-     * @param reference the parent reference for the binding
-     */
-    void setReference(Reference reference);
-
-    /**
-     * Returns the inbound wire for flowing a request through the reference
-     */
-    InboundWire getInboundWire();
 
     /**
-     * Sets the inbound wire for flowing a request through the reference
+     * Returns the wire for flowing a request through the reference
      */
-    void setInboundWire(InboundWire wire);
+    Wire getWire();
 
     /**
-     * Returns the outbound wire used by the reference to connect to a target
+     * Sets the wire wire for flowing a request through the reference
      */
-    OutboundWire getOutboundWire();
+    void setWire(Wire wire);
 
     /**
-     * Sets the outbound wire used by the reference to connect to a target
-     */
-    void setOutboundWire(OutboundWire wire);
-
-    /**
-     * Callback to create a {@link org.apache.tuscany.spi.wire.TargetInvoker} which dispatches to the target service of
-     * the reference
+     * Returns the service contract for the binding
      *
-     * @param contract  the service contract to invoke on
-     * @param operation the operation to invoke
-     * @throws TargetInvokerCreationException
+     * @return the service contract for the binding
      */
-    TargetInvoker createTargetInvoker(ServiceContract contract, Operation operation)
-        throws TargetInvokerCreationException;
+    ServiceContract<?> getBindingServiceContract();
 
     /**
-     * Returns the service contract for the binding
+     * Returns the target URI for the binding
      *
-     * @return the service contract for the binding
+     * @return the target URI for the binding
      */
-    ServiceContract<?> getBindingServiceContract();
+    URI getTargetUri();
 
 }

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ServiceBinding.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ServiceBinding.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ServiceBinding.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/ServiceBinding.java Sat Feb 17 00:35:19 2007
@@ -20,18 +20,15 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.tuscany.spi.model.Operation;
 import org.apache.tuscany.spi.model.ServiceContract;
-import org.apache.tuscany.spi.wire.InboundWire;
-import org.apache.tuscany.spi.wire.OutboundWire;
-import org.apache.tuscany.spi.wire.TargetInvoker;
+import org.apache.tuscany.spi.wire.Wire;
 
 /**
  * The runtime instantiation of an SCA service binding.
  *
  * @version $Rev$ $Date$
  */
-public interface ServiceBinding extends SCAObject {
+public interface ServiceBinding extends Invocable {
 
     /**
      * Returns the binding qualified name
@@ -41,55 +38,14 @@
     QName getBindingType();
 
     /**
-     * Sets the parent service for the binding
-     *
-     * @param service the parent service for the binding
-     */
-    void setService(Service service);
-
-    /**
      * Get the ServiceContract for the binding
      *
      * @return the ServiceContract for the binding
      */
     ServiceContract<?> getBindingServiceContract();
 
-    /**
-     * Returns the inbound wire for flowing a request through the service
-     *
-     * @return the inbound wire for flowing a request through the service
-     */
-    InboundWire getInboundWire();
-
-    /**
-     * Sets the inbound wire for flowing a request through the service
-     *
-     * @param wire the inbound wire for flowing a request through the service
-     */
-    void setInboundWire(InboundWire wire);
-
-    /**
-     * Returns the outbound wire for flowing a request out of the service
-     *
-     * @return the outbound wire for flowing a request out of the service
-     */
-    OutboundWire getOutboundWire();
+    Wire getWire();
 
-    /**
-     * Sets the outbound wire for flowing a request out of the service
-     *
-     * @param wire the outbound wire for flowing a request out of the service
-     */
-    void setOutboundWire(OutboundWire wire);
-
-    /**
-     * Returns the target invoker for dispatching callback invocations
-     *
-     * @param contract  the callback contract
-     * @param operation the callback operation the target invoker dispatches to
-     * @throws TargetInvokerCreationException
-     */
-    TargetInvoker createTargetInvoker(ServiceContract contract, Operation operation)
-        throws TargetInvokerCreationException;
+    void setWire(Wire wire);
 
 }

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/WorkContext.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/WorkContext.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/WorkContext.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/component/WorkContext.java Sat Feb 17 00:35:19 2007
@@ -18,8 +18,8 @@
  */
 package org.apache.tuscany.spi.component;
 
-import java.util.LinkedList;
 import java.net.URI;
+import java.util.LinkedList;
 
 /**
  * Implementations track information associated with a request as it is processed by the runtime
@@ -50,14 +50,20 @@
     void setCurrentAtomicComponent(AtomicComponent component);
 
     /**
-     * Returns the current chain of SCAObject addresses
+     * Returns an ordered list of callback URIs for the current context. Ordering is based on the sequence of service
+     * invocations for collocated components
+     *
+     * @return the current list of callback URIs
      */
-    LinkedList<URI> getCurrentCallbackRoutingChain();
+    LinkedList<URI> getCurrentCallbackUris();
 
     /**
-     * Sets the current stack of SCAObject addresses
+     * Sets an ordered list of callback URIs for the current context. Ordering is based on the sequence of service
+     * invocations for collocated components
+     *
+     * @return the current list of callback URIs
      */
-    void setCurrentCallbackRoutingChain(LinkedList<URI> callbackRoutingChain);
+    void setCurrentCallbackUris(LinkedList<URI> uris);
 
     /**
      * Returns the composite where a remote request came in

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/AtomicComponentExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/AtomicComponentExtension.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/AtomicComponentExtension.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/AtomicComponentExtension.java Sat Feb 17 00:35:19 2007
@@ -19,12 +19,6 @@
 package org.apache.tuscany.spi.extension;
 
 import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 
 import org.apache.tuscany.spi.CoreRuntimeException;
 import org.apache.tuscany.spi.component.AtomicComponent;
@@ -35,8 +29,6 @@
 import org.apache.tuscany.spi.component.WorkContext;
 import org.apache.tuscany.spi.model.Scope;
 import org.apache.tuscany.spi.services.work.WorkScheduler;
-import org.apache.tuscany.spi.wire.InboundWire;
-import org.apache.tuscany.spi.wire.OutboundWire;
 import org.apache.tuscany.spi.wire.WireService;
 
 /**
@@ -47,8 +39,6 @@
 public abstract class AtomicComponentExtension extends AbstractComponentExtension implements AtomicComponent {
     protected ScopeContainer scopeContainer;
     protected Scope scope;
-    protected Map<String, InboundWire> serviceWires = new HashMap<String, InboundWire>();
-    protected Map<String, List<OutboundWire>> referenceWires = new HashMap<String, List<OutboundWire>>();
     protected WireService wireService;
     protected WorkContext workContext;
     protected WorkScheduler workScheduler;
@@ -138,58 +128,8 @@
 
     }
 
-    public void addInboundWire(InboundWire wire) {
-        serviceWires.put(wire.getSourceUri().getFragment(), wire);
-        onServiceWire(wire);
-    }
-
-    public InboundWire getInboundWire(String serviceName) {
-        if (serviceName == null) {
-            if (serviceWires.size() < 1) {
-                return null;
-            }
-            return serviceWires.values().iterator().next();
-        } else {
-            return serviceWires.get(serviceName);
-        }
-    }
-
-    public InboundWire getTargetWire(String targetName) {
-        return getInboundWire(targetName);
-    }
-
-    public Collection<InboundWire> getInboundWires() {
-        return Collections.unmodifiableCollection(serviceWires.values());
-    }
-
-    public void addOutboundWire(OutboundWire wire) {
-        List<OutboundWire> list = new ArrayList<OutboundWire>();
-        list.add(wire);
-        referenceWires.put(wire.getSourceUri().getFragment(), list);
-        onReferenceWire(wire);
-    }
-
-    public Map<String, List<OutboundWire>> getOutboundWires() {
-        return Collections.unmodifiableMap(referenceWires);
-    }
-
-    public void addOutboundWires(List<OutboundWire> wires) {
-        assert wires != null && wires.size() > 0;
-        referenceWires.put(wires.get(0).getSourceUri().getFragment(), wires);
-        onReferenceWires(wires);
-    }
-
     public void removeInstance() throws ComponentException {
         scopeContainer.remove(this);
-    }
-
-    protected void onReferenceWire(OutboundWire wire) {
-    }
-
-    protected void onReferenceWires(List<OutboundWire> wires) {
-    }
-
-    protected void onServiceWire(InboundWire wire) {
     }
 
 }

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/BindingBuilderExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/BindingBuilderExtension.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/BindingBuilderExtension.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/BindingBuilderExtension.java Sat Feb 17 00:35:19 2007
@@ -32,7 +32,6 @@
 import org.apache.tuscany.spi.model.BindingDefinition;
 import org.apache.tuscany.spi.model.ReferenceDefinition;
 import org.apache.tuscany.spi.model.ServiceDefinition;
-import org.apache.tuscany.spi.wire.WireService;
 
 /**
  * An extension point for binding builders. When adding support for new serviceBindings, implementations may extend this
@@ -42,18 +41,11 @@
  */
 @EagerInit
 public abstract class BindingBuilderExtension<B extends BindingDefinition> implements BindingBuilder<B> {
-
     protected BuilderRegistry builderRegistry;
-    protected WireService wireService;
 
     @Autowire
     public void setBuilderRegistry(BuilderRegistry registry) {
         this.builderRegistry = registry;
-    }
-
-    @Autowire
-    public void setWireService(WireService wireService) {
-        this.wireService = wireService;
     }
 
     @Init

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/CompositeComponentExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/CompositeComponentExtension.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/CompositeComponentExtension.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/CompositeComponentExtension.java Sat Feb 17 00:35:19 2007
@@ -20,9 +20,7 @@
 
 import java.net.URI;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
@@ -32,16 +30,11 @@
 import org.apache.tuscany.spi.component.CompositeComponent;
 import org.apache.tuscany.spi.component.DuplicateNameException;
 import org.apache.tuscany.spi.component.Reference;
-import org.apache.tuscany.spi.component.ReferenceBinding;
 import org.apache.tuscany.spi.component.RegistrationException;
 import org.apache.tuscany.spi.component.SCAObject;
 import org.apache.tuscany.spi.component.Service;
-import org.apache.tuscany.spi.component.ServiceBinding;
 import org.apache.tuscany.spi.event.Event;
 import org.apache.tuscany.spi.model.Scope;
-import org.apache.tuscany.spi.wire.InboundWire;
-import org.apache.tuscany.spi.wire.OutboundWire;
-import org.apache.tuscany.spi.wire.Wire;
 
 /**
  * An extension point for composite components, which new types may extend
@@ -79,6 +72,36 @@
         return Collections.unmodifiableList(references);
     }
 
+    public Service getService(String name) {
+        if (name == null) {
+            if (services.size() == 1) {
+                return services.get(0);
+            } else {
+                return null;
+            }
+        }
+        SCAObject o = children.get(name);
+        if (o instanceof Service) {
+            return (Service) o;
+        }
+        return null;
+    }
+
+    public Reference getReference(String name) {
+        if (name == null) {
+            if (references.size() == 1) {
+                return references.get(0);
+            } else {
+                return null;
+            }
+        }
+        SCAObject o = children.get(name);
+        if (o instanceof Reference) {
+            return (Reference) o;
+        }
+        return null;
+    }
+
     public void register(Service service) throws RegistrationException {
         String name = service.getUri().getFragment();
         assert name != null;
@@ -102,103 +125,6 @@
         children.put(name, reference);
         synchronized (services) {
             references.add(reference);
-        }
-    }
-
-    public Map<String, List<OutboundWire>> getOutboundWires() {
-        synchronized (references) {
-            Map<String, List<OutboundWire>> map = new HashMap<String, List<OutboundWire>>();
-            for (Reference reference : references) {
-                List<OutboundWire> wires = new ArrayList<OutboundWire>();
-                map.put(reference.getUri().getFragment(), wires);
-                for (ReferenceBinding binding : reference.getReferenceBindings()) {
-                    OutboundWire wire = binding.getOutboundWire();
-                    if (Wire.LOCAL_BINDING.equals(wire.getBindingType())) {
-                        wires.add(wire);
-                    }
-                }
-            }
-            return map;
-        }
-    }
-
-    public InboundWire getInboundWire(String serviceName) {
-        Service service;
-        if (serviceName == null) {
-            if (services.size() != 1) {
-                return null;
-            }
-            service = services.get(0);
-        } else {
-            SCAObject object = children.get(serviceName);
-            if (!(object instanceof Service)) {
-                return null;
-            }
-            service = (Service) object;
-        }
-        for (ServiceBinding binding : service.getServiceBindings()) {
-            InboundWire wire = binding.getInboundWire();
-            if (Wire.LOCAL_BINDING.equals(wire.getBindingType())) {
-                return wire;
-            }
-        }
-        return null;
-    }
-
-    public InboundWire getTargetWire(String targetName) {
-        SCAObject object = null;
-        if (targetName == null) {
-            if (services.size() == 1) {
-                object = services.get(0);
-            } else if (references.size() == 1) {
-                object = references.get(0);
-            }
-        } else {
-            object = children.get(targetName);
-        }
-        if (object instanceof Service) {
-            Service service = (Service) object;
-            List<ServiceBinding> bindings = service.getServiceBindings();
-            if (bindings.isEmpty()) {
-                return null;
-            }
-            for (ServiceBinding binding : bindings) {
-                InboundWire wire = binding.getInboundWire();
-                if (Wire.LOCAL_BINDING.equals(wire.getBindingType())) {
-                    return wire;
-                }
-            }
-            // for now, pick the first one
-            return bindings.get(0).getInboundWire();
-        } else if (object instanceof Reference) {
-            Reference reference = (Reference) object;
-            List<ReferenceBinding> bindings = reference.getReferenceBindings();
-            if (bindings.isEmpty()) {
-                return null;
-            }
-            for (ReferenceBinding binding : bindings) {
-                InboundWire wire = binding.getInboundWire();
-                if (Wire.LOCAL_BINDING.equals(wire.getBindingType())) {
-                    return wire;
-                }
-            }
-            return bindings.get(0).getInboundWire();
-        }
-        return null;
-    }
-
-    public Collection<InboundWire> getInboundWires() {
-        synchronized (services) {
-            List<InboundWire> map = new ArrayList<InboundWire>();
-            for (Service service : services) {
-                for (ServiceBinding binding : service.getServiceBindings()) {
-                    InboundWire wire = binding.getInboundWire();
-                    if (Wire.LOCAL_BINDING.equals(wire.getBindingType())) {
-                        map.add(wire);
-                    }
-                }
-            }
-            return map;
         }
     }
 

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/ReferenceBindingExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/ReferenceBindingExtension.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/ReferenceBindingExtension.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/ReferenceBindingExtension.java Sat Feb 17 00:35:19 2007
@@ -21,11 +21,9 @@
 import java.net.URI;
 
 import org.apache.tuscany.spi.component.AbstractSCAObject;
-import org.apache.tuscany.spi.component.Reference;
 import org.apache.tuscany.spi.component.ReferenceBinding;
 import org.apache.tuscany.spi.model.ServiceContract;
-import org.apache.tuscany.spi.wire.InboundWire;
-import org.apache.tuscany.spi.wire.OutboundWire;
+import org.apache.tuscany.spi.wire.Wire;
 
 /**
  * The default implementation of an SCA reference
@@ -33,37 +31,29 @@
  * @version $Rev$ $Date$
  */
 public abstract class ReferenceBindingExtension extends AbstractSCAObject implements ReferenceBinding {
-    protected Reference reference;
-    protected InboundWire inboundWire;
-    protected OutboundWire outboundWire;
+    protected Wire wire;
     protected ServiceContract<?> bindingServiceContract;
+    protected URI targetUri;
 
-    protected ReferenceBindingExtension(URI name) {
+    protected ReferenceBindingExtension(URI name, URI targetUri) {
         super(name);
+        this.targetUri = targetUri;
     }
 
-    public void setReference(Reference reference) {
-        this.reference = reference;
-    }
-
-    public void setInboundWire(InboundWire wire) {
-        this.inboundWire = wire;
+    public ServiceContract<?> getBindingServiceContract() {
+        return bindingServiceContract;
     }
 
-    public InboundWire getInboundWire() {
-        return inboundWire;
+    public Wire getWire() {
+        return wire;
     }
 
-    public OutboundWire getOutboundWire() {
-        return outboundWire;
+    public void setWire(Wire wire) {
+        this.wire = wire;
     }
 
-    public void setOutboundWire(OutboundWire outboundWire) {
-        this.outboundWire = outboundWire;
-    }
 
-    public ServiceContract<?> getBindingServiceContract() {
-        return bindingServiceContract;
+    public URI getTargetUri() {
+        return targetUri;
     }
-
 }

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/ServiceBindingExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/ServiceBindingExtension.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/ServiceBindingExtension.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/ServiceBindingExtension.java Sat Feb 17 00:35:19 2007
@@ -22,15 +22,12 @@
 
 import org.apache.tuscany.spi.CoreRuntimeException;
 import org.apache.tuscany.spi.component.AbstractSCAObject;
-import org.apache.tuscany.spi.component.CompositeComponent;
-import org.apache.tuscany.spi.component.Service;
 import org.apache.tuscany.spi.component.ServiceBinding;
 import org.apache.tuscany.spi.component.TargetInvokerCreationException;
 import org.apache.tuscany.spi.model.Operation;
 import org.apache.tuscany.spi.model.ServiceContract;
-import org.apache.tuscany.spi.wire.InboundWire;
-import org.apache.tuscany.spi.wire.OutboundWire;
 import org.apache.tuscany.spi.wire.TargetInvoker;
+import org.apache.tuscany.spi.wire.Wire;
 
 /**
  * The default implementation of an SCA service
@@ -38,35 +35,13 @@
  * @version $Rev$ $Date$
  */
 public abstract class ServiceBindingExtension extends AbstractSCAObject implements ServiceBinding {
-    protected Service service;
-    protected InboundWire inboundWire;
-    protected OutboundWire outboundWire;
     protected ServiceContract<?> bindingServiceContract;
+    protected Wire wire;
 
-    public ServiceBindingExtension(URI name, CompositeComponent parent) throws CoreRuntimeException {
+    public ServiceBindingExtension(URI name) throws CoreRuntimeException {
         super(name);
     }
 
-    public void setService(Service service) {
-        this.service = service;
-    }
-
-    public InboundWire getInboundWire() {
-        return inboundWire;
-    }
-
-    public void setInboundWire(InboundWire wire) {
-        inboundWire = wire;
-    }
-
-    public OutboundWire getOutboundWire() {
-        return outboundWire;
-    }
-
-    public void setOutboundWire(OutboundWire outboundWire) {
-        this.outboundWire = outboundWire;
-    }
-
     public TargetInvoker createTargetInvoker(ServiceContract contract, Operation operation)
         throws TargetInvokerCreationException {
         throw new UnsupportedOperationException();
@@ -76,4 +51,11 @@
         return bindingServiceContract;
     }
 
+    public Wire getWire() {
+        return wire;
+    }
+
+    public void setWire(Wire wire) {
+        this.wire = wire;
+    }
 }

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/TargetInvokerExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/TargetInvokerExtension.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/TargetInvokerExtension.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/TargetInvokerExtension.java Sat Feb 17 00:35:19 2007
@@ -19,11 +19,10 @@
 package org.apache.tuscany.spi.extension;
 
 import java.lang.reflect.InvocationTargetException;
-import java.util.LinkedList;
 import java.net.URI;
+import java.util.LinkedList;
 
 import org.apache.tuscany.spi.component.WorkContext;
-import org.apache.tuscany.spi.wire.InboundWire;
 import org.apache.tuscany.spi.wire.InvocationRuntimeException;
 import org.apache.tuscany.spi.wire.Message;
 import org.apache.tuscany.spi.wire.TargetInvoker;
@@ -34,8 +33,6 @@
  * @version $Rev$ $Date$
  */
 public abstract class TargetInvokerExtension implements TargetInvoker {
-
-    protected InboundWire wire;
     protected WorkContext workContext;
     protected ExecutionMonitor monitor;
     protected boolean cacheable;
@@ -43,12 +40,10 @@
     /**
      * Creates a new invoker
      *
-     * @param wire        the callback wire
      * @param workContext the work context to use for setting correlation information
      * @param monitor     the event monitor
      */
-    public TargetInvokerExtension(InboundWire wire, WorkContext workContext, ExecutionMonitor monitor) {
-        this.wire = wire;
+    public TargetInvokerExtension(WorkContext workContext, ExecutionMonitor monitor) {
         this.workContext = workContext;
         this.monitor = monitor;
     }
@@ -59,11 +54,9 @@
             if (messageId != null) {
                 workContext.setCurrentCorrelationId(messageId);
             }
-            if (wire != null) {
-                LinkedList<URI> callbackRoutingChain = msg.getCallbackRoutingChain();
-                if (callbackRoutingChain != null) {
-                    workContext.setCurrentCallbackRoutingChain(callbackRoutingChain);
-                }
+            LinkedList<URI> callbackRoutingChain = msg.getCallbackUris();
+            if (callbackRoutingChain != null) {
+                workContext.setCurrentCallbackUris(callbackRoutingChain);
             }
             Object resp = invokeTarget(msg.getBody(), msg.getConversationSequence());
             msg.setBody(resp);

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/PolicyBuilderRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/PolicyBuilderRegistry.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/PolicyBuilderRegistry.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/PolicyBuilderRegistry.java Sat Feb 17 00:35:19 2007
@@ -18,17 +18,12 @@
  */
 package org.apache.tuscany.spi.policy;
 
-import org.apache.tuscany.spi.builder.BuilderException;
-import org.apache.tuscany.spi.model.ReferenceDefinition;
-import org.apache.tuscany.spi.model.ServiceDefinition;
-import org.apache.tuscany.spi.wire.InboundWire;
-import org.apache.tuscany.spi.wire.OutboundWire;
-
 /**
  * A registry for policy builders that dispatches to the appropriate builder when converting an assembly to runtime
  * artifacts. Policy builders operate on either a source- or target-side wires.
  *
  * @version $Rev$ $Date$
+ * @deprecated
  */
 public interface PolicyBuilderRegistry {
 
@@ -51,20 +46,4 @@
      * @param builder the builder to register
      */
     void registerSourceBuilder(int phase, SourcePolicyBuilder builder);
-
-    /**
-     * Evaluates source-side policy metadata for referenceDefinition and updates the curresponding collection of wire
-     * configurations
-     *
-     * @throws BuilderException
-     */
-    void buildSource(ReferenceDefinition referenceDefinition, OutboundWire wire) throws BuilderException;
-
-    /**
-     * Evaluates target-side policy metadata for configured reference and updates the curresponding collection of wire
-     * configurations
-     *
-     * @throws BuilderException
-     */
-    void buildTarget(ServiceDefinition serviceDefinition, InboundWire wire) throws BuilderException;
 }

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/SourcePolicyBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/SourcePolicyBuilder.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/SourcePolicyBuilder.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/SourcePolicyBuilder.java Sat Feb 17 00:35:19 2007
@@ -20,12 +20,13 @@
 
 import org.apache.tuscany.spi.builder.BuilderException;
 import org.apache.tuscany.spi.model.ReferenceDefinition;
-import org.apache.tuscany.spi.wire.OutboundWire;
+import org.apache.tuscany.spi.wire.Wire;
 
 /**
  * Implementations contribute {@link org.apache.tuscany.spi.wire.Interceptor}s to handle source-side policy on a wire.
  *
  * @version $$Rev$$ $$Date$$
+ * @deprecated
  */
 public interface SourcePolicyBuilder {
 
@@ -36,6 +37,6 @@
      * @param wire       the wire to attach policy to
      * @throws BuilderException
      */
-    void build(ReferenceDefinition definition, OutboundWire wire) throws BuilderException;
+    void build(ReferenceDefinition definition, Wire wire) throws BuilderException;
 
 }

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/TargetPolicyBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/TargetPolicyBuilder.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/TargetPolicyBuilder.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/policy/TargetPolicyBuilder.java Sat Feb 17 00:35:19 2007
@@ -20,12 +20,13 @@
 
 import org.apache.tuscany.spi.builder.BuilderException;
 import org.apache.tuscany.spi.model.ServiceDefinition;
-import org.apache.tuscany.spi.wire.InboundWire;
+import org.apache.tuscany.spi.wire.Wire;
 
 /**
  * Implementations contribute {@link org.apache.tuscany.spi.wire.Interceptor}s to handle target-side policy on a wire.
  *
  * @version $$Rev$$ $$Date$$
+ * @deprecated
  */
 public interface TargetPolicyBuilder {
 
@@ -36,6 +37,6 @@
      * @param wire       the wire to attach policy to
      * @throws BuilderException
      */
-    void build(ServiceDefinition definition, InboundWire wire) throws BuilderException;
+    void build(ServiceDefinition definition, Wire wire) throws BuilderException;
 
 }

Copied: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/AbstractInvocationHandler.java (from r507339, incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/AbstractOutboundInvocationHandler.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/AbstractInvocationHandler.java?view=diff&rev=508732&p1=incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/AbstractOutboundInvocationHandler.java&r1=507339&p2=incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/AbstractInvocationHandler.java&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/AbstractOutboundInvocationHandler.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/AbstractInvocationHandler.java Sat Feb 17 00:35:19 2007
@@ -19,27 +19,27 @@
 package org.apache.tuscany.spi.wire;
 
 import java.lang.reflect.InvocationTargetException;
-import java.util.LinkedList;
 import java.net.URI;
+import java.util.LinkedList;
 
 import org.apache.tuscany.spi.model.InteractionScope;
 import org.apache.tuscany.spi.model.Operation;
 import org.apache.tuscany.spi.model.ServiceContract;
 
 /**
- * Base class for performing invocations on an outbound chain. Subclasses are responsible for retrieving and supplying
- * the appropriate chain, target invoker and invocation arguments.
+ * Base class for performing invocations on a wire. Subclasses are responsible for retrieving and supplying the
+ * appropriate chain, target invoker, and invocation arguments.
  *
  * @version $Rev$ $Date$
  */
-public abstract class AbstractOutboundInvocationHandler {
+public abstract class AbstractInvocationHandler {
     private boolean conversationStarted;
 
-    protected Object invoke(OutboundInvocationChain chain,
+    protected Object invoke(InvocationChain chain,
                             TargetInvoker invoker,
                             Object[] args,
                             Object correlationId,
-                            LinkedList<URI> callbackRoutingChain)
+                            LinkedList<URI> callbackUris)
         throws Throwable {
         Interceptor headInterceptor = chain.getHeadInterceptor();
         if (headInterceptor == null) {
@@ -58,18 +58,11 @@
         } else {
             Message msg = new MessageImpl();
             msg.setTargetInvoker(invoker);
-            URI fromAddress = getFromAddress();
-            if (fromAddress != null && callbackRoutingChain != null) {
-                throw new AssertionError("Can't use both a from address and callback routing chain");
-            }
-            if (fromAddress != null) {
-                msg.pushFromAddress(fromAddress);
-            }
             if (correlationId != null) {
                 msg.setCorrelationId(correlationId);
             }
-            if (callbackRoutingChain != null) {
-                msg.setCallbackRoutingChain(callbackRoutingChain);
+            if (callbackUris != null) {
+                msg.setCallbackUris(callbackUris);
             }
             Operation operation = chain.getOperation();
             ServiceContract contract = operation.getServiceContract();
@@ -98,8 +91,4 @@
         }
     }
 
-    protected URI getFromAddress() {
-        // Default to null, only needed in outbound (forward) direction
-        return null;
-    }
 }

Propchange: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/AbstractInvocationHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/AbstractInvocationHandler.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/ChainHolder.java (from r507339, incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/OutboundChainHolder.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/ChainHolder.java?view=diff&rev=508732&p1=incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/OutboundChainHolder.java&r1=507339&p2=incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/ChainHolder.java&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/OutboundChainHolder.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/ChainHolder.java Sat Feb 17 00:35:19 2007
@@ -6,15 +6,15 @@
  *
  * @version $Rev$ $Date$
  */
-public class OutboundChainHolder implements Cloneable {
-    OutboundInvocationChain chain;
+public class ChainHolder implements Cloneable {
+    InvocationChain chain;
     TargetInvoker cachedInvoker;
 
-    public OutboundChainHolder(OutboundInvocationChain config) {
+    public ChainHolder(InvocationChain config) {
         this.chain = config;
     }
 
-    public OutboundInvocationChain getChain() {
+    public InvocationChain getChain() {
         return chain;
     }
 
@@ -28,9 +28,9 @@
 
     @SuppressWarnings({"CloneDoesntDeclareCloneNotSupportedException"})
     @Override
-    public OutboundChainHolder clone() {
+    public ChainHolder clone() {
         try {
-            return (OutboundChainHolder) super.clone();
+            return (ChainHolder) super.clone();
         } catch (CloneNotSupportedException e) {
             throw new AssertionError();
         }

Propchange: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/ChainHolder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/ChainHolder.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/InvocationChain.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/InvocationChain.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/InvocationChain.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/InvocationChain.java Sat Feb 17 00:35:19 2007
@@ -21,20 +21,19 @@
 import org.apache.tuscany.spi.model.Operation;
 
 /**
- * An inbound or outbound invocation pipeline for a service operation. Wires consist of 1..n invocation chains
- * associated with the operations of the service contract the wire represents. Invocation chains are associated with the
- * outbound or inbound side of a wire are bridged or "connected" when an assembly is processed. Outbound chains are only
- * connected to inbound chains and vice versa.
+ * A wire consists of 1..n invocation chains associated with the operations of its source service contract.
  * <p/>
- * Invocation chains contain at least one {@link Interceptor} that process invocations in an around-style manner. In
- * some scenarios, a service proxy may only contain inbound invocation chains, for example, when a service is resolved
- * through a locate operation by a non-component client. In this case, there will be no outbound invocation chains and
- * the target invoker will be held by the target-side and passed down the pipeline.
+ * Invocation chains may contain {@link Interceptor}s that process invocations in an around-style manner. Invocation
+ * chains are also associated with a {@TargetInvoker} which is responsible for dispatching on the target service
+ * provider.
  * <p/>
- * A {@link Message} is used to pass data associated with an invocation through the chain. <code>Message</code>s contain
- * a {@link TargetInvoker} responsible for dispatching to a target instance and may be cached on the source-side.
- * Caching allows various optimizations such as avoiding target instance resolution when the client-side lifecycle scope
- * is a shorter duration than the target.
+ * A {@link Message} is used to pass data associated with an invocation through the chain. The TargetInvoker is passed
+ * with the Message through the interceptor stack, if one is present. At last interceptor in the stack, must call the
+ * TargetInvoker.
+ * <p/>
+ * In certain circumstances, the TargetInvoker may be cached in the source-side proxy. Caching allows various
+ * optimizations such as avoiding target instance resolution when the client-side lifecycle scope is a shorter duration
+ * than the target.
  *
  * @version $Rev$ $Date$
  */

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/Message.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/Message.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/Message.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/Message.java Sat Feb 17 00:35:19 2007
@@ -18,8 +18,8 @@
  */
 package org.apache.tuscany.spi.wire;
 
-import java.util.LinkedList;
 import java.net.URI;
+import java.util.LinkedList;
 
 /**
  * Represents a request, response, or exception flowing through a wire
@@ -49,24 +49,19 @@
     TargetInvoker getTargetInvoker();
 
     /**
-     * Returns the latest 'address' of the SCAObject where this message originated
-     */
-    URI popFromAddress();
-
-    /**
-     * Adds the latest 'address' of the SCAObject where this message originated
+     * @deprecated
      */
-    void pushFromAddress(URI fromAddress);
+    void pushCallbackUri(URI uri);
 
     /**
-     * Returns the chain of SCAObject addresses
+     * Returns the ordered list of callback URIs
      */
-    LinkedList<URI> getCallbackRoutingChain();
+    LinkedList<URI> getCallbackUris();
 
     /**
-     * Sets the chain of SCAObject addresses
+     * Sets the ordered list of callback URIs
      */
-    void setCallbackRoutingChain(LinkedList<URI> fromAddresses);
+    void setCallbackUris(LinkedList<URI> uris);
 
     /**
      * Returns the id of the message
@@ -103,18 +98,18 @@
     void setBodyWithFault(Object fault);
 
     /**
-     * Returns the conversational sequence the message is associated with, {@link TargetInvoker.NONE}, {@link
-     * TargetInvoker.START}, {@link TargetInvoker.CONTINUE}, or {@link TargetInvoker.END}
+     * Returns the conversational sequence the message is associated with, NONE, START, CONTINUE, or END on {@link
+     * TargetInvoker}
      *
      * @return the conversational sequence the message is associated with
      */
     short getConversationSequence();
 
     /**
-     * Sets the conversational sequence the message is associated with,
+     * Returns the conversational sequence the message is associated with, NONE, START, CONTINUE, or END on {@link
+     * TargetInvoker}
      *
-     * @param sequence {@link TargetInvoker.NONE}, {@link TargetInvoker.START}, {@link TargetInvoker.CONTINUE}, or
-     *                 {@link TargetInvoker.END}
+     * @param sequence the conversational sequence
      */
     void setConversationSequence(short sequence);
 

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/MessageImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/MessageImpl.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/MessageImpl.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/MessageImpl.java Sat Feb 17 00:35:19 2007
@@ -18,8 +18,8 @@
  */
 package org.apache.tuscany.spi.wire;
 
-import java.util.LinkedList;
 import java.net.URI;
+import java.util.LinkedList;
 
 /**
  * The default implementation of a message flowed through a wire during an invocation
@@ -29,7 +29,7 @@
 public class MessageImpl implements Message {
     private Object body;
     private TargetInvoker invoker;
-    private LinkedList<URI> callbackRoutingChain;
+    private LinkedList<URI> callbackUris;
     private Object messageId;
     private Object correlationId;
     private boolean isFault;
@@ -55,23 +55,19 @@
         return invoker;
     }
 
-    public URI popFromAddress() {
-        return callbackRoutingChain.removeFirst();
-    }
-
-    public void pushFromAddress(URI fromAddress) {
-        if (callbackRoutingChain == null) {
-            callbackRoutingChain = new LinkedList<URI>();
+    public void pushCallbackUri(URI uri) {
+        if (callbackUris == null) {
+            callbackUris = new LinkedList<URI>();
         }
-        callbackRoutingChain.addFirst(fromAddress);
+        callbackUris.addFirst(uri);
     }
 
-    public LinkedList<URI> getCallbackRoutingChain() {
-        return callbackRoutingChain;
+    public LinkedList<URI> getCallbackUris() {
+        return callbackUris;
     }
 
-    public void setCallbackRoutingChain(LinkedList<URI> callbackRoutingChain) {
-        this.callbackRoutingChain = callbackRoutingChain;
+    public void setCallbackUris(LinkedList<URI> callbackRoutingChain) {
+        this.callbackUris = callbackRoutingChain;
     }
 
     public Object getMessageId() {

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/Wire.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/Wire.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/Wire.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/Wire.java Sat Feb 17 00:35:19 2007
@@ -22,6 +22,7 @@
 import java.util.Map;
 import javax.xml.namespace.QName;
 
+import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.TargetResolutionException;
 import org.apache.tuscany.spi.model.Operation;
 import org.apache.tuscany.spi.model.ServiceContract;
@@ -84,18 +85,32 @@
     QName getBindingType();
 
     /**
-     * Returns the service contract associated with the wire
+     * Returns the service contract associated with the the source side of the wire
      *
      * @return the service contract associated with the wire
      */
-    ServiceContract getServiceContract();
+    ServiceContract getSourceContract();
 
     /**
-     * Sets the contract associated with the wire
+     * Sets the contract associated with the source side of the wire
      *
      * @param contract the contract associated with the wire
      */
-    void setServiceContract(ServiceContract contract);
+    void setSourceContract(ServiceContract contract);
+
+    /**
+     * Returns the service contract associated with the the target side of the wire
+     *
+     * @return the service contract associated with the wire
+     */
+    ServiceContract getTargetContract();
+
+    /**
+     * Sets the contract associated with the the target side of the wire
+     *
+     * @param contract the contract associated with the wire
+     */
+    void setTargetContract(ServiceContract contract);
 
     /**
      * Returns true if the wire is optimizable and its invocation chains may be bypassed
@@ -116,7 +131,14 @@
      *
      * @return the non-proxied target instance for this wire
      */
-    Object getTargetService() throws TargetResolutionException;
+    Object getTargetInstance() throws TargetResolutionException;
+
+    /**
+     * Sets the target for the wire for optimizations
+     *
+     * @param target the target for the wire
+     */
+    void setTarget(AtomicComponent target);
 
     /**
      * Returns the invocation chains for service operations associated with the wire

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WirePostProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WirePostProcessor.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WirePostProcessor.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WirePostProcessor.java Sat Feb 17 00:35:19 2007
@@ -18,25 +18,14 @@
  */
 package org.apache.tuscany.spi.wire;
 
-import org.apache.tuscany.spi.component.SCAObject;
-
 /**
- * Implementations are called after inbound and outbound wires are decorated with policy and before they are connected.
+ * Implementations are called after wires are decorated with policy and before they are connected.
  *
  * @version $Rev$ $Date$
+ * @deprecated
  */
 public interface WirePostProcessor {
 
-    /**
-     * @param source
-     * @param target
-     */
-    void process(SCAObject source, OutboundWire sourceWire, SCAObject target, InboundWire targetWire);
-
-    /**
-     * @param source
-     * @param target
-     */
-    void process(SCAObject source, InboundWire sourceWire, SCAObject target, OutboundWire targetWire);
+    void process(Wire wire);
 
 }

Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WireService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WireService.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WireService.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WireService.java Sat Feb 17 00:35:19 2007
@@ -19,16 +19,10 @@
 package org.apache.tuscany.spi.wire;
 
 import java.lang.reflect.Method;
-import java.net.URI;
+import java.util.List;
 import java.util.Map;
 
-import org.apache.tuscany.spi.component.AtomicComponent;
-import org.apache.tuscany.spi.component.ReferenceBinding;
-import org.apache.tuscany.spi.component.ServiceBinding;
-import org.apache.tuscany.spi.model.ComponentDefinition;
-import org.apache.tuscany.spi.model.Operation;
 import org.apache.tuscany.spi.model.ServiceContract;
-import org.apache.tuscany.spi.model.ServiceDefinition;
 
 /**
  * Creates proxies that implement Java interfaces and invocation handlers for fronting wires
@@ -56,7 +50,7 @@
      *                  this mapping for performance.
      * @throws ProxyCreationException
      */
-    <T> T createProxy(Class<T> interfaze, Wire wire, Map<Method, OutboundChainHolder> mapping)
+    <T> T createProxy(Class<T> interfaze, Wire wire, Map<Method, ChainHolder> mapping)
         throws ProxyCreationException;
 
     /**
@@ -66,68 +60,7 @@
      * @return the proxy
      * @throws ProxyCreationException
      */
-    Object createCallbackProxy(Class<?> interfaze, InboundWire wire) throws ProxyCreationException;
-
-    /**
-     * Creates an {@link WireInvocationHandler} for the given wire
-     *
-     * @param interfaze the client side interface
-     * @param wire      the wire to create the invocation handler for
-     * @return the invocation handler
-     */
-    WireInvocationHandler createHandler(Class<?> interfaze, Wire wire);
-
-    /**
-     * Creates an outbound invocation chain for a given operation
-     *
-     * @param operation the operation to create the chain for
-     * @return the outbound invocation chain for a given operation
-     */
-    OutboundInvocationChain createOutboundChain(Operation<?> operation);
-
-    /**
-     * Creates an inbound invocation chain for a given operation
-     *
-     * @param operation the operation to create the chain for
-     * @return the inbound invocation chain for a given operation
-     */
-    InboundInvocationChain createInboundChain(Operation<?> operation);
-
-    /**
-     * Creates a wire for flowing inbound invocations to a service. The returned inbound chain will always contain at
-     * least one interceptor in order for outbound wires to connect to it.
-     *
-     * @param service the model representation of the service
-     * @return the wire for flowing inbound invocations to a service
-     */
-    InboundWire createWire(ServiceDefinition service);
-
-    /**
-     * Creates and injects wires for an atomic component
-     *
-     * @param component  the component
-     * @param definition the model artifact representing the component
-     */
-    void createWires(AtomicComponent component, ComponentDefinition<?> definition);
-
-    /**
-     * Creates and injects wires for a reference binding
-     *
-     * @param referenceBinding the reference
-     * @param contract         the model artifact representing the service contract for the reference
-     * @param targetName       the qualified target name or null if the reference referes to a target outside the SCA
-     *                         domain
-     */
-    void createWires(ReferenceBinding referenceBinding, ServiceContract<?> contract, URI targetName);
-
-    /**
-     * Creates and injects wires for a service binding
-     *
-     * @param serviceBinding the serviceBinding
-     * @param contract       the serviceBinding contract
-     * @param targetName     the target nane
-     */
-    void createWires(ServiceBinding serviceBinding, ServiceContract<?> contract, String targetName);
+    Object createCallbackProxy(Class<?> interfaze, List<Wire> wires) throws ProxyCreationException;
 
     /**
      * Check the compatiblity of the source and the target service contracts.<p> A wire may only connect a source to a
@@ -158,15 +91,5 @@
                                boolean ignoreCallback,
                                boolean silent)
         throws IncompatibleServiceContractException;
-
-    /**
-     * Performs a silent check for service contract compatibility using the algorithm defined by {@link
-     * #checkCompatibility(org.apache.tuscany.spi.model.ServiceContract,org.apache.tuscany.spi.model.ServiceContract,
-     *boolean)}
-     *
-     * @param source The source service contract
-     * @param target The target service contract
-     * @return true if compatible
-     */
 
 }

Modified: incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/AtomicComponentExtensionTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/AtomicComponentExtensionTestCase.java?view=diff&rev=508732&r1=508731&r2=508732
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/AtomicComponentExtensionTestCase.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/test/java/org/apache/tuscany/spi/extension/AtomicComponentExtensionTestCase.java Sat Feb 17 00:35:19 2007
@@ -19,10 +19,7 @@
 package org.apache.tuscany.spi.extension;
 
 import java.net.URI;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.TestCase;
-import org.easymock.EasyMock;
+import java.util.List;
 
 import org.apache.tuscany.spi.ObjectCreationException;
 import org.apache.tuscany.spi.component.ScopeContainer;
@@ -30,8 +27,12 @@
 import org.apache.tuscany.spi.component.TargetResolutionException;
 import org.apache.tuscany.spi.model.Operation;
 import org.apache.tuscany.spi.model.Scope;
-import org.apache.tuscany.spi.wire.InboundWire;
 import org.apache.tuscany.spi.wire.TargetInvoker;
+import org.apache.tuscany.spi.wire.Wire;
+
+import junit.framework.AssertionFailedError;
+import junit.framework.TestCase;
+import org.easymock.EasyMock;
 
 /**
  * @version $Rev$ $Date$
@@ -43,7 +44,7 @@
     public void testURI() {
         assertSame(uri, ext.getUri());
     }
-    
+
     public void testRemoveInstance() throws Exception {
         ScopeContainer scopeContainer = EasyMock.createMock(ScopeContainer.class);
         EasyMock.expect(scopeContainer.getScope()).andReturn(Scope.COMPOSITE);
@@ -66,8 +67,24 @@
             super(uri, null, null, null, null, 0);
         }
 
-        public TargetInvoker createTargetInvoker(String targetName, Operation operation, InboundWire callbackWire)
+        public TargetInvoker createTargetInvoker(String targetName, Operation operation)
             throws TargetInvokerCreationException {
+            throw new AssertionFailedError();
+        }
+
+        public List<Wire> getWires(String name) {
+            throw new AssertionFailedError();
+        }
+
+        public void attachWire(Wire wire) {
+            throw new AssertionFailedError();
+        }
+
+        public void attachWires(List<Wire> wires) {
+            throw new AssertionFailedError();
+        }
+
+        public void attachCallbackWire(Wire wire) {
             throw new AssertionFailedError();
         }
 



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