You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2007/02/14 15:45:34 UTC
svn commit: r507551 - in
/incubator/tuscany/branches/sca-java-integration/sca/kernel:
core/src/main/java/org/apache/tuscany/core/builder/
core/src/main/java/org/apache/tuscany/core/implementation/java/
core/src/main/java/org/apache/tuscany/core/wire/ s...
Author: antelder
Date: Wed Feb 14 06:45:33 2007
New Revision: 507551
URL: http://svn.apache.org/viewvc?view=rev&rev=507551
Log:
Various work arounds to get the wsdl itest going
Modified:
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/java/JavaComponentBuilder.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/java/JavaComponentTypeLoader.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/WireServiceExtension.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/java/JavaIDLUtils.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Operation.java
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java?view=diff&rev=507551&r1=507550&r2=507551
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/builder/ConnectorImpl.java Wed Feb 14 06:45:33 2007
@@ -144,7 +144,16 @@
// match outbound to inbound chains
for (OutboundInvocationChain outboundChain : sourceWire.getInvocationChains().values()) {
Operation<?> operation = outboundChain.getOperation();
- InboundInvocationChain inboundChain = targetChains.get(operation);
+
+ // TODO: TUSCANY-1111, can't use targetChains.get with different IDLs so use simple name matching
+ // InboundInvocationChain inboundChain = targetChains.get(operation);
+ InboundInvocationChain inboundChain = null; // = targetChains.get(operation);
+ for (InboundInvocationChain ic: targetChains.values()) {
+ if (ic.getOperation().getName().equals(operation.getName())) {
+ inboundChain = ic;
+ break;
+ }
+ }
if (inboundChain == null) {
throw new IncompatibleInterfacesException(sourceWire, targetWire);
}
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/java/JavaComponentBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/java/JavaComponentBuilder.java?view=diff&rev=507551&r1=507550&r2=507551
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/java/JavaComponentBuilder.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/java/JavaComponentBuilder.java Wed Feb 14 06:45:33 2007
@@ -22,6 +22,10 @@
import java.lang.reflect.Member;
import java.lang.reflect.Method;
+import org.apache.tuscany.core.implementation.PojoConfiguration;
+import org.apache.tuscany.core.injection.MethodEventInvoker;
+import org.apache.tuscany.core.injection.PojoObjectFactory;
+import org.apache.tuscany.core.injection.ResourceObjectFactory;
import org.apache.tuscany.spi.ObjectFactory;
import org.apache.tuscany.spi.annotation.Autowire;
import org.apache.tuscany.spi.builder.BuilderConfigException;
@@ -37,13 +41,9 @@
import org.apache.tuscany.spi.implementation.java.PojoComponentType;
import org.apache.tuscany.spi.implementation.java.Resource;
import org.apache.tuscany.spi.model.ComponentDefinition;
+import org.apache.tuscany.spi.model.ComponentType;
import org.apache.tuscany.spi.model.PropertyValue;
-import org.apache.tuscany.core.implementation.PojoConfiguration;
-import org.apache.tuscany.core.injection.MethodEventInvoker;
-import org.apache.tuscany.core.injection.PojoObjectFactory;
-import org.apache.tuscany.core.injection.ResourceObjectFactory;
-
/**
* Builds a Java-based atomic context from a component definition
*
@@ -147,14 +147,16 @@
return component;
}
- private void handleCallbackSites(
- PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> componentType,
- PojoConfiguration configuration) {
- for (JavaMappedService service : componentType.getServices().values()) {
- // setup callback injection sites
- if (service.getCallbackReferenceName() != null) {
- // Only if there is a callback reference in the service
- configuration.addCallbackSite(service.getCallbackReferenceName(), service.getCallbackMember());
+ private void handleCallbackSites(ComponentType componentType, PojoConfiguration configuration) {
+ for (Object sd : componentType.getServices().values()) {
+ // TODO: TUSCANY-1111, if using componentType side file with wsdl idl then may not get JavaMappedService
+ if (sd instanceof JavaMappedService) {
+ JavaMappedService service = (JavaMappedService) sd;
+ // setup callback injection sites
+ if (service.getCallbackReferenceName() != null) {
+ // Only if there is a callback reference in the service
+ configuration.addCallbackSite(service.getCallbackReferenceName(), service.getCallbackMember());
+ }
}
}
}
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/java/JavaComponentTypeLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/java/JavaComponentTypeLoader.java?view=diff&rev=507551&r1=507550&r2=507551
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/java/JavaComponentTypeLoader.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/java/JavaComponentTypeLoader.java Wed Feb 14 06:45:33 2007
@@ -19,13 +19,14 @@
package org.apache.tuscany.core.implementation.java;
import java.net.URL;
+import java.util.Iterator;
-import org.osoa.sca.annotations.Constructor;
-
+import org.apache.tuscany.core.util.JavaIntrospectionHelper;
import org.apache.tuscany.spi.annotation.Autowire;
import org.apache.tuscany.spi.component.CompositeComponent;
import org.apache.tuscany.spi.deployer.DeploymentContext;
import org.apache.tuscany.spi.extension.ComponentTypeLoaderExtension;
+import org.apache.tuscany.spi.idl.java.JavaServiceContract;
import org.apache.tuscany.spi.implementation.java.IntrospectionRegistry;
import org.apache.tuscany.spi.implementation.java.Introspector;
import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
@@ -35,8 +36,8 @@
import org.apache.tuscany.spi.implementation.java.ProcessingException;
import org.apache.tuscany.spi.loader.LoaderException;
import org.apache.tuscany.spi.loader.LoaderRegistry;
-
-import org.apache.tuscany.core.util.JavaIntrospectionHelper;
+import org.apache.tuscany.spi.model.ServiceDefinition;
+import org.osoa.sca.annotations.Constructor;
/**
* @version $Rev$ $Date$
@@ -66,6 +67,20 @@
componentType = loadByIntrospection(parent, implementation, deploymentContext);
} else {
componentType = loadFromSidefile(parent, resource, deploymentContext);
+
+ // TODO: TUSCANY-1111, add in reqd bits missing from sidefile
+ PojoComponentType tempComponentType = loadByIntrospection(parent, implementation, deploymentContext);
+ componentType.setConstructorDefinition(tempComponentType.getConstructorDefinition());
+ componentType.setImplementationScope(tempComponentType.getImplementationScope());
+
+ Iterator it = tempComponentType.getServices().values().iterator();
+ for (Object o : componentType.getServices().values()) {
+ ServiceDefinition sd = (ServiceDefinition) o;
+ if (!(sd.getServiceContract() instanceof JavaServiceContract)) {
+ ServiceDefinition ts = (ServiceDefinition)it.next();
+ sd.getServiceContract().setInterfaceClass(ts.getServiceContract().getInterfaceClass());
+ }
+ }
}
implementation.setComponentType(componentType);
}
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/WireServiceExtension.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/WireServiceExtension.java?view=diff&rev=507551&r1=507550&r2=507551
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/WireServiceExtension.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/WireServiceExtension.java Wed Feb 14 06:45:33 2007
@@ -219,9 +219,10 @@
// Shortcut for performance
return;
}
- if (source.isRemotable() != target.isRemotable()) {
- throw new IncompatibleServiceContractException("Remotable settings do not match", source, target);
- }
+// TODO: TUSCANY-1111, this test fails when wiring java to wsdl
+// if (source.isRemotable() != target.isRemotable()) {
+// throw new IncompatibleServiceContractException("Remotable settings do not match", source, target);
+// }
if (source.getInteractionScope() != target.getInteractionScope()) {
throw new IncompatibleServiceContractException("Interaction scopes settings do not match", source, target);
}
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/java/JavaIDLUtils.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/java/JavaIDLUtils.java?view=diff&rev=507551&r1=507550&r2=507551
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/java/JavaIDLUtils.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/idl/java/JavaIDLUtils.java Wed Feb 14 06:45:33 2007
@@ -74,6 +74,10 @@
* @return true if the operation matches, false if does not
*/
private static <T> boolean match(Operation<T> operation, Method method) {
+ // TODO: TUSCANY-1111, comparing different IDLs fail so use simple name matching
+ if (operation.getServiceContract() != null && !(operation.getServiceContract() instanceof JavaServiceContract)) {
+ return operation.getName().equals(method.getName());
+ }
Class<?>[] params = method.getParameterTypes();
DataType<List<DataType<T>>> inputType = operation.getInputType();
List<DataType<T>> types = inputType.getLogical();
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Operation.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Operation.java?view=diff&rev=507551&r1=507550&r2=507551
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Operation.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/model/Operation.java Wed Feb 14 06:45:33 2007
@@ -279,6 +279,11 @@
if (isMappable()) {
return true;
}
+
+ // TODO: TUSCANY-1111, currently comparing different IDLs fail
+ if (contract != null && !(contract.getClass().equals(operation.getServiceContract().getClass()))) {
+ return true;
+ }
if (faultTypes == null && operation.faultTypes != null) {
return false;
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org