From db72136306cdedbee6b1cfb03a299fab8157ff8e Mon Sep 17 00:00:00 2001 From: rfeng Date: Fri, 26 Sep 2008 22:00:53 +0000 Subject: Clone interface to configure the databinding git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@699516 13f79535-47bb-0310-9956-ffa450edef68 --- .../xquery/xml/XQueryIntrospector.java | 29 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/java/sca/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryIntrospector.java b/java/sca/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryIntrospector.java index 6f18e518bd..d1e74dd40d 100644 --- a/java/sca/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryIntrospector.java +++ b/java/sca/modules/implementation-xquery/src/main/java/org/apache/tuscany/sca/implementation/xquery/xml/XQueryIntrospector.java @@ -217,11 +217,21 @@ public class XQueryIntrospector { service.setName(name); // Set the call interface and, if present, the callback interface - JavaInterface callInterface = javaFactory.createJavaInterface(interfaze); + JavaInterface callInterface = null; + try { + callInterface = (JavaInterface) javaFactory.createJavaInterface(interfaze).clone(); + } catch (CloneNotSupportedException e) { + // Ignore + } //setDataBindingForInterface(callInterface, DataObject.class.getName()); service.getInterfaceContract().setInterface(callInterface); if (callInterface.getCallbackClass() != null) { - JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass()); + JavaInterface callbackInterface = null; + try { + callbackInterface = (JavaInterface) javaFactory.createJavaInterface(callInterface.getCallbackClass()).clone(); + } catch (CloneNotSupportedException e) { + //Ignore + } //setDataBindingForInterface(callbackInterface, DataObject.class.getName()); service.getInterfaceContract().setCallbackInterface(callbackInterface); } @@ -253,10 +263,21 @@ public class XQueryIntrospector { reference.setMultiplicity(Multiplicity.ONE_ONE); // Set the call interface and, if present, the callback interface - JavaInterface callInterface = javaFactory.createJavaInterface(interfaze); + // Set the call interface and, if present, the callback interface + JavaInterface callInterface = null; + try { + callInterface = (JavaInterface) javaFactory.createJavaInterface(interfaze).clone(); + } catch (CloneNotSupportedException e) { + // Ignore + } reference.getInterfaceContract().setInterface(callInterface); if (callInterface.getCallbackClass() != null) { - JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass()); + JavaInterface callbackInterface = null; + try { + callbackInterface = (JavaInterface) javaFactory.createJavaInterface(callInterface.getCallbackClass()).clone(); + } catch (CloneNotSupportedException e) { + //Ignore + } reference.getInterfaceContract().setCallbackInterface(callbackInterface); } -- cgit v1.2.3