tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r662977 - in /incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl: BaseWireBuilderImpl.java ComponentReferenceWireBuilderImpl.java
Date Wed, 04 Jun 2008 05:16:01 GMT
Author: jsdelfino
Date: Tue Jun  3 22:16:01 2008
New Revision: 662977

URL: http://svn.apache.org/viewvc?rev=662977&view=rev
Log:
Changed throw IncompatibleInterfaceContract statements to logs, like it's already done in
many other cases.

Modified:
    incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseWireBuilderImpl.java
    incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java

Modified: incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseWireBuilderImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseWireBuilderImpl.java?rev=662977&r1=662976&r2=662977&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseWireBuilderImpl.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/BaseWireBuilderImpl.java
Tue Jun  3 22:16:01 2008
@@ -48,7 +48,6 @@
 import org.apache.tuscany.sca.assembly.Wire;
 import org.apache.tuscany.sca.assembly.builder.DefaultEndpointBuilder;
 import org.apache.tuscany.sca.assembly.builder.EndpointBuilder;
-import org.apache.tuscany.sca.interfacedef.IncompatibleInterfaceContractException;
 import org.apache.tuscany.sca.interfacedef.InterfaceContract;
 import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
 import org.apache.tuscany.sca.monitor.Monitor;
@@ -84,9 +83,8 @@
      * services/references to component services/references inside a composite.
      * 
      * @param composite
-     * @throws IncompatibleInterfaceContractException 
      */
-    protected void wireComponentReferences(Composite composite) throws IncompatibleInterfaceContractException
{
+    protected void wireComponentReferences(Composite composite) {
 
         // Wire nested composites recursively
         for (Component component : composite.getComponents()) {
@@ -215,11 +213,10 @@
      * @param composite
      * @param componentServices
      * @param problems
-     * @throws IncompatibleInterfaceContractException 
      */
     private void connectCompositeServices(Composite composite,
                                           Map<String, Component> components,
-                                          Map<String, ComponentService> componentServices)
throws IncompatibleInterfaceContractException {
+                                          Map<String, ComponentService> componentServices)
{
     
         // Propagate interfaces from inner composite components' services to
         // their component services
@@ -268,9 +265,9 @@
                         compositeService.setInterfaceContract(promotedServiceInterfaceContract);
                     } else if (promotedServiceInterfaceContract != null) {
                     	// Check the compositeServiceInterfaceContract and promotedServiceInterfaceContract
-                    	boolean isCompatible = interfaceContractMapper.isCompatible(compositeServiceInterfaceContract,promotedServiceInterfaceContract);
+                    	boolean isCompatible = interfaceContractMapper.isCompatible(compositeServiceInterfaceContract,
promotedServiceInterfaceContract);
                     	if(!isCompatible){
-                    		throw new IncompatibleInterfaceContractException("Interface of composite
service "+promotedServiceName +" must be subset of the interface declared by promoted component
service.", compositeServiceInterfaceContract, promotedServiceInterfaceContract);
+                    	    warning("Interface of composite service "+promotedServiceName +"
must be subset of the interface declared by promoted component service.", compositeService);
                     	}
                     }
     
@@ -288,9 +285,8 @@
      * @param composite
      * @param componentReferences
      * @param problems
-     * @throws IncompatibleInterfaceContractException 
      */
-    private void connectCompositeReferences(Composite composite, Map<String, ComponentReference>
componentReferences) throws IncompatibleInterfaceContractException {
+    private void connectCompositeReferences(Composite composite, Map<String, ComponentReference>
componentReferences) {
     
         // Propagate interfaces from inner composite components' references to
         // their component references
@@ -333,8 +329,8 @@
                         } else if (componentReferenceInterfaceContract != null) {
                         	// Check the compositeInterfaceContract and componentInterfaceContract
                         	boolean isCompatible = interfaceContractMapper.isCompatible(compositeReferenceInterfaceContract,
componentReferenceInterfaceContract);
-                        	if(!isCompatible){
-                        		throw new IncompatibleInterfaceContractException("Interface of
composite reference "+componentReferenceName +" must be compatible with the interface declared
by promoted component reference.", componentReferenceInterfaceContract, compositeReferenceInterfaceContract);
+                        	if (!isCompatible) {
+                        	    warning("Interface of composite reference "+componentReferenceName
+" must be compatible with the interface declared by promoted component reference.", compositeReference);
                         	}
                         }
                     } else {

Modified: incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java?rev=662977&r1=662976&r2=662977&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java
(original)
+++ incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java
Tue Jun  3 22:16:01 2008
@@ -24,7 +24,6 @@
 import org.apache.tuscany.sca.assembly.EndpointFactory;
 import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
 import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
-import org.apache.tuscany.sca.interfacedef.IncompatibleInterfaceContractException;
 import org.apache.tuscany.sca.interfacedef.InterfaceContractMapper;
 import org.apache.tuscany.sca.monitor.Monitor;
 
@@ -40,10 +39,6 @@
     }
 
     public void build(Composite composite) throws CompositeBuilderException {
-        try {
-            wireComponentReferences(composite);
-        } catch (IncompatibleInterfaceContractException e) {
-            throw new CompositeBuilderException(e);
-        }
+        wireComponentReferences(composite);
     }
 }



Mime
View raw message