Author: slaws
Date: Mon Mar  2 11:14:10 2009
New Revision: 749273

URL: http://svn.apache.org/viewvc?rev=749273&view=rev
Log:
Get rid of some old comments

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

Modified: 
tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java?rev=749273&r1=749272&r2=749273&view=diff
==============================================================================
--- 
tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java
 (original)
+++ 
tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/ComponentReferenceWireBuilderImpl.java
 Mon Mar  2 11:14:10 2009
@@ -665,167 +665,7 @@
             } else {
                 // do nothing as no targets have been specified so the bindings
                 // in the reference binding list are assumed to be manually 
configured
-            }
-                
-            
-/*            
-            // Select the reference bindings matching the target service 
bindings 
-            List<Binding> selectedBindings = new ArrayList<Binding>();
-            List<Binding> selectedCallbackBindings = null;
-    
-            // Handle callback
-            boolean bidirectional = false;
-            
-            if (componentReference.getInterfaceContract() != null && 
componentReference.getInterfaceContract().getCallbackInterface() != null) {
-                bidirectional = true;
-                selectedCallbackBindings = new ArrayList<Binding>();
-            }
-    
-            for (Target target : targets) {
-                
-                Component targetComponent = target.getComponent();
-                ComponentService targetComponentService = target.getService();
-                if (targetComponentService.getService() instanceof 
CompositeService) {
-                    CompositeService compositeService = (CompositeService) 
targetComponentService.getService();
-                    // Find the promoted component service
-                    targetComponentService = 
ServiceConfigurationUtil.getPromotedComponentService(compositeService);
-                }
-                
-                try  {
-                    
PolicyConfigurationUtil.determineApplicableBindingPolicySets(componentReference,
 targetComponentService);
-                } catch ( Exception e ) {
-                    warning("Policy related exception: " + e, e);
-                    //throw new RuntimeException(e);
-                }
-
-                // Match the binding against the bindings of the target service
-                Binding selected = 
BindingConfigurationUtil.resolveBindings(componentReference, targetComponent, 
targetComponentService);
-                if (selected == null) {
-                    warning("NoMatchingBinding", componentReference, 
componentReference.getName(), targetComponentService.getName());
-                } else {
-                    selectedBindings.add(selected);
-                }
-                if (bidirectional) {
-                    Binding selectedCallback = 
BindingConfigurationUtil.resolveCallbackBindings(componentReference, 
targetComponent, targetComponentService);
-                    if (selectedCallback != null) {
-                        selectedCallbackBindings.add(selectedCallback);
-                    }
-                }
-            }
-*/                       
-            
-            // Need to tidy up the reference binding list and add in the 
bindings that 
-            // have been selected above. The situation so far...
-            //    Wired reference (1 or more targets are specified)
-            //       Binding.uri = null  - remove as it's left over from 
target resolution
-            //                             the binding will have been moved to 
the target from where 
-            //                             it will be resolved later
-            //       Binding.uri != null - the selected and resolved reference 
binding
-            //    Unwired reference (0 targets)
-            //       Binding.uri = null  - Either a callback reference or the 
reference is yet to be wired
-            //                             by the implementation so leave the 
binding where it is
-            //       Binding.uri != null - from the composite file so leave it 
 
-/*            
-            if ((componentReference.getTargets().size() > 0) ||
-                (!targets.isEmpty())) {
-
-                // Add all the effective bindings
-                componentReference.getBindings().clear();
-                componentReference.getBindings().addAll(selectedBindings);
-                if (bidirectional) {
-                    componentReference.getCallback().getBindings().clear();
-                    
componentReference.getCallback().getBindings().addAll(selectedCallbackBindings);
-                }
-               
-                // add in sca bindings to represent all unresolved targets. 
The sca binding
-                // will try to resolve the target at a later date. 
-                for (ComponentService service : 
componentReference.getTargets()) {
-                    if (service.isUnresolved()) {
-                        SCABinding scaBinding = null;    
-                    
-                        // find the sca binding amongst the candidate binding 
list. We want to 
-                        // find this one and clone it as it may have been 
configured with
-                        // policies
-                        for (Binding binding : service.getBindings()) {
-
-                            if (binding instanceof SCABinding) {
-                                try {
-                                    scaBinding = 
(SCABinding)((OptimizableBinding)binding).clone();
-                                } catch (CloneNotSupportedException ex){
-                                    // we know it is supported on the SCA 
binding
-                                }
-                                break;
-                            }
-                        }
-                        
-                        if (scaBinding != null) {
-                            // configure the cloned SCA binding for this 
reference target
-                            scaBinding.setName(service.getName());
-                            
-                            // this service object holds the list of candidate 
bindings which 
-                            // can be used for later matching
-                            
((OptimizableBinding)scaBinding).setTargetComponentService(service);
-                            componentReference.getBindings().add(scaBinding);
-                        } else {
-                           // not sure we need to raise a warning here as a 
warning will already been 
-                           // thrown previously to indicate the reason why 
there is no sca binding
-                           // 
warning("NoSCABindingAvailableForUnresolvedService", componentReference, 
componentReference.getName(), service.getName());
-                        }
-                    }
-                }
-            }
-
-*/            
-            // Connect the optimizable bindings to their target component and
-            // service
-/*            
-            for (Binding binding : componentReference.getBindings()) {
-                if (!(binding instanceof OptimizableBinding)) {
-                    continue;
-                }
-                OptimizableBinding optimizableBinding = 
(OptimizableBinding)binding;
-                if (optimizableBinding.getTargetComponentService() != null) {
-                    continue;
-                }
-                String uri = optimizableBinding.getURI();
-                if (uri == null) {
-                    continue;
-                }
-                uri = URI.create(uri).getPath();
-                if (uri.startsWith("/")) {
-                    uri = uri.substring(1);
-                }
-                
-                // Resolve the target component and service
-                ComponentService targetComponentService = 
componentServices.get(uri);
-                Component targetComponent;
-                int s = uri.indexOf('/');
-                if (s == -1) {
-                    targetComponent = components.get(uri);
-                } else {
-                    targetComponent = components.get(uri.substring(0, s));
-                }
-
-                if (targetComponentService != null) {
-
-                    // Check that the target component service provides
-                    // a superset of the component reference interface
-                    if (componentReference.getInterfaceContract() == null ||
-                        
interfaceContractMapper.isCompatible(componentReference.getInterfaceContract(), 
targetComponentService.getInterfaceContract())) {
-
-                    } else {
-                        warning("ReferenceIncompatibleInterface",
-                                composite,
-                                composite.getName().toString(),
-                                componentReference.getName(),
-                                uri);
-                    }
-                    optimizableBinding.setTargetComponent(targetComponent);
-                    
optimizableBinding.setTargetComponentService(targetComponentService);
-                    
optimizableBinding.setTargetBinding(targetComponentService.getBinding(optimizableBinding.getClass()));
-                }
-            }
-*/             
+            }             
         }
     }
     

Modified: 
tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java?rev=749273&r1=749272&r2=749273&view=diff
==============================================================================
--- 
tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
 (original)
+++ 
tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeBuilderImpl.java
 Mon Mar  2 11:14:10 2009
@@ -223,9 +223,6 @@
         // Build component reference binding-related information
         componentReferenceBindingBuilder.build(composite, definitions, 
monitor);
 
-        // Fuse nested composites
-        //FIXME do this later
-        //cloneBuilder.fuseCompositeImplementations(composite);
     }
 
 }


Reply via email to