summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-10-22 01:39:39 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2009-10-22 01:39:39 +0000
commita368e7155b9087a686dd6ebbdd3cbbd8bdea9571 (patch)
tree58ebe6f96cee5863f3dbbe15a4818ea77fc48e3b /java/sca
parent09ab9f0bd73e9b2cb461e5f83df1268641e25c74 (diff)
TUSCANY-3294 - Adding check in the runtime to validate JCA100006, that states that JAX-WS client-side asynchronous pooling and callback methods are not allowed in service interface
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@828276 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca')
-rw-r--r--java/sca/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/EndpointBuilderImpl.java47
1 files changed, 41 insertions, 6 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 e122df35c3..a2e7819d24 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
@@ -19,6 +19,8 @@
package org.apache.tuscany.sca.builder.impl;
+import java.util.List;
+
import org.apache.tuscany.sca.assembly.AssemblyFactory;
import org.apache.tuscany.sca.assembly.Binding;
import org.apache.tuscany.sca.assembly.Component;
@@ -31,6 +33,8 @@ import org.apache.tuscany.sca.assembly.builder.CompositeBuilder;
import org.apache.tuscany.sca.assembly.builder.CompositeBuilderException;
import org.apache.tuscany.sca.core.ExtensionPointRegistry;
import org.apache.tuscany.sca.core.FactoryExtensionPoint;
+import org.apache.tuscany.sca.interfacedef.Operation;
+import org.apache.tuscany.sca.monitor.Monitor;
/**
* creates endpoint models for component services.
@@ -50,26 +54,57 @@ public class EndpointBuilderImpl implements CompositeBuilder {
* @param definitions
* @param monitor - a Monitor for logging errors
*/
- public Composite build(Composite composite, BuilderContext context)
- throws CompositeBuilderException {
+ public Composite build(Composite composite, BuilderContext context) throws CompositeBuilderException {
- processComponentServices(composite);
+ processComponentServices(composite, context);
return composite;
- } // end method build
+ }
- private void processComponentServices(Composite composite) {
+ private void processComponentServices(Composite composite, BuilderContext context) {
+ Monitor monitor = context.getMonitor();
+
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);
+ 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
+ }
+
+
+ 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