diff options
3 files changed, 95 insertions, 81 deletions
diff --git a/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/EndpointBuilderImpl.java b/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/EndpointBuilderImpl.java index a2e7819d24..6b181db0c1 100644 --- a/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/EndpointBuilderImpl.java +++ b/java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/EndpointBuilderImpl.java @@ -67,70 +67,77 @@ public class EndpointBuilderImpl implements CompositeBuilder { 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(); + } } } diff --git a/java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java b/java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java index 458a581ac0..65958a493c 100644 --- a/java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java +++ b/java/sca/modules/deployment/src/main/java/org/apache/tuscany/sca/deployment/impl/DeployerImpl.java @@ -386,8 +386,12 @@ public class DeployerImpl implements Deployer { 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(); + } } } diff --git a/java/sca/modules/scdl/src/main/java/org/apache/tuscany/sca/scdl/SCDLUtils.java b/java/sca/modules/scdl/src/main/java/org/apache/tuscany/sca/scdl/SCDLUtils.java index 2f2fb04fb3..05908c18f6 100644 --- a/java/sca/modules/scdl/src/main/java/org/apache/tuscany/sca/scdl/SCDLUtils.java +++ b/java/sca/modules/scdl/src/main/java/org/apache/tuscany/sca/scdl/SCDLUtils.java @@ -168,25 +168,28 @@ public class SCDLUtils { // 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 =
|