Add missing monitor.popContext() calls

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@828741 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
slaws 2009-10-22 15:16:38 +00:00
commit 76b3a4b78f
3 changed files with 95 additions and 81 deletions

View file

@ -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();
}
}
}

View file

@ -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();
}
}
}

View file

@ -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 =