Author: jmarino
Date: Fri Sep 22 22:05:44 2006
New Revision: 449159

URL: http://svn.apache.org/viewvc?view=rev&rev=449159
Log:
minor wire service cleanup; fix improperly named testcase

Added:
    
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKOutboundInvocationHandlerTestCase.java
   (contents, props changed)
      - copied, changed from r449150, 
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDOutboundInvocationHandlerTestCase.java
Removed:
    
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDOutboundInvocationHandlerTestCase.java
Modified:
    
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKWireService.java
    
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ConnectorImplTestCase.java
    
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/wire/WireService.java

Modified: 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKWireService.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKWireService.java?view=diff&rev=449159&r1=449158&r2=449159
==============================================================================
--- 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKWireService.java
 (original)
+++ 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKWireService.java
 Fri Sep 22 22:05:44 2006
@@ -85,22 +85,6 @@
     public void init() {
     }
 
-    private Map<Method, InboundInvocationChain> 
createInboundMapping(InboundWire wire, Method[] methods)
-        throws NoMethodForOperationException {
-        Map<Method, InboundInvocationChain> chains = new HashMap<Method, 
InboundInvocationChain>();
-        for (Map.Entry<Operation<?>, InboundInvocationChain> entry : 
wire.getInvocationChains().entrySet()) {
-            Operation<?> operation = entry.getKey();
-            InboundInvocationChain chain = entry.getValue();
-            Method method = findMethod(operation, methods);
-            if (method == null) {
-                NoMethodForOperationException e = new 
NoMethodForOperationException();
-                e.setIdentifier(operation.getName());
-            }
-            chains.put(method, chain);
-        }
-        return chains;
-    }
-
     public Object createProxy(RuntimeWire wire) throws ProxyCreationException {
         assert wire != null : "Wire was null";
         if (wire instanceof InboundWire) {
@@ -161,7 +145,6 @@
         return new InboundInvocationChainImpl(operation);
     }
 
-
     public void createWires(Component component, ComponentDefinition<?> 
definition) {
         Implementation<?> implementation = definition.getImplementation();
         ComponentType<?, ?, ?> componentType = 
implementation.getComponentType();
@@ -233,10 +216,6 @@
         reference.setOutboundWire(outboundWire);
     }
 
-    public void createWires(Service service, BoundServiceDefinition<?> def) {
-        createWires(service, def.getTarget().getPath(), 
def.getServiceContract());
-    }
-
     public OutboundWire createWire(ReferenceTarget reference, 
ReferenceDefinition def) {
         //TODO multiplicity
         if (reference.getTargets().size() != 1) {
@@ -323,6 +302,17 @@
         service.setOutboundWire(outboundWire);
     }
 
+    /**
+     * Compares two operations for wiring compatibility as defined by the SCA 
assembly specification, namely:
+     * <p/>
+     * <ol> <li>compatibility for the individual method is defined as 
compatibility of the signature, that is method
+     * name, input types, and output types MUST BE the same. <li>the order of 
the input and output types also MUST BE
+     * the same. <li>the set of Faults and Exceptions expected by the source 
MUST BE the same or be a superset of those
+     * specified by the service. </ol>
+     *
+     * @param source the source contract to compare
+     * @param target the target contract to compare
+     */
     public boolean isWireable(ServiceContract<?> source, ServiceContract<?> 
target) {
         if (source == target) {
             // Shortcut for performance
@@ -340,7 +330,7 @@
             if (targetOperation == null) {
                 return false;
             }
-            if (!isCompatibleWith(operation, targetOperation)) {
+            if (!operation.equals(targetOperation)) {
                 return false;
             }
         }
@@ -350,28 +340,27 @@
             if (targetOperation == null) {
                 return false;
             }
-            if (!isCompatibleWith(operation, targetOperation)) {
+            if (!operation.equals(targetOperation)) {
                 return false;
             }
         }
         return true;
     }
 
-    /**
-     * Compares two operations for wiring compatibility as defined by the SCA 
assembly specification, namely: <ol>
-     * <li>compatibility for the individual method is defined as compatibility 
of the signature, that is method name,
-     * input types, and output types MUST BE the same. <li>the order of the 
input and output types also MUST BE the
-     * same. <li>the set of Faults and Exceptions expected by the source MUST 
BE the same or be a superset of those
-     * specified by the service. </ol>
-     *
-     * @param source the source operation to compare
-     * @param target the target operation to compare
-     * @return true if the two operations are compatibile
-     */
-    public boolean isCompatibleWith(Operation<?> source, Operation<?> target) {
-        // FIXME:
-        return source.equals(target);
+    private Map<Method, InboundInvocationChain> 
createInboundMapping(InboundWire wire, Method[] methods)
+        throws NoMethodForOperationException {
+        Map<Method, InboundInvocationChain> chains = new HashMap<Method, 
InboundInvocationChain>();
+        for (Map.Entry<Operation<?>, InboundInvocationChain> entry : 
wire.getInvocationChains().entrySet()) {
+            Operation<?> operation = entry.getKey();
+            InboundInvocationChain chain = entry.getValue();
+            Method method = findMethod(operation, methods);
+            if (method == null) {
+                NoMethodForOperationException e = new 
NoMethodForOperationException();
+                e.setIdentifier(operation.getName());
+            }
+            chains.put(method, chain);
+        }
+        return chains;
     }
-
 
 }

Modified: 
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ConnectorImplTestCase.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ConnectorImplTestCase.java?view=diff&rev=449159&r1=449158&r2=449159
==============================================================================
--- 
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ConnectorImplTestCase.java
 (original)
+++ 
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/builder/ConnectorImplTestCase.java
 Fri Sep 22 22:05:44 2006
@@ -144,7 +144,7 @@
         EasyMock.expectLastCall().andReturn(Collections.emptyMap());
         
EasyMock.expect(outboundWire.getServiceContract()).andReturn(contract).anyTimes();
         EasyMock.expect(outboundWire.getTargetName()).andReturn(new 
QualifiedName("target/FooService")).anyTimes();
-        
EasyMock.expect((outboundWire.getInvocationChains())).andReturn(outboundChains).anyTimes();
+        
EasyMock.expect(outboundWire.getInvocationChains()).andReturn(outboundChains).anyTimes();
 
         // create the service
         Service service = EasyMock.createMock(Service.class);

Copied: 
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKOutboundInvocationHandlerTestCase.java
 (from r449150, 
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDOutboundInvocationHandlerTestCase.java)
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKOutboundInvocationHandlerTestCase.java?view=diff&rev=449159&p1=incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDOutboundInvocationHandlerTestCase.java&r1=449150&p2=incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKOutboundInvocationHandlerTestCase.java&r2=449159
==============================================================================
--- 
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDOutboundInvocationHandlerTestCase.java
 (original)
+++ 
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/wire/jdk/JDKOutboundInvocationHandlerTestCase.java
 Fri Sep 22 22:05:44 2006
@@ -12,7 +12,7 @@
 /**
  * @version $Rev$ $Date$
  */
-public class JDOutboundInvocationHandlerTestCase extends TestCase {
+public class JDKOutboundInvocationHandlerTestCase extends TestCase {
 
     public void testToString() {
         OutboundWireImpl wire = new OutboundWireImpl();

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

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

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=449159&r1=449158&r2=449159
==============================================================================
--- 
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
 Fri Sep 22 22:05:44 2006
@@ -129,22 +129,6 @@
     void createWires(Service service, String targetName, ServiceContract<?> 
contract);
 
     /**
-     * Creates wires for a service and injects them on the service
-     *
-     * @param service the service
-     * @param def     the model artifact representing the service
-     */
-    //void createWires(Service service, BoundServiceDefinition<?> def);
-
-    /**
-     * Creates wires for a composite service and injects them on the service
-     *
-     * @param service the service
-     * @param def     the model artifact representing the service
-     */
-    //void createWires(Service service, BindlessServiceDefinition def);
-
-    /**
      * Check the compatiblity of the source and the target service 
contracts.<p> A wire may only connect a source to a
      * target if the target implements an interface that is compatible with 
the interface required by the source. The
      * source and the target are compatible if:



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to