tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sl...@apache.org
Subject svn commit: r828741 - in /tuscany/java/sca/modules: builder/src/main/java/org/apache/tuscany/sca/builder/impl/ deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/ scdl/src/main/java/org/apache/tuscany/sca/scdl/
Date Thu, 22 Oct 2009 15:16:47 GMT
Author: slaws
Date: Thu Oct 22 15:16:38 2009
New Revision: 828741

URL: http://svn.apache.org/viewvc?rev=828741&view=rev
Log:
Add missing monitor.popContext() calls

Modified:
    tuscany/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/EndpointBuilderImpl.java
    tuscany/java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
    tuscany/java/sca/modules/scdl/src/main/java/org/apache/tuscany/sca/scdl/SCDLUtils.java

Modified: tuscany/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/EndpointBuilderImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/EndpointBuilderImpl.java?rev=828741&r1=828740&r2=828741&view=diff
==============================================================================
--- tuscany/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/EndpointBuilderImpl.java
(original)
+++ tuscany/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/EndpointBuilderImpl.java
Thu Oct 22 15:16:38 2009
@@ -67,70 +67,77 @@
         
         for (Component component : composite.getComponents()) {
 
-            monitor.pushContext("Component: " + component.getName().toString());
-
-            // recurse for composite implementations
-            Implementation implementation = component.getImplementation();
-            if (implementation instanceof Composite) {
-                processComponentServices((Composite)implementation, context);
-            }
-
-            // create an endpoint for each component service binding
-            for (ComponentService service : component.getServices()) {
-                monitor.pushContext("Service: " + service.getName());
-                
-                //verify JAX-WS async assertions as in JavaCAA section 11.1
-                List<Operation> asyncOperations = null;
-                try {
-                    asyncOperations = (List<Operation>) service.getInterfaceContract().getInterface().getAttributes().get("JAXWS-ASYNC-OPERATIONS");
-                }catch(Exception e) {
-                    //ignore
+            try {
+                monitor.pushContext("Component: " + component.getName().toString());
+    
+                // recurse for composite implementations
+                Implementation implementation = component.getImplementation();
+                if (implementation instanceof Composite) {
+                    processComponentServices((Composite)implementation, context);
                 }
-                
-
-                if(asyncOperations != null) {
-                    if( ! asyncOperations.isEmpty()) {
-
-                        //error JCA100006
-
-                        //FIXME create a java validation message resource bundle
-                        Monitor.error(monitor, 
-                                      this, 
-                                      null,
-                                      "[JCA100006] JAX-WS client-side asynchronous pooling
and callback methods are not allowed in service interfaces", 
-                                      service, 
-                                      service.getName());                  
-                    }
+    
+                // create an endpoint for each component service binding
+                for (ComponentService service : component.getServices()) {
+                    try {
+                        monitor.pushContext("Service: " + service.getName());
+                        
+                        //verify JAX-WS async assertions as in JavaCAA section 11.1
+                        List<Operation> asyncOperations = null;
+                        try {
+                            asyncOperations = (List<Operation>) service.getInterfaceContract().getInterface().getAttributes().get("JAXWS-ASYNC-OPERATIONS");
+                        }catch(Exception e) {
+                            //ignore
+                        }
+                        
+                        if(asyncOperations != null) {
+                            if( ! asyncOperations.isEmpty()) {
+        
+                                //error JCA100006
+        
+                                //FIXME create a java validation message resource bundle
+                                Monitor.error(monitor, 
+                                              this, 
+                                              null,
+                                              "[JCA100006] JAX-WS client-side asynchronous
pooling and callback methods are not allowed in service interfaces", 
+                                              service, 
+                                              service.getName());                  
+                            }
+                        }
+        
+        
+                        
+        
+                        /* change to finding the promoted component and service
+                         * when the wire is created as storing them here leads to 
+                         * the wrong URI being calculated
+                        Component endpointComponent = component;
+                        ComponentService endpointService = service;
+        
+                        // TODO - EPR - We maintain all endpoints at the right level now
+                        //              but endpoints for promoting services must point down
+                        //              to the services they promote. 
+                        if (service.getService() instanceof CompositeService) {
+                            CompositeService compositeService = (CompositeService)service.getService();
+                            endpointService = ServiceConfigurationUtil.getPromotedComponentService(compositeService);
+                            endpointComponent = ServiceConfigurationUtil.getPromotedComponent(compositeService);
+                        } // end if
+                        */
+        
+                        for (Binding binding : service.getBindings()) {
+                            Endpoint endpoint = assemblyFactory.createEndpoint();
+                            endpoint.setComponent(component);
+                            endpoint.setService(service);
+                            endpoint.setBinding(binding);
+                            endpoint.setUnresolved(false);
+                            service.getEndpoints().add(endpoint);
+                        } // end for
+                    } finally {
+                        monitor.popContext();
+                    }                   
                 }
-
-
-                
-
-                /* change to finding the promoted component and service
-                 * when the wire is created as storing them here leads to 
-                 * the wrong URI being calculated
-                Component endpointComponent = component;
-                ComponentService endpointService = service;
-
-                // TODO - EPR - We maintain all endpoints at the right level now
-                //              but endpoints for promoting services must point down
-                //              to the services they promote. 
-                if (service.getService() instanceof CompositeService) {
-                    CompositeService compositeService = (CompositeService)service.getService();
-                    endpointService = ServiceConfigurationUtil.getPromotedComponentService(compositeService);
-                    endpointComponent = ServiceConfigurationUtil.getPromotedComponent(compositeService);
-                } // end if
-                */
-
-                for (Binding binding : service.getBindings()) {
-                    Endpoint endpoint = assemblyFactory.createEndpoint();
-                    endpoint.setComponent(component);
-                    endpoint.setService(service);
-                    endpoint.setBinding(binding);
-                    endpoint.setUnresolved(false);
-                    service.getEndpoints().add(endpoint);
-                } // end for
-            }
+            } finally {
+                monitor.popContext();
+            }                  
         }
     }
 

Modified: tuscany/java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java?rev=828741&r1=828740&r2=828741&view=diff
==============================================================================
--- tuscany/java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
(original)
+++ tuscany/java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java
Thu Oct 22 15:16:38 2009
@@ -386,8 +386,12 @@
                     Object model = artifact.getModel();
                     // FIXME: Should we check the artifact URI is META-INF/definitions.xml?
                     if (model instanceof Definitions) {
-                        monitor.pushContext("Definitions: " + artifact.getLocation());
-                        DefinitionsUtil.aggregate((Definitions)model, systemDefinitions,
monitor);
+                        try {
+                            monitor.pushContext("Definitions: " + artifact.getLocation());
+                            DefinitionsUtil.aggregate((Definitions)model, systemDefinitions,
monitor);
+                        } finally {
+                            monitor.popContext();
+                        }                            
                     }
                 }
 

Modified: tuscany/java/sca/modules/scdl/src/main/java/org/apache/tuscany/sca/scdl/SCDLUtils.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/scdl/src/main/java/org/apache/tuscany/sca/scdl/SCDLUtils.java?rev=828741&r1=828740&r2=828741&view=diff
==============================================================================
--- tuscany/java/sca/modules/scdl/src/main/java/org/apache/tuscany/sca/scdl/SCDLUtils.java
(original)
+++ tuscany/java/sca/modules/scdl/src/main/java/org/apache/tuscany/sca/scdl/SCDLUtils.java
Thu Oct 22 15:16:38 2009
@@ -168,25 +168,28 @@
         // each contribution so that for unresolved items the resolution
         // processing will look in the system contribution
         for (Contribution contribution : contributions) {
-            monitor.pushContext("Contribution: " + contribution.getURI());
-            // aggregate definitions
-            for (Artifact artifact : contribution.getArtifacts()) {
-                Object model = artifact.getModel();
-                if (model instanceof Definitions) {
-                    monitor.pushContext("Definitions: " + artifact.getLocation());
-                    DefinitionsUtil.aggregate((Definitions)model, systemDefinitions, monitor);
-                    monitor.popContext();
+            try {
+                monitor.pushContext("Contribution: " + contribution.getURI());
+                // aggregate definitions
+                for (Artifact artifact : contribution.getArtifacts()) {
+                    Object model = artifact.getModel();
+                    if (model instanceof Definitions) {
+                        monitor.pushContext("Definitions: " + artifact.getLocation());
+                        DefinitionsUtil.aggregate((Definitions)model, systemDefinitions,
monitor);
+                        monitor.popContext();
+                    }
                 }
+    
+                // create a default import and wire it up to the system contribution
+                // model resolver. This is the trick that makes the resolution processing
+                // skip over to the system contribution if resolution is unsuccessful
+                // in the current contribution
+                DefaultImport defaultImport = contributionFactory.createDefaultImport();
+                defaultImport.setModelResolver(systemContribution.getModelResolver());
+                contribution.getImports().add(defaultImport);
+            } finally {
+                monitor.popContext();
             }
-
-            // create a default import and wire it up to the system contribution
-            // model resolver. This is the trick that makes the resolution processing
-            // skip over to the system contribution if resolution is unsuccessful
-            // in the current contribution
-            DefaultImport defaultImport = contributionFactory.createDefaultImport();
-            defaultImport.setModelResolver(systemContribution.getModelResolver());
-            contribution.getImports().add(defaultImport);
-            monitor.popContext();
         }
 
         ExtensibleModelResolver modelResolver =



Mime
View raw message