You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2007/04/03 10:52:49 UTC
svn commit: r525093 [3/4] - in /incubator/tuscany/java/sca/scdl4j:
assembly-xml/src/main/java/org/apache/tuscany/assembly/xml/impl/
assembly-xml/src/test/java/org/apache/tuscany/assembly/xml/
assembly/src/main/java/org/apache/tuscany/assembly/ assembly...
Added: incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/AssemblyFactoryTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/AssemblyFactoryTestCase.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/AssemblyFactoryTestCase.java (added)
+++ incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/AssemblyFactoryTestCase.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,232 @@
+/*
+ * 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.assembly;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.assembly.AbstractProperty;
+import org.apache.tuscany.assembly.AbstractReference;
+import org.apache.tuscany.assembly.AbstractService;
+import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.assembly.Component;
+import org.apache.tuscany.assembly.ComponentProperty;
+import org.apache.tuscany.assembly.ComponentReference;
+import org.apache.tuscany.assembly.ComponentService;
+import org.apache.tuscany.assembly.ComponentType;
+import org.apache.tuscany.assembly.Composite;
+import org.apache.tuscany.assembly.CompositeReference;
+import org.apache.tuscany.assembly.CompositeService;
+import org.apache.tuscany.assembly.ConstrainingType;
+import org.apache.tuscany.assembly.Implementation;
+import org.apache.tuscany.assembly.Multiplicity;
+import org.apache.tuscany.assembly.Property;
+import org.apache.tuscany.assembly.Reference;
+import org.apache.tuscany.assembly.Service;
+import org.apache.tuscany.assembly.Wire;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
+
+/**
+ * Test building of assembly model instances using the assembly factory.
+ *
+ * @version $Rev$ $Date$
+ */
+public class AssemblyFactoryTestCase extends TestCase {
+
+ AssemblyFactory factory;
+
+ public void setUp() throws Exception {
+ factory = new DefaultAssemblyFactory();
+ }
+
+ public void tearDown() throws Exception {
+ factory = null;
+ }
+
+ public void testCreateComponent() {
+ createComponent("AccountServiceComponent1");
+ }
+
+ public void testCreateComponentType() {
+ createComponentType();
+ }
+
+ public void testCreateComposite() {
+ createComposite();
+ }
+
+ public void testCreateConstrainingType() {
+ createConstrainingType();
+ }
+
+ /**
+ * Create a composite
+ */
+ Composite createComposite() {
+ Composite c = factory.createComposite();
+
+ Component c1 = createComponent("AccountServiceComponent1");
+ c.getComponents().add(c1);
+ Component c2 = createComponent("AccountServiceComponent2");
+ c.getComponents().add(c2);
+
+ Wire w = factory.createWire();
+ w.setSource(c1.getReferences().get(0));
+ w.setTarget(c2.getServices().get(0));
+ c.getWires().add(w);
+
+ CompositeService cs = factory.createCompositeService();
+ cs.setName("AccountService");
+ cs.setPromotedService(c1.getServices().get(0));
+ cs.setInterface(new TestInterface(factory));
+ c.getServices().add(cs);
+ cs.getBindings().add(new TestBinding(factory));
+
+ CompositeReference cr = factory.createCompositeReference();
+ cr.setName("StockQuoteService");
+ cr.getPromotedReferences().add(c2.getReferences().get(1));
+ cr.setInterface(new TestInterface(factory));
+ c.getReferences().add(cr);
+ cr.getBindings().add(new TestBinding(factory));
+
+ return c;
+ }
+
+ /**
+ * Create a new component
+ */
+ Component createComponent(String name) {
+ Component c = factory.createComponent();
+ c.setName(name);
+
+ ConstrainingType constraint = createConstrainingType();
+ c.setConstrainingType(constraint);
+
+ Implementation i = new TestImplementation(factory);
+ c.setImplementation(i);
+
+ ComponentProperty p = factory.createComponentProperty();
+ p.setName("currency");
+ p.setDefaultValue("USD");
+ p.setMustSupply(true);
+ p.setXSDType(new QName("", ""));
+ p.setProperty(i.getProperties().get(0));
+ c.getProperties().add(p);
+
+ ComponentReference ref1 = factory.createComponentReference();
+ ref1.setName("accountDataService");
+ ref1.setMultiplicity(Multiplicity.ONE_ONE);
+ ref1.setInterface(new TestInterface(factory));
+ ref1.setReference(i.getReferences().get(0));
+ c.getReferences().add(ref1);
+ ref1.getBindings().add(new TestBinding(factory));
+
+ ComponentReference ref2 = factory.createComponentReference();
+ ref2.setName("stockQuoteService");
+ ref2.setMultiplicity(Multiplicity.ONE_ONE);
+ ref2.setInterface(new TestInterface(factory));
+ ref2.setReference(i.getReferences().get(1));
+ c.getReferences().add(ref2);
+ ref2.getBindings().add(new TestBinding(factory));
+
+ ComponentService s = factory.createComponentService();
+ s.setName("AccountService");
+ s.setInterface(new TestInterface(factory));
+ s.setService(i.getServices().get(0));
+ c.getServices().add(s);
+ s.getBindings().add(new TestBinding(factory));
+
+ return c;
+ }
+
+ /**
+ * Create a new component type
+ *
+ * @return
+ */
+ ComponentType createComponentType() {
+ ComponentType ctype = factory.createComponentType();
+
+ Property p = factory.createProperty();
+ p.setName("currency");
+ p.setDefaultValue("USD");
+ p.setMustSupply(true);
+ p.setXSDType(new QName("", ""));
+ ctype.getProperties().add(p);
+
+ Reference ref1 = factory.createReference();
+ ref1.setName("accountDataService");
+ ref1.setInterface(new TestInterface(factory));
+ ref1.setMultiplicity(Multiplicity.ONE_ONE);
+ ctype.getReferences().add(ref1);
+ ref1.getBindings().add(new TestBinding(factory));
+
+ Reference ref2 = factory.createReference();
+ ref2.setName("stockQuoteService");
+ ref2.setInterface(new TestInterface(factory));
+ ref2.setMultiplicity(Multiplicity.ONE_ONE);
+ ctype.getReferences().add(ref2);
+ ref2.getBindings().add(new TestBinding(factory));
+
+ Service s = factory.createService();
+ s.setName("AccountService");
+ s.setInterface(new TestInterface(factory));
+ ctype.getServices().add(s);
+ s.getBindings().add(new TestBinding(factory));
+
+ return ctype;
+ }
+
+ /**
+ * Create a new constraining type
+ *
+ * @return
+ */
+ ConstrainingType createConstrainingType() {
+ ConstrainingType ctype = factory.createConstrainingType();
+
+ AbstractProperty p = factory.createAbstractProperty();
+ p.setName("currency");
+ p.setDefaultValue("USD");
+ p.setMustSupply(true);
+ p.setXSDType(new QName("", ""));
+ ctype.getProperties().add(p);
+
+ AbstractReference ref1 = factory.createAbstractReference();
+ ref1.setName("accountDataService");
+ ref1.setInterface(new TestInterface(factory));
+ ref1.setMultiplicity(Multiplicity.ONE_ONE);
+ ctype.getReferences().add(ref1);
+
+ AbstractReference ref2 = factory.createAbstractReference();
+ ref2.setName("stockQuoteService");
+ ref2.setInterface(new TestInterface(factory));
+ ref2.setMultiplicity(Multiplicity.ONE_ONE);
+ ctype.getReferences().add(ref2);
+
+ AbstractService s = factory.createAbstractService();
+ s.setName("AccountService");
+ s.setInterface(new TestInterface(factory));
+ ctype.getServices().add(s);
+
+ return ctype;
+ }
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/AssemblyFactoryTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/AssemblyFactoryTestCase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestBinding.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestBinding.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestBinding.java (added)
+++ incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestBinding.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,38 @@
+/*
+ * 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.assembly;
+
+import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.assembly.Binding;
+import org.apache.tuscany.assembly.impl.BindingImpl;
+
+/**
+ * A test interface model.
+ *
+ * @version $Rev$ $Date$
+ */
+public class TestBinding extends BindingImpl implements Binding {
+
+ public TestBinding(AssemblyFactory factory) {
+
+ setName("test");
+ setURI("http://test");
+ }
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestBinding.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestBinding.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestImplementation.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestImplementation.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestImplementation.java (added)
+++ incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestImplementation.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,68 @@
+/*
+ * 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.assembly;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.assembly.Implementation;
+import org.apache.tuscany.assembly.Multiplicity;
+import org.apache.tuscany.assembly.Property;
+import org.apache.tuscany.assembly.Reference;
+import org.apache.tuscany.assembly.Service;
+import org.apache.tuscany.assembly.impl.ComponentTypeImpl;
+
+/**
+ * A test component implementation model.
+ *
+ * @version $Rev$ $Date$
+ */
+public class TestImplementation extends ComponentTypeImpl implements Implementation {
+
+ public TestImplementation(AssemblyFactory factory) {
+
+ Property p = factory.createProperty();
+ p.setName("currency");
+ p.setDefaultValue("USD");
+ p.setMustSupply(true);
+ p.setXSDType(new QName("", ""));
+ getProperties().add(p);
+
+ Reference ref1 = factory.createReference();
+ ref1.setName("accountDataService");
+ ref1.setMultiplicity(Multiplicity.ONE_ONE);
+ getReferences().add(ref1);
+ ref1.getBindings().add(new TestBinding(factory));
+
+ Reference ref2 = factory.createReference();
+ ref2.setName("stockQuoteService");
+ ref2.setMultiplicity(Multiplicity.ONE_ONE);
+ ref2.setInterface(new TestInterface(factory));
+ getReferences().add(ref2);
+ ref2.getBindings().add(new TestBinding(factory));
+
+ Service s = factory.createService();
+ s.setName("AccountService");
+ s.setInterface(new TestInterface(factory));
+ getServices().add(s);
+ s.getBindings().add(new TestBinding(factory));
+
+ }
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestImplementation.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestImplementation.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestInterface.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestInterface.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestInterface.java (added)
+++ incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestInterface.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,43 @@
+/*
+ * 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.assembly;
+
+import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.idl.Interface;
+import org.apache.tuscany.sca.idl.Operation;
+import org.apache.tuscany.sca.idl.impl.InterfaceImpl;
+
+/**
+ * A test interface model.
+ *
+ * @version $Rev$ $Date$
+ */
+public class TestInterface extends InterfaceImpl implements Interface {
+
+ public TestInterface(AssemblyFactory factory) {
+
+ setRemotable(true);
+
+ Operation operation = new TestOperation();
+ operation.setName("test");
+ getOperations().add(operation);
+
+ }
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestInterface.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestInterface.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestOperation.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestOperation.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestOperation.java (added)
+++ incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestOperation.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,31 @@
+/*
+ * 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.assembly;
+
+import org.apache.tuscany.sca.idl.Operation;
+import org.apache.tuscany.sca.idl.impl.OperationImpl;
+
+/**
+ * A test operation model.
+ *
+ * @version $Rev$ $Date$
+ */
+public class TestOperation extends OperationImpl implements Operation {
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestOperation.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/assembly/src/test/java/org/apache/tuscany/assembly/TestOperation.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/sca/scdl4j/idl-java-xml/src/test/java/org/apache/tuscany/idl/java/xml/ReadTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl-java-xml/src/test/java/org/apache/tuscany/idl/java/xml/ReadTestCase.java?view=diff&rev=525093&r1=525092&r2=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl-java-xml/src/test/java/org/apache/tuscany/idl/java/xml/ReadTestCase.java (original)
+++ incubator/tuscany/java/sca/scdl4j/idl-java-xml/src/test/java/org/apache/tuscany/idl/java/xml/ReadTestCase.java Tue Apr 3 01:52:45 2007
@@ -26,11 +26,11 @@
import junit.framework.TestCase;
-import org.apache.tuscany.assembly.model.AssemblyFactory;
-import org.apache.tuscany.assembly.model.ComponentType;
-import org.apache.tuscany.assembly.model.Composite;
-import org.apache.tuscany.assembly.model.ConstrainingType;
-import org.apache.tuscany.assembly.model.impl.DefaultAssemblyFactory;
+import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.assembly.ComponentType;
+import org.apache.tuscany.assembly.Composite;
+import org.apache.tuscany.assembly.ConstrainingType;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
import org.apache.tuscany.assembly.util.CompositeUtil;
import org.apache.tuscany.assembly.util.PrintUtil;
import org.apache.tuscany.assembly.xml.LoaderRegistry;
@@ -39,8 +39,8 @@
import org.apache.tuscany.assembly.xml.impl.ConstrainingTypeLoader;
import org.apache.tuscany.assembly.xml.impl.LoaderRegistryImpl;
import org.apache.tuscany.idl.java.impl.DefaultJavaFactory;
-import org.apache.tuscany.policy.model.PolicyFactory;
-import org.apache.tuscany.policy.model.impl.DefaultPolicyFactory;
+import org.apache.tuscany.policy.PolicyFactory;
+import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
/**
* Test the usability of the assembly model API when loading SCDL
Modified: incubator/tuscany/java/sca/scdl4j/idl-java/src/main/java/org/apache/tuscany/idl/java/JavaInterface.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl-java/src/main/java/org/apache/tuscany/idl/java/JavaInterface.java?view=diff&rev=525093&r1=525092&r2=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl-java/src/main/java/org/apache/tuscany/idl/java/JavaInterface.java (original)
+++ incubator/tuscany/java/sca/scdl4j/idl-java/src/main/java/org/apache/tuscany/idl/java/JavaInterface.java Tue Apr 3 01:52:45 2007
@@ -18,7 +18,7 @@
*/
package org.apache.tuscany.idl.java;
-import org.apache.tuscany.sca.idl.Interface;
+import org.apache.tuscany.idl.Interface;
/**
* Represents a Java interface.
Modified: incubator/tuscany/java/sca/scdl4j/idl-java/src/main/java/org/apache/tuscany/idl/java/impl/JavaInterfaceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl-java/src/main/java/org/apache/tuscany/idl/java/impl/JavaInterfaceImpl.java?view=diff&rev=525093&r1=525092&r2=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl-java/src/main/java/org/apache/tuscany/idl/java/impl/JavaInterfaceImpl.java (original)
+++ incubator/tuscany/java/sca/scdl4j/idl-java/src/main/java/org/apache/tuscany/idl/java/impl/JavaInterfaceImpl.java Tue Apr 3 01:52:45 2007
@@ -18,8 +18,8 @@
*/
package org.apache.tuscany.idl.java.impl;
+import org.apache.tuscany.idl.impl.InterfaceImpl;
import org.apache.tuscany.idl.java.JavaInterface;
-import org.apache.tuscany.sca.idl.impl.InterfaceImpl;
/**
* Represents a Java interface.
Modified: incubator/tuscany/java/sca/scdl4j/idl-wsdl-xml/src/test/java/org/apache/tuscany/idl/wsdl/xml/ReadTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl-wsdl-xml/src/test/java/org/apache/tuscany/idl/wsdl/xml/ReadTestCase.java?view=diff&rev=525093&r1=525092&r2=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl-wsdl-xml/src/test/java/org/apache/tuscany/idl/wsdl/xml/ReadTestCase.java (original)
+++ incubator/tuscany/java/sca/scdl4j/idl-wsdl-xml/src/test/java/org/apache/tuscany/idl/wsdl/xml/ReadTestCase.java Tue Apr 3 01:52:45 2007
@@ -26,11 +26,11 @@
import junit.framework.TestCase;
-import org.apache.tuscany.assembly.model.AssemblyFactory;
-import org.apache.tuscany.assembly.model.ComponentType;
-import org.apache.tuscany.assembly.model.Composite;
-import org.apache.tuscany.assembly.model.ConstrainingType;
-import org.apache.tuscany.assembly.model.impl.DefaultAssemblyFactory;
+import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.assembly.ComponentType;
+import org.apache.tuscany.assembly.Composite;
+import org.apache.tuscany.assembly.ConstrainingType;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
import org.apache.tuscany.assembly.util.CompositeUtil;
import org.apache.tuscany.assembly.util.PrintUtil;
import org.apache.tuscany.assembly.xml.LoaderRegistry;
@@ -39,8 +39,8 @@
import org.apache.tuscany.assembly.xml.impl.ConstrainingTypeLoader;
import org.apache.tuscany.assembly.xml.impl.LoaderRegistryImpl;
import org.apache.tuscany.idl.wsdl.impl.DefaultWSDLFactory;
-import org.apache.tuscany.policy.model.PolicyFactory;
-import org.apache.tuscany.policy.model.impl.DefaultPolicyFactory;
+import org.apache.tuscany.policy.PolicyFactory;
+import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
/**
* Test the usability of the assembly model API when loading SCDL
Modified: incubator/tuscany/java/sca/scdl4j/idl-wsdl/src/main/java/org/apache/tuscany/idl/WSDLInterface.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl-wsdl/src/main/java/org/apache/tuscany/idl/WSDLInterface.java?view=diff&rev=525093&r1=525092&r2=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl-wsdl/src/main/java/org/apache/tuscany/idl/WSDLInterface.java (original)
+++ incubator/tuscany/java/sca/scdl4j/idl-wsdl/src/main/java/org/apache/tuscany/idl/WSDLInterface.java Tue Apr 3 01:52:45 2007
@@ -21,7 +21,6 @@
import javax.wsdl.PortType;
import javax.xml.namespace.QName;
-import org.apache.tuscany.sca.idl.Interface;
/**
* Represents a WSDL interface.
Modified: incubator/tuscany/java/sca/scdl4j/idl-wsdl/src/main/java/org/apache/tuscany/idl/wsdl/impl/WSDLInterfaceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl-wsdl/src/main/java/org/apache/tuscany/idl/wsdl/impl/WSDLInterfaceImpl.java?view=diff&rev=525093&r1=525092&r2=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl-wsdl/src/main/java/org/apache/tuscany/idl/wsdl/impl/WSDLInterfaceImpl.java (original)
+++ incubator/tuscany/java/sca/scdl4j/idl-wsdl/src/main/java/org/apache/tuscany/idl/wsdl/impl/WSDLInterfaceImpl.java Tue Apr 3 01:52:45 2007
@@ -22,7 +22,7 @@
import javax.xml.namespace.QName;
import org.apache.tuscany.idl.WSDLInterface;
-import org.apache.tuscany.sca.idl.impl.InterfaceImpl;
+import org.apache.tuscany.idl.impl.InterfaceImpl;
/**
* Represents a WSDL interface.
Added: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/DataType.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/DataType.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/DataType.java (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/DataType.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,89 @@
+/*
+ * 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.idl;
+
+
+/**
+ * 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 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. The logical description is that used by the
+ * assembly model and is an identifier into some well-known type space; examples
+ * may be a Java type represented by its Class or an XML type represented by its
+ * QName. Every data type may also contain metadata describing the expected
+ * data; for example, it could specify a preferred data binding technology or
+ * the size of a typical instance.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface DataType<L> extends Cloneable {
+ /**
+ * Set the java type for the data
+ * @param cls
+ */
+ void setPhysical(Class cls);
+
+ /**
+ * Returns the physical type used by the runtime.
+ *
+ * @return the physical type used by the runtime
+ */
+ Class getPhysical();
+
+ /**
+ * 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.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
+ */
+ L getLogical();
+
+ /**
+ * @return
+ */
+ String getDataBinding();
+
+ /**
+ * @param dataBinding the dataBinding to set
+ */
+ void setDataBinding(String dataBinding);
+
+ /**
+ * @return
+ * @throws CloneNotSupportedException
+ */
+ Object clone() throws CloneNotSupportedException;
+
+ /**
+ * @param logical the logical to set
+ */
+ void setLogical(L logical);
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/DataType.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/DataType.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/Interface.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/Interface.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/Interface.java (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/Interface.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,65 @@
+/*
+ * 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.idl;
+
+import java.util.List;
+
+/**
+ * Represents a service interface. This interface will typically be extended to
+ * support concrete interface type systems, such as Java interfaces, WSDL 1.1
+ * portTypes and WSDL 2.0 interfaces.
+ */
+public interface Interface {
+
+ /**
+ * Returns true if the interface is a remotable interface..
+ *
+ * @return true if the interface is a remotable interface
+ */
+ boolean isRemotable();
+
+ /**
+ * Sets whether the interface is a remotable or local interface.
+ *
+ * @param remotable indicates whether the interface is remotable or local
+ */
+ void setRemotable(boolean remotable);
+
+ /**
+ * Returns the operations defined on this interface.
+ *
+ * @return the operations defined on this interface
+ */
+ List<Operation> getOperations();
+
+ /**
+ * Returns true if the model element is unresolved.
+ *
+ * @return true if the model element is unresolved.
+ */
+ boolean isUnresolved();
+
+ /**
+ * Sets whether the model element is unresolved.
+ *
+ * @param unresolved whether the model element is unresolved
+ */
+ void setUnresolved(boolean unresolved);
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/Interface.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/Interface.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/Operation.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/Operation.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/Operation.java (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/Operation.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,77 @@
+/*
+ * 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.idl;
+
+import java.util.List;
+
+/**
+ * Represents an operation on a service interface.
+ */
+public interface Operation {
+
+ /**
+ * Returns the name of the operation.
+ *
+ * @return the name of the operation
+ */
+ String getName();
+
+ /**
+ * Sets the name of the operation.
+ *
+ * @param name the name of the operation
+ */
+ void setName(String name);
+
+ /**
+ * Returns true if the model element is unresolved.
+ *
+ * @return true if the model element is unresolved.
+ */
+ boolean isUnresolved();
+
+ /**
+ * Sets whether the model element is unresolved.
+ *
+ * @param unresolved whether the model element is unresolved
+ */
+ void setUnresolved(boolean unresolved);
+
+ /**
+ * Get the data type that represents the input of this operation. The logic type is
+ * a list of data types and each element represents a parameter
+ *
+ * @return the inputType
+ */
+ DataType<List<DataType>> getInputType();
+
+ /**
+ * Get the data type for the output
+ *
+ * @return the outputType
+ */
+ DataType getOutputType();
+
+ /**
+ * Get a list of data types to represent the faults/exceptions
+ * @return the faultTypes
+ */
+ List<DataType> getFaultTypes();
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/Operation.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/Operation.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/DataTypeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/DataTypeImpl.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/DataTypeImpl.java (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/DataTypeImpl.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,188 @@
+/*
+ * 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.idl.impl;
+
+import org.apache.tuscany.idl.DataType;
+
+/**
+ * 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 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. The logical description is that used by the
+ * assembly model and is an identifier into some well-known type space; examples
+ * may be a Java type represented by its Class or an XML type represented by its
+ * QName. Every data type may also contain metadata describing the expected
+ * data; for example, it could specify a preferred data binding technology or
+ * the size of a typical instance.
+ *
+ * @version $Rev$ $Date$
+ */
+public class DataTypeImpl<L> implements DataType<L> {
+ private boolean unresolved = true;
+ private String dataBinding;
+ private Class physical;
+ private L logical;
+
+ /**
+ * Construct a data type specifying the physical and logical types.
+ *
+ * @param physical the physical class used by the runtime
+ * @param logical the logical type
+ * @see #getLogical()
+ */
+ public DataTypeImpl(Class physical, L logical) {
+ this.physical = physical;
+ this.logical = logical;
+ }
+
+ public DataTypeImpl(String dataBinding, Class physical, L logical) {
+ this.dataBinding = dataBinding;
+ this.physical = physical;
+ this.logical = logical;
+ }
+
+ /**
+ * Returns the physical type used by the runtime.
+ *
+ * @return the physical type used by the runtime
+ */
+ public Class getPhysical() {
+ return physical;
+ }
+
+ /**
+ * 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.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
+ */
+ public L getLogical() {
+ return logical;
+ }
+
+ public String getDataBinding() {
+ return dataBinding;
+ }
+
+ /**
+ * @param dataBinding the dataBinding to set
+ */
+ public void setDataBinding(String dataBinding) {
+ this.dataBinding = dataBinding;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.append(physical).append(" ").append(dataBinding).append(" ").append(logical);
+ return sb.toString();
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ DataTypeImpl copy = (DataTypeImpl)super.clone();
+ return copy;
+ }
+
+ /**
+ * @param logical the logical to set
+ */
+ public void setLogical(L logical) {
+ this.logical = logical;
+ }
+
+ @Override
+ public int hashCode() {
+ final int PRIME = 31;
+ int result = 1;
+ result = PRIME * result + ((dataBinding == null) ? 0 : dataBinding.hashCode());
+ result = PRIME * result + ((logical == null) ? 0 : logical.hashCode());
+ result = PRIME * result + ((physical == null) ? 0 : physical.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final DataTypeImpl other = (DataTypeImpl)obj;
+ if (dataBinding == null) {
+ if (other.dataBinding != null) {
+ return false;
+ }
+ } else if (!dataBinding.equals(other.dataBinding)) {
+ return false;
+ }
+ if (logical == null) {
+ if (other.logical != null) {
+ return false;
+ }
+ } else if (!logical.equals(other.logical)) {
+ return false;
+ }
+ if (physical == null) {
+ if (other.physical != null) {
+ return false;
+ }
+ } else if (!physical.equals(other.physical)) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * @return the unresolved
+ */
+ public boolean isUnresolved() {
+ return unresolved;
+ }
+
+ /**
+ * @param unresolved the unresolved to set
+ */
+ public void setUnresolved(boolean unresolved) {
+ this.unresolved = unresolved;
+ }
+
+ /**
+ * @param physical the physical to set
+ */
+ public void setPhysical(Class physical) {
+ this.physical = physical;
+ }
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/DataTypeImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/DataTypeImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/InterfaceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/InterfaceImpl.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/InterfaceImpl.java (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/InterfaceImpl.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,58 @@
+/*
+ * 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.idl.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.idl.Interface;
+import org.apache.tuscany.idl.Operation;
+
+/**
+ * Represents a service interface.
+ *
+ * @version $Rev$ $Date$
+ */
+public class InterfaceImpl implements Interface {
+
+ private boolean remotable;
+ private List<Operation> operations = new ArrayList<Operation>();
+ private boolean unresolved;
+
+ public boolean isRemotable() {
+ return remotable;
+ }
+
+ public void setRemotable(boolean local) {
+ this.remotable = local;
+ }
+
+ public List<Operation> getOperations() {
+ return operations;
+ }
+
+ public boolean isUnresolved() {
+ return unresolved;
+ }
+
+ public void setUnresolved(boolean undefined) {
+ this.unresolved = undefined;
+ }
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/InterfaceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/InterfaceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/OperationImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/OperationImpl.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/OperationImpl.java (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/OperationImpl.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,97 @@
+/*
+ * 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.idl.impl;
+
+import java.util.List;
+
+import org.apache.tuscany.idl.DataType;
+import org.apache.tuscany.idl.Operation;
+
+/**
+ * Represents an operation on a service interface.
+ *
+ * @version $Rev$ $Date$
+ */
+public class OperationImpl implements Operation {
+
+ private String name;
+ private boolean unresolved;
+ private DataType outputType;
+ private DataType<List<DataType>> inputType;
+ private List<DataType> faultTypes;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public boolean isUnresolved() {
+ return unresolved;
+ }
+
+ public void setUnresolved(boolean undefined) {
+ this.unresolved = undefined;
+ }
+
+ /**
+ * @return the faultTypes
+ */
+ public List<DataType> getFaultTypes() {
+ return faultTypes;
+ }
+
+ /**
+ * @param faultTypes the faultTypes to set
+ */
+ public void setFaultTypes(List<DataType> faultTypes) {
+ this.faultTypes = faultTypes;
+ }
+
+ /**
+ * @return the inputType
+ */
+ public DataType<List<DataType>> getInputType() {
+ return inputType;
+ }
+
+ /**
+ * @param inputType the inputType to set
+ */
+ public void setInputType(DataType<List<DataType>> inputType) {
+ this.inputType = inputType;
+ }
+
+ /**
+ * @return the outputType
+ */
+ public DataType getOutputType() {
+ return outputType;
+ }
+
+ /**
+ * @param outputType the outputType to set
+ */
+ public void setOutputType(DataType outputType) {
+ this.outputType = outputType;
+ }
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/OperationImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/impl/OperationImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/ElementInfo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/ElementInfo.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/ElementInfo.java (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/ElementInfo.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,60 @@
+/*
+ * 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.idl.util;
+
+import javax.xml.namespace.QName;
+
+/**
+ * An abstraction of XML schema elements
+ */
+public class ElementInfo {
+ private final QName name;
+ private final TypeInfo type;
+
+ /**
+ * @param name
+ * @param type
+ */
+ public ElementInfo(QName name, TypeInfo type) {
+ super();
+ this.name = name;
+ this.type = type;
+ }
+
+ /**
+ * @return the name
+ */
+ public QName getQName() {
+ return name;
+ }
+
+ /**
+ * @return the type
+ */
+ public TypeInfo getType() {
+ return type;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.append("Element: ").append(name).append(" ").append(type);
+ return sb.toString();
+ }
+}
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/ElementInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/ElementInfo.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/TypeInfo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/TypeInfo.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/TypeInfo.java (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/TypeInfo.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,72 @@
+/*
+ * 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.idl.util;
+
+import javax.xml.namespace.QName;
+
+/**
+ * An abstraction of XML schema types
+ */
+public class TypeInfo {
+ private QName name;
+
+ private boolean isSimpleType;
+
+ private TypeInfo baseType;
+
+ /**
+ * @param name
+ * @param isSimpleType
+ */
+ public TypeInfo(QName name, boolean isSimpleType, TypeInfo baseType) {
+ super();
+ this.name = name;
+ this.isSimpleType = isSimpleType;
+ this.baseType = baseType;
+ }
+
+ /**
+ * @return the isSimpleType
+ */
+ public boolean isSimpleType() {
+ return isSimpleType;
+ }
+
+ /**
+ * @return the name
+ */
+ public QName getQName() {
+ return name;
+ }
+
+ /**
+ * @return the baseType
+ */
+ public TypeInfo getBaseType() {
+ return baseType;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.append("Type: ").append(name);
+ return sb.toString();
+ }
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/TypeInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/TypeInfo.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/WrapperInfo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/WrapperInfo.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/WrapperInfo.java (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/WrapperInfo.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,140 @@
+/*
+ * 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.idl.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.idl.DataType;
+import org.apache.tuscany.idl.impl.DataTypeImpl;
+
+/**
+ * The "Wrapper Style" WSDL operation is defined by The Java API for XML-Based
+ * Web Services (JAX-WS) 2.0 specification, section 2.3.1.2 Wrapper Style. <p/>
+ * A WSDL operation qualifies for wrapper style mapping only if the following
+ * criteria are met:
+ * <ul>
+ * <li>(i) The operation�s input and output messages (if present) each contain
+ * only a single part
+ * <li>(ii) The input message part refers to a global element declaration whose
+ * localname is equal to the operation name
+ * <li>(iii) The output message part refers to a global element declaration
+ * <li>(iv) The elements referred to by the input and output message parts
+ * (henceforth referred to as wrapper elements) are both complex types defined
+ * using the xsd:sequence compositor
+ * <li>(v) The wrapper elements only contain child elements, they must not
+ * contain other structures such as wildcards (element or attribute),
+ * xsd:choice, substitution groups (element references are not permitted) or
+ * attributes; furthermore, they must not be nillable.
+ * </ul>
+ *
+ * @version $Rev$ $Date$
+ */
+public class WrapperInfo {
+ private ElementInfo inputWrapperElement;
+
+ private ElementInfo outputWrapperElement;
+
+ private List<ElementInfo> inputChildElements;
+
+ private List<ElementInfo> outputChildElements;
+
+ private DataType<List<DataType<XMLType>>> unwrappedInputType;
+
+ private DataType<XMLType> unwrappedOutputType;
+
+ private String dataBinding;
+
+ public WrapperInfo(String dataBinding,
+ ElementInfo inputWrapperElement,
+ ElementInfo outputWrapperElement,
+ List<ElementInfo> inputElements,
+ List<ElementInfo> outputElements) {
+ super();
+ this.dataBinding = dataBinding;
+ this.inputWrapperElement = inputWrapperElement;
+ this.outputWrapperElement = outputWrapperElement;
+ this.inputChildElements = inputElements;
+ this.outputChildElements = outputElements;
+ }
+
+ /**
+ * @return the inputElements
+ */
+ public List<ElementInfo> getInputChildElements() {
+ return inputChildElements;
+ }
+
+ /**
+ * @return the inputWrapperElement
+ */
+ public ElementInfo getInputWrapperElement() {
+ return inputWrapperElement;
+ }
+
+ /**
+ * @return the outputElements
+ */
+ public List<ElementInfo> getOutputChildElements() {
+ return outputChildElements;
+ }
+
+ /**
+ * @return the outputWrapperElement
+ */
+ public ElementInfo getOutputWrapperElement() {
+ return outputWrapperElement;
+ }
+
+ /**
+ * @return the unwrappedInputType
+ */
+ public DataType<List<DataType<XMLType>>> getUnwrappedInputType() {
+ if (unwrappedInputType == null) {
+ List<DataType<XMLType>> childTypes = new ArrayList<DataType<XMLType>>();
+ for (ElementInfo element : getInputChildElements()) {
+ DataType<XMLType> type = new DataTypeImpl<XMLType>(dataBinding, Object.class, new XMLType(element));
+ childTypes.add(type);
+ }
+ unwrappedInputType = new DataTypeImpl<List<DataType<XMLType>>>("idl:unwrapped.input", Object[].class,
+ childTypes);
+ }
+ return unwrappedInputType;
+ }
+
+ /**
+ * @return the unwrappedOutputType
+ */
+ public DataType<XMLType> getUnwrappedOutputType() {
+ if (unwrappedOutputType == null) {
+ List<ElementInfo> elements = getOutputChildElements();
+ if (elements != null && elements.size() > 0) {
+ if (elements.size() > 1) {
+ // We don't support output with multiple parts
+ throw new IllegalArgumentException("Multi-part output is not supported");
+ }
+ ElementInfo element = elements.get(0);
+
+ unwrappedOutputType = new DataTypeImpl<XMLType>(dataBinding, Object.class, new XMLType(element));
+ }
+ }
+ return unwrappedOutputType;
+ }
+}
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/WrapperInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/WrapperInfo.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/XMLType.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/XMLType.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/XMLType.java (added)
+++ incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/XMLType.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,124 @@
+/*
+ * 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.idl.util;
+
+import javax.xml.namespace.QName;
+
+/**
+ * The metadata for an XML element or type
+ */
+public class XMLType {
+ public static final XMLType UNKNOWN = new XMLType(null, null);
+ protected QName element;
+ protected QName type;
+
+ /**
+ * @param element
+ */
+ public XMLType(ElementInfo element) {
+ super();
+ this.element = element.getQName();
+ if (element.getType() != null) {
+ this.type = element.getType().getQName();
+ }
+ }
+
+ /**
+ * @param element
+ */
+ public XMLType(TypeInfo type) {
+ this.element = null;
+ this.type = type.getQName();
+ }
+
+ public XMLType(QName element, QName type) {
+ this.element = element;
+ this.type = type;
+ }
+
+ /**
+ * @return the type
+ */
+ public QName getTypeName() {
+ return type;
+ }
+
+ public boolean isElement() {
+ return element != null;
+ }
+
+ public QName getElementName() {
+ return element;
+ }
+
+ public static XMLType getType(QName type) {
+ return new XMLType(null, type);
+ }
+
+ /**
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ final int PRIME = 31;
+ int result = 1;
+ result = PRIME * result + ((element == null) ? 0 : element.hashCode());
+ result = PRIME * result + ((type == null) ? 0 : type.hashCode());
+ return result;
+ }
+
+ /**
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final XMLType other = (XMLType)obj;
+ if (element == null) {
+ if (other.element != null) {
+ return false;
+ }
+ } else if (!element.equals(other.element)) {
+ return false;
+ }
+ if (type == null) {
+ if (other.type != null) {
+ return false;
+ }
+ } else if (!type.equals(other.type)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "Element: " + element + " Type: " + type;
+ }
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/XMLType.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/idl/src/main/java/org/apache/tuscany/idl/util/XMLType.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/tuscany/java/sca/scdl4j/impl-java-xml/src/test/java/org/apache/tuscany/implementation/java/xml/ReadTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/impl-java-xml/src/test/java/org/apache/tuscany/implementation/java/xml/ReadTestCase.java?view=diff&rev=525093&r1=525092&r2=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/impl-java-xml/src/test/java/org/apache/tuscany/implementation/java/xml/ReadTestCase.java (original)
+++ incubator/tuscany/java/sca/scdl4j/impl-java-xml/src/test/java/org/apache/tuscany/implementation/java/xml/ReadTestCase.java Tue Apr 3 01:52:45 2007
@@ -26,11 +26,11 @@
import junit.framework.TestCase;
-import org.apache.tuscany.assembly.model.AssemblyFactory;
-import org.apache.tuscany.assembly.model.ComponentType;
-import org.apache.tuscany.assembly.model.Composite;
-import org.apache.tuscany.assembly.model.ConstrainingType;
-import org.apache.tuscany.assembly.model.impl.DefaultAssemblyFactory;
+import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.assembly.ComponentType;
+import org.apache.tuscany.assembly.Composite;
+import org.apache.tuscany.assembly.ConstrainingType;
+import org.apache.tuscany.assembly.impl.DefaultAssemblyFactory;
import org.apache.tuscany.assembly.util.CompositeUtil;
import org.apache.tuscany.assembly.util.PrintUtil;
import org.apache.tuscany.assembly.xml.LoaderRegistry;
@@ -39,8 +39,8 @@
import org.apache.tuscany.assembly.xml.impl.ConstrainingTypeLoader;
import org.apache.tuscany.assembly.xml.impl.LoaderRegistryImpl;
import org.apache.tuscany.implementation.java.impl.DefaultJavaImplementationFactory;
-import org.apache.tuscany.policy.model.PolicyFactory;
-import org.apache.tuscany.policy.model.impl.DefaultPolicyFactory;
+import org.apache.tuscany.policy.PolicyFactory;
+import org.apache.tuscany.policy.impl.DefaultPolicyFactory;
/**
* Test the usability of the assembly model API when loading SCDL
Modified: incubator/tuscany/java/sca/scdl4j/impl-java/src/main/java/org/apache/tuscany/implementation/java/JavaImplementation.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/impl-java/src/main/java/org/apache/tuscany/implementation/java/JavaImplementation.java?view=diff&rev=525093&r1=525092&r2=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/impl-java/src/main/java/org/apache/tuscany/implementation/java/JavaImplementation.java (original)
+++ incubator/tuscany/java/sca/scdl4j/impl-java/src/main/java/org/apache/tuscany/implementation/java/JavaImplementation.java Tue Apr 3 01:52:45 2007
@@ -18,7 +18,7 @@
*/
package org.apache.tuscany.implementation.java;
-import org.apache.tuscany.assembly.model.Implementation;
+import org.apache.tuscany.assembly.Implementation;
/**
* Represents a Java implementation.
Modified: incubator/tuscany/java/sca/scdl4j/impl-java/src/main/java/org/apache/tuscany/implementation/java/impl/DefaultJavaImplementationFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/impl-java/src/main/java/org/apache/tuscany/implementation/java/impl/DefaultJavaImplementationFactory.java?view=diff&rev=525093&r1=525092&r2=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/impl-java/src/main/java/org/apache/tuscany/implementation/java/impl/DefaultJavaImplementationFactory.java (original)
+++ incubator/tuscany/java/sca/scdl4j/impl-java/src/main/java/org/apache/tuscany/implementation/java/impl/DefaultJavaImplementationFactory.java Tue Apr 3 01:52:45 2007
@@ -21,8 +21,8 @@
/**
* A factory for the Java model.
*/
-import org.apache.tuscany.assembly.model.AssemblyFactory;
-import org.apache.tuscany.assembly.model.Service;
+import org.apache.tuscany.assembly.AssemblyFactory;
+import org.apache.tuscany.assembly.Service;
import org.apache.tuscany.implementation.java.JavaImplementationFactory;
import org.apache.tuscany.implementation.java.JavaImplementation;
Modified: incubator/tuscany/java/sca/scdl4j/impl-java/src/main/java/org/apache/tuscany/implementation/java/impl/JavaImplementationImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/impl-java/src/main/java/org/apache/tuscany/implementation/java/impl/JavaImplementationImpl.java?view=diff&rev=525093&r1=525092&r2=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/impl-java/src/main/java/org/apache/tuscany/implementation/java/impl/JavaImplementationImpl.java (original)
+++ incubator/tuscany/java/sca/scdl4j/impl-java/src/main/java/org/apache/tuscany/implementation/java/impl/JavaImplementationImpl.java Tue Apr 3 01:52:45 2007
@@ -18,7 +18,7 @@
*/
package org.apache.tuscany.implementation.java.impl;
-import org.apache.tuscany.assembly.model.impl.ComponentTypeImpl;
+import org.apache.tuscany.assembly.impl.ComponentTypeImpl;
import org.apache.tuscany.implementation.java.JavaImplementation;
/**
Added: incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/Intent.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/Intent.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/Intent.java (added)
+++ incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/Intent.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,104 @@
+/*
+ * 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.policy;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.idl.Operation;
+
+/**
+ * Represents a policy intent. See the Policy Framework specification for a
+ * description of this element.
+ */
+public interface Intent {
+
+ /**
+ * Returns the intent name.
+ *
+ * @return the intent name
+ */
+ QName getName();
+
+ /**
+ * Sets the intent name
+ *
+ * @param name the intent name
+ */
+ void setName(QName name);
+
+ /**
+ * Returns the list of operations that this intent applies to.
+ *
+ * @return
+ */
+ List<Operation> getOperations();
+
+ /**
+ * Returns the list of SCA constructs that this intent is meant to
+ * configure.
+ *
+ * @return the list of SCA constructs that this intent is meant to configure
+ */
+ List<QName> getConstrains();
+
+ /**
+ * Returns the list of required intents.
+ *
+ * @return
+ */
+ List<Intent> getRequiredIntents();
+
+ /**
+ * Returns the list of children qualified intents.
+ *
+ * @return the list of children qualified intents.
+ */
+ List<Intent> getQualifiedIntents();
+
+ /**
+ * Returns the intent description.
+ *
+ * @return the intent description
+ */
+ String getDescription();
+
+ /**
+ * Sets the intent description.
+ *
+ * @param description the intent description
+ */
+ void setDescription(String description);
+
+ /**
+ * Returns true if the model element is unresolved.
+ *
+ * @return true if the model element is unresolved.
+ */
+ boolean isUnresolved();
+
+ /**
+ * Sets whether the model element is unresolved.
+ *
+ * @param unresolved whether the model element is unresolved
+ */
+ void setUnresolved(boolean unresolved);
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/Intent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/Intent.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/IntentAttachPoint.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/IntentAttachPoint.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/IntentAttachPoint.java (added)
+++ incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/IntentAttachPoint.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,37 @@
+/*
+ * 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.policy;
+
+import java.util.List;
+
+/**
+ * Base interface for all assembly model objects that can be have policy intents
+ * attached to them.
+ */
+public interface IntentAttachPoint {
+
+ /**
+ * Returns a list of policy intents. See the Policy Framework specification
+ * for a description of this attribute.
+ *
+ * @return a list of policy intents.
+ */
+ List<Intent> getRequiredIntents();
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/IntentAttachPoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/IntentAttachPoint.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/IntentMap.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/IntentMap.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/IntentMap.java (added)
+++ incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/IntentMap.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,87 @@
+/*
+ * 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.policy;
+
+import java.util.List;
+
+/**
+ * Represents a policy intent map. See the Policy Framework specification for a
+ * description of this element.
+ */
+public interface IntentMap {
+
+ /**
+ * Returns the intent realized by this intent map.
+ *
+ * @return the intent realized by this intent map
+ */
+ Intent getProvidedIntent();
+
+ /**
+ * Sets the intent realized by this intent map.
+ *
+ * @param providedIntent the intent realized by this intent map
+ */
+ void setProvidedIntent(Intent providedIntent);
+
+ /**
+ * Returns the default qualified intent map.
+ *
+ * @return the default qualified intent map
+ */
+ IntentMap getDefaultQualifiedIntentMap();
+
+ /**
+ * Sets the default qualified intent map.
+ *
+ * @param defaultQualifiedIntentMap the default qualified intent map
+ */
+ void setDefaultQualifiedIntentMap(IntentMap defaultQualifiedIntentMap);
+
+ /**
+ * Returns the list of children qualified intent maps.
+ *
+ * @return
+ */
+ List<IntentMap> getQualifiedIntentMaps();
+
+ /**
+ * Returns the list of concrete policies, either WS-Policy policy
+ * attachments, policy references, or policies expressed in another policy
+ * language.
+ *
+ * @return the list of concrete policies
+ */
+ List<Object> getPolicies();
+
+ /**
+ * Returns true if the model element is unresolved.
+ *
+ * @return true if the model element is unresolved.
+ */
+ boolean isUnresolved();
+
+ /**
+ * Sets whether the model element is unresolved.
+ *
+ * @param unresolved whether the model element is unresolved
+ */
+ void setUnresolved(boolean unresolved);
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/IntentMap.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/IntentMap.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/PolicyFactory.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/PolicyFactory.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/PolicyFactory.java (added)
+++ incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/PolicyFactory.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,47 @@
+/*
+ * 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.policy;
+
+/**
+ * A factory for the policy model.
+ */
+public interface PolicyFactory {
+
+ /**
+ * Create a new intent.
+ *
+ * @return a new intent
+ */
+ Intent createIntent();
+
+ /**
+ * Create a new policy set.
+ *
+ * @return a new policy set
+ */
+ PolicySet createPolicySet();
+
+ /**
+ * Create a new intent map.
+ *
+ * @return a new intent map
+ */
+ IntentMap createIntentMap();
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/PolicyFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/PolicyFactory.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/PolicySet.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/PolicySet.java?view=auto&rev=525093
==============================================================================
--- incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/PolicySet.java (added)
+++ incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/PolicySet.java Tue Apr 3 01:52:45 2007
@@ -0,0 +1,100 @@
+/*
+ * 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.policy;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.idl.Operation;
+
+/**
+ * Represents a policy set. See the Policy Framework specification for a
+ * description of this element.
+ */
+public interface PolicySet {
+
+ /**
+ * Returns the intent name.
+ *
+ * @return the intent name
+ */
+ QName getName();
+
+ /**
+ * Sets the intent name
+ *
+ * @param name the intent name
+ */
+ void setName(QName name);
+
+ /**
+ * Returns the list of operations that this policy set applies to.
+ *
+ * @return
+ */
+ List<Operation> getOperations();
+
+ /**
+ * Returns the list of
+ *
+ * @return
+ */
+ List<PolicySet> getReferencedPolicySets();
+
+ /**
+ * Returns the list of provided intents
+ *
+ * @return
+ */
+ List<Intent> getProvidedIntents();
+
+ /**
+ * Returns the list of SCA constructs that this policy set is meant to
+ * configure.
+ *
+ * @return the list of SCA constructs that this policy set is meant to
+ * configure
+ */
+ List<QName> getAppliesTo();
+
+ /**
+ * Returns the list of concrete policies, either WS-Policy policy
+ * attachments, policy references, or policies expressed in another policy
+ * language.
+ *
+ * @return the list of concrete policies
+ */
+ List<Object> getPolicies();
+
+ /**
+ * Returns true if the model element is unresolved.
+ *
+ * @return true if the model element is unresolved.
+ */
+ boolean isUnresolved();
+
+ /**
+ * Sets whether the model element is unresolved.
+ *
+ * @param unresolved whether the model element is unresolved
+ */
+ void setUnresolved(boolean unresolved);
+
+}
Propchange: incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/PolicySet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/scdl4j/policy/src/main/java/org/apache/tuscany/policy/PolicySet.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org