You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jb...@apache.org on 2006/08/12 22:07:45 UTC
svn commit: r431079 - in /incubator/tuscany/java/sca:
core/src/main/java/org/apache/tuscany/core/idl/java/
core/src/test/java/org/apache/tuscany/core/idl/
core/src/test/java/org/apache/tuscany/core/idl/java/
spi/src/main/java/org/apache/tuscany/spi/idl...
Author: jboynes
Date: Sat Aug 12 13:07:44 2006
New Revision: 431079
URL: http://svn.apache.org/viewvc?rev=431079&view=rev
Log:
changes to ServiceContract model to tighten up generics
add an introspector to create a JavaServiceContract from an interface
Added:
incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/InterfaceJavaIntrospector.java (with props)
incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/InterfaceJavaIntrospectorImpl.java (with props)
incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/idl/
incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/idl/java/
incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/idl/java/InterfaceJavaProcessorImplTestCase.java (with props)
incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/idl/
incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/idl/InvalidServiceContractException.java (with props)
incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/idl/OverloadedOperationException.java (with props)
Modified:
incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/JavaServiceContract.java
incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/DataType.java
incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/Operation.java
incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/ServiceContract.java
Added: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/InterfaceJavaIntrospector.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/InterfaceJavaIntrospector.java?rev=431079&view=auto
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/InterfaceJavaIntrospector.java (added)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/InterfaceJavaIntrospector.java Sat Aug 12 13:07:44 2006
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.core.idl.java;
+
+import org.apache.tuscany.spi.idl.InvalidServiceContractException;
+
+/**
+ * Processor for creating JavaServiceContract definitions from Java Classes.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface InterfaceJavaIntrospector {
+ /**
+ * Introspect a Java interface and return a service contract definition.
+ *
+ * @param type the interface to inspect
+ * @return a JavaServiceContract corresponding to the Java interface
+ */
+ <I> JavaServiceContract introspect(Class<I> type) throws InvalidServiceContractException;
+
+ /**
+ * Introspect a Java interface and return a service contract definition.
+ *
+ * @param type the interface to inspect
+ * @param callback the callback interface to inspec
+ * @return a JavaServiceContract corresponding to the Java interface
+ */
+ <I,C> JavaServiceContract introspect(Class<I> type, Class<C> callback) throws InvalidServiceContractException;
+}
Propchange: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/InterfaceJavaIntrospector.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/InterfaceJavaIntrospector.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/InterfaceJavaIntrospectorImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/InterfaceJavaIntrospectorImpl.java?rev=431079&view=auto
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/InterfaceJavaIntrospectorImpl.java (added)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/InterfaceJavaIntrospectorImpl.java Sat Aug 12 13:07:44 2006
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.core.idl.java;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.osoa.sca.annotations.OneWay;
+
+import org.apache.tuscany.spi.idl.InvalidServiceContractException;
+import org.apache.tuscany.spi.idl.OverloadedOperationException;
+import org.apache.tuscany.spi.model.DataType;
+import org.apache.tuscany.spi.model.Operation;
+
+/**
+ * Basic implementation of an InterfaceJavaIntrospector.
+ *
+ * @version $Rev$ $Date$
+ */
+public class InterfaceJavaIntrospectorImpl implements InterfaceJavaIntrospector {
+ public <T> JavaServiceContract introspect(Class<T> type) throws InvalidServiceContractException {
+ return introspect(type, null);
+ }
+
+ public <I,C> JavaServiceContract introspect(Class<I> type, Class<C> callback)
+ throws InvalidServiceContractException {
+ JavaServiceContract contract = new JavaServiceContract();
+
+ contract.setInterfaceName(type.getName());
+ contract.setInterfaceClass(type);
+ contract.setOperations(getOperations(type));
+
+ if (callback != null) {
+ contract.setCallbackName(callback.getName());
+ contract.setCallbackClass(callback);
+ contract.setCallbacksOperations(getOperations(callback));
+ }
+ return contract;
+ }
+
+ private <T> Map<String, Operation<Type>> getOperations(Class<T> type) throws OverloadedOperationException {
+ Method[] methods = type.getMethods();
+ Map<String, Operation<Type>> operations = new HashMap<String, Operation<Type>>(methods.length);
+ for (Method method : methods) {
+ String name = method.getName();
+ if (operations.containsKey(name)) {
+ throw new OverloadedOperationException(method.toString());
+ }
+
+ Type returnType = method.getGenericReturnType();
+ Type[] paramTypes = method.getGenericParameterTypes();
+ Type[] faultTypes = method.getGenericExceptionTypes();
+ boolean nonBlocking = method.isAnnotationPresent(OneWay.class);
+
+ DataType<Type> returnDataType = new DataType<Type>(returnType, returnType);
+ List<DataType<Type>> paramDataTypes = new ArrayList<DataType<Type>>(paramTypes.length);
+ for (Type paramType : paramTypes) {
+ paramDataTypes.add(new DataType<Type>(paramType, paramType));
+ }
+ List<DataType<Type>> faultDataTypes = new ArrayList<DataType<Type>>(faultTypes.length);
+ for (Type faultType : faultTypes) {
+ faultDataTypes.add(new DataType<Type>(faultType, faultType));
+ }
+ Operation<Type> operation =
+ new Operation<Type>(name, returnDataType, paramDataTypes, faultDataTypes, nonBlocking);
+ operations.put(name, operation);
+ }
+ return operations;
+ }
+}
Propchange: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/InterfaceJavaIntrospectorImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/InterfaceJavaIntrospectorImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/JavaServiceContract.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/JavaServiceContract.java?rev=431079&r1=431078&r2=431079&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/JavaServiceContract.java (original)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/idl/java/JavaServiceContract.java Sat Aug 12 13:07:44 2006
@@ -18,6 +18,8 @@
*/
package org.apache.tuscany.core.idl.java;
+import java.lang.reflect.Type;
+
import org.apache.tuscany.spi.model.ServiceContract;
/**
@@ -25,13 +27,9 @@
*
* @version $Rev$ $Date$
*/
-public class JavaServiceContract extends ServiceContract {
+public class JavaServiceContract extends ServiceContract<Type> {
public JavaServiceContract() {
- }
-
- public JavaServiceContract(String interfaceName) {
- super(interfaceName);
}
public JavaServiceContract(Class<?> interfaceClass) {
Added: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/idl/java/InterfaceJavaProcessorImplTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/idl/java/InterfaceJavaProcessorImplTestCase.java?rev=431079&view=auto
==============================================================================
--- incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/idl/java/InterfaceJavaProcessorImplTestCase.java (added)
+++ incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/idl/java/InterfaceJavaProcessorImplTestCase.java Sat Aug 12 13:07:44 2006
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.core.idl.java;
+
+import java.lang.reflect.Type;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.spi.idl.InvalidServiceContractException;
+import org.apache.tuscany.spi.model.DataType;
+import org.apache.tuscany.spi.model.Operation;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class InterfaceJavaProcessorImplTestCase extends TestCase {
+ private InterfaceJavaIntrospectorImpl impl;
+
+ public void testSimpleInterface() throws InvalidServiceContractException {
+ JavaServiceContract contract = impl.introspect(Simple.class);
+ assertEquals(Simple.class.getName(), contract.getInterfaceName());
+ assertEquals(Simple.class, contract.getInterfaceClass());
+ Map<String, Operation<Type>> operations = contract.getOperations();
+ assertEquals(1, operations.size());
+ Operation<Type> baseInt = operations.get("baseInt");
+ assertNotNull(baseInt);
+
+ DataType<Type> returnType = baseInt.getReturnType();
+ assertEquals(Integer.TYPE, returnType.getPhysical());
+ assertEquals(Integer.TYPE, returnType.getLogical());
+
+ List<DataType<Type>> parameterTypes = baseInt.getParameterTypes();
+ assertEquals(1, parameterTypes.size());
+ DataType<Type> arg0 = parameterTypes.get(0);
+ assertEquals(Integer.TYPE, arg0.getPhysical());
+ assertEquals(Integer.TYPE, arg0.getLogical());
+
+ List<DataType<Type>> faultTypes = baseInt.getFaultTypes();
+ assertEquals(1, faultTypes.size());
+ DataType<Type> fault0 = faultTypes.get(0);
+ assertEquals(RuntimeException.class, fault0.getPhysical());
+ assertEquals(RuntimeException.class, fault0.getLogical());
+ }
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ impl = new InterfaceJavaIntrospectorImpl();
+ }
+
+ private static interface Base {
+ int baseInt(int param) throws RuntimeException;
+ }
+
+ private static interface Simple extends Base {
+
+ }
+}
Propchange: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/idl/java/InterfaceJavaProcessorImplTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/core/src/test/java/org/apache/tuscany/core/idl/java/InterfaceJavaProcessorImplTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/idl/InvalidServiceContractException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/idl/InvalidServiceContractException.java?rev=431079&view=auto
==============================================================================
--- incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/idl/InvalidServiceContractException.java (added)
+++ incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/idl/InvalidServiceContractException.java Sat Aug 12 13:07:44 2006
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.spi.idl;
+
+import org.apache.tuscany.spi.TuscanyException;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public abstract class InvalidServiceContractException extends TuscanyException {
+ public InvalidServiceContractException() {
+ }
+
+ public InvalidServiceContractException(String message) {
+ super(message);
+ }
+
+ public InvalidServiceContractException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public InvalidServiceContractException(Throwable cause) {
+ super(cause);
+ }
+}
Propchange: incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/idl/InvalidServiceContractException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/idl/InvalidServiceContractException.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/idl/OverloadedOperationException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/idl/OverloadedOperationException.java?rev=431079&view=auto
==============================================================================
--- incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/idl/OverloadedOperationException.java (added)
+++ incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/idl/OverloadedOperationException.java Sat Aug 12 13:07:44 2006
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.spi.idl;
+
+/**
+ * Exception thrown to indicate that a service contract specification contains an overloaded method.
+ *
+ * @version $Rev$ $Date$
+ */
+public class OverloadedOperationException extends InvalidServiceContractException {
+ public OverloadedOperationException() {
+ }
+
+ public OverloadedOperationException(String message) {
+ super(message);
+ }
+
+ public OverloadedOperationException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public OverloadedOperationException(Throwable cause) {
+ super(cause);
+ }
+}
Propchange: incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/idl/OverloadedOperationException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/idl/OverloadedOperationException.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/DataType.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/DataType.java?rev=431079&r1=431078&r2=431079&view=diff
==============================================================================
--- incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/DataType.java (original)
+++ incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/DataType.java Sat Aug 12 13:07:44 2006
@@ -20,11 +20,12 @@
import java.util.Map;
import java.util.HashMap;
+import java.lang.reflect.Type;
/**
* Representation of the type of data associated with an operation.
* Data is represented in two forms: the physical form used by the runtime and a logical
- * form used by the assembly. The physical form is a Java Class because the runtime is written in Java.
+ * form used by the assembly. The physical form is a Java Type because the runtime is written in Java.
* This may be the same form used by the application but it may not; for example, an application
* that is performing stream processing may want a physical form such as an {@link java.io.InputStream InputStream}
* to semantially operate on application data such as a purchase order.
@@ -35,8 +36,8 @@
*
* @version $Rev$ $Date$
*/
-public class DataType<P,L> extends ModelObject {
- private final Class<P> physical;
+public class DataType<L> extends ModelObject {
+ private final Type physical;
private final L logical;
private final Map<String, Object> metadata = new HashMap<String, Object>();
@@ -47,16 +48,16 @@
* @param logical the logical type
* @see #getLogical()
*/
- public DataType(Class<P> physical, L logical) {
+ public DataType(Type physical, L logical) {
this.physical = physical;
this.logical = logical;
}
/**
- * Returns the physical class used by the runtime.
- * @return the physical class used by the runtime
+ * Returns the physical type used by the runtime.
+ * @return the physical type used by the runtime
*/
- public Class<P> getPhysical() {
+ public Type getPhysical() {
return physical;
}
@@ -64,7 +65,8 @@
* Returns the logical identifier used by the assembly.
* The type of this value identifies the logical type system in use. Known values are:
* <ul>
- * <li>a java.lang.Class identifies a Java type by name and ClassLoader</li>
+ * <li>a java.lang.reflect.Type identifies a Java type by name and ClassLoader;
+ * this includes Java Classes as they are specializations of Type</li>
* <li>a javax.xml.namespace.QName identifies an XML type by local name and namespace</li>
* </ul>
* @return the logical type name
Modified: incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/Operation.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/Operation.java?rev=431079&r1=431078&r2=431079&view=diff
==============================================================================
--- incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/Operation.java (original)
+++ incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/Operation.java Sat Aug 12 13:07:44 2006
@@ -22,14 +22,15 @@
/**
* Represents an operation that is part of a service contract.
+ * The type paramter of this operation identifies the logical type system for all data types.
*
* @version $Rev$ $Date$
*/
-public class Operation {
+public class Operation<T> {
private final String name;
- private final DataType<?,?> returnType;
- private final List<DataType<?,?>> parameterTypes;
- private final List<DataType<? extends Exception, ?>> faultTypes;
+ private final DataType<T> returnType;
+ private final List<DataType<T>> parameterTypes;
+ private final List<DataType<T>> faultTypes;
private final boolean nonBlocking;
/**
@@ -42,9 +43,9 @@
* @param nonBlocking true if the operation is non-blocking
*/
public Operation(String name,
- DataType<?, ?> returnType,
- List<DataType<?, ?>> parameterTypes,
- List<DataType<? extends Exception, ?>> faultTypes,
+ DataType<T> returnType,
+ List<DataType<T>> parameterTypes,
+ List<DataType<T>> faultTypes,
boolean nonBlocking) {
this.name = name;
this.returnType = returnType;
@@ -65,7 +66,7 @@
* Returns the data type returned by the operation.
* @return the data type returned by the operation
*/
- public DataType<?, ?> getReturnType() {
+ public DataType<T> getReturnType() {
return returnType;
}
@@ -73,7 +74,7 @@
* Returns the data types of the parameters passed to the operation.
* @return the data types of the parameters passed to the operation
*/
- public List<DataType<?, ?>> getParameterTypes() {
+ public List<DataType<T>> getParameterTypes() {
return parameterTypes;
}
@@ -81,7 +82,7 @@
* Returns the data types of the faults raised by the operation.
* @return the data types of the faults raised by the operation
*/
- public List<DataType<? extends Exception, ?>> getFaultTypes() {
+ public List<DataType<T>> getFaultTypes() {
return faultTypes;
}
Modified: incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/ServiceContract.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/ServiceContract.java?rev=431079&r1=431078&r2=431079&view=diff
==============================================================================
--- incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/ServiceContract.java (original)
+++ incubator/tuscany/java/sca/spi/src/main/java/org/apache/tuscany/spi/model/ServiceContract.java Sat Aug 12 13:07:44 2006
@@ -25,14 +25,14 @@
*
* @version $Rev$ $Date$
*/
-public abstract class ServiceContract extends ModelObject {
+public abstract class ServiceContract<T> extends ModelObject {
private InteractionScope interactionScope;
private Class<?> interfaceClass;
private String interfaceName;
private String callbackName;
private Class<?> callbackClass;
- private Map<String, Operation> operations;
- private Map<String, Operation> callbacksOperations;
+ private Map<String, Operation<T>> operations;
+ private Map<String, Operation<T>> callbacksOperations;
protected ServiceContract() {
}
@@ -106,19 +106,19 @@
this.callbackClass = callbackClass;
}
- public Map<String, Operation> getOperations() {
+ public Map<String, Operation<T>> getOperations() {
return operations;
}
- public void setOperations(Map<String, Operation> operations) {
+ public void setOperations(Map<String, Operation<T>> operations) {
this.operations = operations;
}
- public Map<String, Operation> getCallbacksOperations() {
+ public Map<String, Operation<T>> getCallbacksOperations() {
return callbacksOperations;
}
- public void setCallbacksOperations(Map<String, Operation> callbacksOperations) {
+ public void setCallbacksOperations(Map<String, Operation<T>> callbacksOperations) {
this.callbacksOperations = callbacksOperations;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org
Re: svn commit: r431079
Posted by Jeremy Boynes <jb...@apache.org>.
Thinking a little more, using the ImplementationProcessor mechanisms
seems like a better way to tackle this. One major advantage would be
that we could add metadata to the service contract based on data type
or annotations (e.g. adding metadata saying that a parameter should
be bound using SDO which could be detected through the marker
interface or an @SDO annotation).
I have a head full of WSDL stuff atm so I'll open a JIRA so we don't
forget.
--
Jeremy
On Aug 12, 2006, at 6:31 PM, Jeremy Boynes wrote:
> Perhaps - this just seemed real simple.
> --
> Jeremy
>
> On Aug 12, 2006, at 6:19 PM, Jim Marino wrote:
>
>> Jeremy,
>>
>> I haven't had time to look at this carefully but would it be
>> better to have InterfaceJavaIntrospector be an
>> ImplementationProcessor since the component type information for
>> POJOs is compiled there?
>>
>> Jim
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Re: svn commit: r431079
Posted by Jeremy Boynes <jb...@apache.org>.
Perhaps - this just seemed real simple.
--
Jeremy
On Aug 12, 2006, at 6:19 PM, Jim Marino wrote:
> Jeremy,
>
> I haven't had time to look at this carefully but would it be better
> to have InterfaceJavaIntrospector be an ImplementationProcessor
> since the component type information for POJOs is compiled there?
>
> Jim
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org
Fwd: svn commit: r431079
Posted by Jim Marino <jm...@myromatours.com>.
Jeremy,
I haven't had time to look at this carefully but would it be better
to have InterfaceJavaIntrospector be an ImplementationProcessor since
the component type information for POJOs is compiled there?
Jim
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org