summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/samples
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-10-26 23:44:59 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-10-26 23:44:59 +0000
commit71a7cba384b8ae7f4578fb9ab1f725d5ce616074 (patch)
tree98bbc7c066d037a8d9ea1fea7a3ccfa64419ab11 /branches/sca-java-1.x/samples
parent01a38d872dc2692d2a31f07f9c8f8098aa078853 (diff)
Merge all changes from 1.5.2 branch into trunk
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@830026 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/samples')
-rw-r--r--branches/sca-java-1.x/samples/binding-echo-extension/src/main/java/echo/impl/EchoBindingProcessor.java6
-rw-r--r--branches/sca-java-1.x/samples/helloworld-ws-sdo/pom.xml23
-rw-r--r--branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/java/services/bcircle/BioTestCase.java51
-rw-r--r--branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircle.java29
-rw-r--r--branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircleImpl.java40
-rw-r--r--branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/resources/META-INF/sca-contribution.xml23
-rw-r--r--branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/resources/resources/clinicalLaboratory.composite16
-rw-r--r--branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/resources/test.xsd17
-rw-r--r--branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/main/java/helloworld/HelloWorldServer.java2
-rw-r--r--branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/main/resources/helloworldwsjms.composite2
-rw-r--r--branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/test/java/helloworld/HelloWorldJmsServerTestCase.java2
-rw-r--r--branches/sca-java-1.x/samples/implementation-pojo-extension/src/main/java/pojo/impl/POJOImplementationProcessor.java50
-rw-r--r--branches/sca-java-1.x/samples/quote-xquery/src/main/resources/xqueryquotewsclient.composite7
-rw-r--r--branches/sca-java-1.x/samples/quote-xquery/src/test/java/xquery/quote/XQueryQuoteClientTestCase.java2
-rw-r--r--branches/sca-java-1.x/samples/simple-bigbank-spring/README7
-rw-r--r--branches/sca-java-1.x/samples/spring-bigbank-stockquote/src/main/resources/StockQuote.composite2
-rw-r--r--branches/sca-java-1.x/samples/store-webapp/pom.xml17
-rw-r--r--branches/sca-java-1.x/samples/store-webapp/src/main/webapp/META-INF/sca-contribution.xml44
-rw-r--r--branches/sca-java-1.x/samples/store-webapp/src/main/webapp/store.html324
19 files changed, 438 insertions, 226 deletions
diff --git a/branches/sca-java-1.x/samples/binding-echo-extension/src/main/java/echo/impl/EchoBindingProcessor.java b/branches/sca-java-1.x/samples/binding-echo-extension/src/main/java/echo/impl/EchoBindingProcessor.java
index 865ddca329..61ae9b9553 100644
--- a/branches/sca-java-1.x/samples/binding-echo-extension/src/main/java/echo/impl/EchoBindingProcessor.java
+++ b/branches/sca-java-1.x/samples/binding-echo-extension/src/main/java/echo/impl/EchoBindingProcessor.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package echo.impl;
diff --git a/branches/sca-java-1.x/samples/helloworld-ws-sdo/pom.xml b/branches/sca-java-1.x/samples/helloworld-ws-sdo/pom.xml
index afe0e22c3f..e9f4a60d8c 100644
--- a/branches/sca-java-1.x/samples/helloworld-ws-sdo/pom.xml
+++ b/branches/sca-java-1.x/samples/helloworld-ws-sdo/pom.xml
@@ -7,15 +7,15 @@
* 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.
+ * under the License.
-->
<project>
<modelVersion>4.0.0</modelVersion>
@@ -90,7 +90,7 @@
<version>1.6-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
-
+
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -142,6 +142,21 @@
<goal>generate</goal>
</goals>
</execution>
+ <execution>
+ <id>generate-helloworld-sdo1</id>
+ <phase>generate-sources</phase>
+ <configuration>
+ <schemaFile>${basedir}/src/main/resources/test.xsd</schemaFile>
+ <javaPackage>model.sdo</javaPackage>
+ <prefix>Entity</prefix>
+ <noNotification>true</noNotification>
+ <noContainer>true</noContainer>
+ <noUnsettable>true</noUnsettable>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
</executions>
</plugin>
</plugins>
diff --git a/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/java/services/bcircle/BioTestCase.java b/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/java/services/bcircle/BioTestCase.java
new file mode 100644
index 0000000000..39fa5d2d14
--- /dev/null
+++ b/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/java/services/bcircle/BioTestCase.java
@@ -0,0 +1,51 @@
+/*
+ * 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 services.bcircle;
+
+import model.sdo.EntityFactory;
+import model.sdo.Laboratory;
+
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+
+public class BioTestCase {
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ BiochemicalCircle biochemicalCircl = new BiochemicalCircleImpl();
+ Laboratory lab2 = biochemicalCircl.getLaboratory("Lab2"); //This invocation without use SCA works ok.
+
+ SCADomain scaDomain = SCADomain.newInstance("resources/clinicalLaboratory.composite");
+ BiochemicalCircle biochemicalCircle =
+ scaDomain.getService(BiochemicalCircle.class, "BiochemicalCircleComponent");
+ Laboratory lab = EntityFactory.INSTANCE.createLaboratory();
+ lab.setName("lab2");
+ biochemicalCircle.setLaboratory(lab); // this invocation works ok too
+
+ lab = biochemicalCircle.getLaboratory("Lab2"); // here I have an exception posted below.
+
+ //here I wait a moment before close scaDomain
+ System.out.println(lab.getName());
+
+ scaDomain.close();
+
+ }
+}
diff --git a/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircle.java b/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircle.java
new file mode 100644
index 0000000000..9d77e0cbd9
--- /dev/null
+++ b/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircle.java
@@ -0,0 +1,29 @@
+/*
+ * 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 services.bcircle;
+
+import org.osoa.sca.annotations.Remotable;
+
+@Remotable
+public interface BiochemicalCircle {
+ void setLaboratory(model.sdo.Laboratory lab);
+
+ model.sdo.Laboratory getLaboratory(String name);
+}
diff --git a/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircleImpl.java b/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircleImpl.java
new file mode 100644
index 0000000000..287e8e22cb
--- /dev/null
+++ b/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/java/services/bcircle/BiochemicalCircleImpl.java
@@ -0,0 +1,40 @@
+/*
+ * 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 services.bcircle;
+import model.sdo.EntityFactory;
+import model.sdo.Laboratory;
+
+import org.osoa.sca.annotations.Service;
+
+
+@Service(BiochemicalCircle.class)
+public class BiochemicalCircleImpl implements BiochemicalCircle{
+ public Laboratory getLaboratory(String name) {
+
+ Laboratory lab = EntityFactory.INSTANCE.createLaboratory();
+ lab.setName("Main Laboratory");
+ return lab;
+ }
+
+ public void setLaboratory(Laboratory lab) {
+ //sad method
+ System.out.println(lab.getName());
+ }
+}
diff --git a/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/resources/META-INF/sca-contribution.xml b/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/resources/META-INF/sca-contribution.xml
new file mode 100644
index 0000000000..1c1216cc17
--- /dev/null
+++ b/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/resources/META-INF/sca-contribution.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
+ <tuscany:sdo.types namespace="http://helloworld" location="wsdl/helloworld.wsdl"/>
+</contribution>
diff --git a/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/resources/resources/clinicalLaboratory.composite b/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/resources/resources/clinicalLaboratory.composite
new file mode 100644
index 0000000000..56d47ef194
--- /dev/null
+++ b/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/resources/resources/clinicalLaboratory.composite
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sca:composite xmlns:federation="http://eclipse.org/SCAExample1/src/resources/federation"
+ xmlns:sca="http://www.osoa.org/xmlns/sca/1.0" name="clinicalLaboratory"
+ targetNamespace="http://eclipse.org/SCAExample1/src/resources/clinicalLaboratory">
+
+ <sca:component name="BiochemicalCircleComponent">
+ <sca:implementation.java class="services.bcircle.BiochemicalCircleImpl" />
+ <sca:service name="BiochemicalCircle">
+ <sca:interface.java interface="services.bcircle.BiochemicalCircle" />
+ <sca:binding.ws uri="http://localhost:8080/SCA1/MyServiceComponent" />
+ </sca:service>
+ </sca:component>
+ <!--
+ <sca:service name="BiochemicalCircle" promote="BiochemicalCircleComponent/BiochemicalCircle" />
+ -->
+</sca:composite>
diff --git a/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/resources/test.xsd b/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/resources/test.xsd
new file mode 100644
index 0000000000..415e1648d4
--- /dev/null
+++ b/branches/sca-java-1.x/samples/helloworld-ws-sdo/src/main/resources/test.xsd
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://eclipse.org/SCAExample1/src/resources/clinicalLaboratory"
+ xmlns:tns="http://eclipse.org/SCAExample1/src/resources/clinicalLaboratory"
+ elementFormDefault="qualified">
+ <complexType name="Practice">
+ <sequence>
+ <element name="name" type="string" />
+ </sequence>
+ </complexType>
+ <complexType name="Laboratory">
+ <sequence>
+ <element name="name" type="string" />
+ <element name="practices" type="tns:Practice" maxOccurs="unbounded" />
+ </sequence>
+ </complexType>
+</schema>
diff --git a/branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/main/java/helloworld/HelloWorldServer.java b/branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/main/java/helloworld/HelloWorldServer.java
index 28039b7965..5454487ff6 100644
--- a/branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/main/java/helloworld/HelloWorldServer.java
+++ b/branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/main/java/helloworld/HelloWorldServer.java
@@ -33,7 +33,7 @@ public class HelloWorldServer {
BrokerService jmsBroker = new BrokerService();
jmsBroker.setPersistent(false);
jmsBroker.setUseJmx(false);
- jmsBroker.addConnector("tcp://localhost:61613");
+ jmsBroker.addConnector("tcp://localhost:61619");
jmsBroker.start();
return jmsBroker;
}
diff --git a/branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/main/resources/helloworldwsjms.composite b/branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/main/resources/helloworldwsjms.composite
index 1427221225..00fc4e4cb6 100644
--- a/branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/main/resources/helloworldwsjms.composite
+++ b/branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/main/resources/helloworldwsjms.composite
@@ -28,7 +28,7 @@
<service name="HelloWorldService">
<interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)" />
<binding.ws wsdlElement="http://helloworld#wsdl.binding(HelloWorldSoapJmsBinding)"
- uri="jms:/queue.sample?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:51293"/>
+ uri="jms:/queue.sample?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:61619"/>
<!-- binding.ws wsdlElement="http://helloworld#wsdl.binding(HelloWorldSoapBinding)"/ -->
</service>
</component>
diff --git a/branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/test/java/helloworld/HelloWorldJmsServerTestCase.java b/branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/test/java/helloworld/HelloWorldJmsServerTestCase.java
index 31e930bff4..409b975736 100644
--- a/branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/test/java/helloworld/HelloWorldJmsServerTestCase.java
+++ b/branches/sca-java-1.x/samples/helloworld-ws-service-jms/src/test/java/helloworld/HelloWorldJmsServerTestCase.java
@@ -48,7 +48,7 @@ public class HelloWorldJmsServerTestCase{
jmsBroker = new BrokerService();
jmsBroker.setPersistent(false);
jmsBroker.setUseJmx(false);
- jmsBroker.addConnector("tcp://localhost:51293");
+ jmsBroker.addConnector("tcp://localhost:61619");
jmsBroker.start();
}
diff --git a/branches/sca-java-1.x/samples/implementation-pojo-extension/src/main/java/pojo/impl/POJOImplementationProcessor.java b/branches/sca-java-1.x/samples/implementation-pojo-extension/src/main/java/pojo/impl/POJOImplementationProcessor.java
index 5476c80cdd..36bce82e09 100644
--- a/branches/sca-java-1.x/samples/implementation-pojo-extension/src/main/java/pojo/impl/POJOImplementationProcessor.java
+++ b/branches/sca-java-1.x/samples/implementation-pojo-extension/src/main/java/pojo/impl/POJOImplementationProcessor.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package pojo.impl;
@@ -48,25 +48,25 @@ import pojo.POJOImplementationFactory;
/**
* Implements a STAX based artifact processor for POJO implementations.
- *
+ *
* The artifact processor is responsible for processing <implementation.pojo>
* elements in SCA assembly XML composite files and populating the POJO
* implementation model, resolving its references to other artifacts in the SCA
- * contribution, and optionally write the model back to SCA assembly XML.
+ * contribution, and optionally write the model back to SCA assembly XML.
*/
public class POJOImplementationProcessor implements StAXArtifactProcessor<POJOImplementation> {
private static final QName IMPLEMENTATION_POJO = new QName("http://pojo", "implementation.pojo");
-
+
private AssemblyFactory assemblyFactory;
private JavaInterfaceFactory javaFactory;
private POJOImplementationFactory pojoImplementationFactory;
private PolicyFactory policyFactory;
private PolicyAttachPointProcessor policyProcessor;
-
+
public POJOImplementationProcessor(ModelFactoryExtensionPoint modelFactories, Monitor monitor) {
-
+
// Get the assembly and Java interface factories as we'll need them to
- // create model objects
+ // create model objects
assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
javaFactory = modelFactories.getFactory(JavaInterfaceFactory.class);
policyFactory = modelFactories.getFactory(PolicyFactory.class);
@@ -85,36 +85,36 @@ public class POJOImplementationProcessor implements StAXArtifactProcessor<POJOIm
}
public POJOImplementation read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
-
+
// Read an <implementation.pojo> element
POJOImplementation implementation = pojoImplementationFactory.createPOJOImplementation();
-
+
// Read policies
policyProcessor.readPolicies(implementation, reader);
-
+
// Read the POJO class attribute.
String className = reader.getAttributeValue(null, "class");
implementation.setPOJOName(className);
-
+
// Mark the POJO model unresolved to track the fact that it's not
// completely initialized, its class is not loaded yet and services
// and references not initialized either
implementation.setUnresolved(true);
-
+
// Skip to end element
while (reader.hasNext()) {
if (reader.next() == END_ELEMENT && IMPLEMENTATION_POJO.equals(reader.getName())) {
break;
}
}
-
+
return implementation;
}
public void resolve(POJOImplementation implementation, ModelResolver resolver) throws ContributionResolveException {
-
+
// Resolve the POJO implementation
-
+
// First resolve its class
ClassReference classReference = new ClassReference(implementation.getPOJOName());
classReference = resolver.resolveModel(ClassReference.class, classReference);
@@ -123,21 +123,21 @@ public class POJOImplementationProcessor implements StAXArtifactProcessor<POJOIm
throw new ContributionResolveException("Class could not be resolved: " + implementation.getPOJOName());
}
implementation.setPOJOClass(pojoClass);
-
+
// Check to see if we have a .componentType file describing the POJO class
ComponentType componentType = assemblyFactory.createComponentType();
componentType.setUnresolved(true);
componentType.setURI(implementation.getURI() + ".componentType");
componentType = resolver.resolveModel(ComponentType.class, componentType);
if (!componentType.isUnresolved()) {
-
+
// We have a component type description, merge it into the POJO model
implementation.getServices().addAll(componentType.getServices());
implementation.getReferences().addAll(componentType.getReferences());
implementation.getProperties().addAll(componentType.getProperties());
-
+
} else {
-
+
// We have no component type description, simply introspect the POJO and
// create a single Service for it
Service service = assemblyFactory.createService();
@@ -153,21 +153,21 @@ public class POJOImplementationProcessor implements StAXArtifactProcessor<POJOIm
service.setInterfaceContract(interfaceContract);
implementation.getServices().add(service);
}
-
+
// Mark the implementation resolved now
implementation.setUnresolved(false);
}
public void write(POJOImplementation implementation, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
-
+
// Write <implementation.pojo> element
writer.writeStartElement(IMPLEMENTATION_POJO.getNamespaceURI(), IMPLEMENTATION_POJO.getLocalPart());
policyProcessor.writePolicyAttributes(implementation, writer);
-
+
if (implementation.getPOJOName() != null) {
writer.writeAttribute("class", implementation.getPOJOName());
}
-
+
writer.writeEndElement();
}
}
diff --git a/branches/sca-java-1.x/samples/quote-xquery/src/main/resources/xqueryquotewsclient.composite b/branches/sca-java-1.x/samples/quote-xquery/src/main/resources/xqueryquotewsclient.composite
index 35306b9f89..c9887c8c19 100644
--- a/branches/sca-java-1.x/samples/quote-xquery/src/main/resources/xqueryquotewsclient.composite
+++ b/branches/sca-java-1.x/samples/quote-xquery/src/main/resources/xqueryquotewsclient.composite
@@ -18,7 +18,9 @@
* under the License.
-->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://quote.xquery/client"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0" xmlns:xq="http://quote.xquery/client"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ xmlns:dbsdo="http://tuscany.apache.org/xmlns/sca/databinding/sdo/1.0"
+ xmlns:xq="http://quote.xquery/client"
name="xqueryquotewsclient">
<component name="QuoteJoinLocalComponent">
@@ -101,9 +103,8 @@
</component>
<reference name="availQuoteProvider" promote="QuoteJoinExternalReferencesComponent/availQuoteProvider">
- <!-- removed because it doesn't work with TUSCANY-2324 fix
+ <!-- removed because it doesn't work with TUSCANY-2324 fix -->
<interface.java interface="xquery.quote.AvailQuoteProviderService" />
- -->
<binding.ws wsdlElement="http://quote.xquery#wsdl.port(AvailQuoteProviderService/AvailQuoteProviderSoapPort)" />
</reference>
<reference name="quoteJoinWs" promote="QuoteJoinLocalComponent/quoteJoinWs">
diff --git a/branches/sca-java-1.x/samples/quote-xquery/src/test/java/xquery/quote/XQueryQuoteClientTestCase.java b/branches/sca-java-1.x/samples/quote-xquery/src/test/java/xquery/quote/XQueryQuoteClientTestCase.java
index a7224b0efa..9555532b3e 100644
--- a/branches/sca-java-1.x/samples/quote-xquery/src/test/java/xquery/quote/XQueryQuoteClientTestCase.java
+++ b/branches/sca-java-1.x/samples/quote-xquery/src/test/java/xquery/quote/XQueryQuoteClientTestCase.java
@@ -33,7 +33,6 @@ import org.example.quote.Quote;
import org.example.quote.QuoteResponse;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import commonj.sdo.DataObject;
@@ -63,7 +62,6 @@ import commonj.sdo.DataObject;
* total price
* 4. SDO is used for data interchange
*/
-@Ignore("Broken, see TUSCANY-2943")
public class XQueryQuoteClientTestCase {
public static boolean SHOW_DEBUG_MSG = false;
diff --git a/branches/sca-java-1.x/samples/simple-bigbank-spring/README b/branches/sca-java-1.x/samples/simple-bigbank-spring/README
index bb44d63719..210ec2d510 100644
--- a/branches/sca-java-1.x/samples/simple-bigbank-spring/README
+++ b/branches/sca-java-1.x/samples/simple-bigbank-spring/README
@@ -1,6 +1,11 @@
Spring Bigbank Sample
======================
-This sample is made of 3 modules that represent the different aspects of a fictitious banking application.
+This sample is different from the simple-bigbank in that it is made of 4 separate modules that represent the different aspects of a fictitious banking application.
+
+simple-bigbank-spring (this module)
+spring-bigbank-calculator
+spring-bigbank-checkaccount
+spring-bigbank-stockquote
To run the simple-bigbank-spring sample you need to first run spring-bigbank-calculator, spring-bigbank-checkaccount and spring-bigbank-stockquote composites.
This will bring up Tuscany runtime and load the three applications and make them available as services.
diff --git a/branches/sca-java-1.x/samples/spring-bigbank-stockquote/src/main/resources/StockQuote.composite b/branches/sca-java-1.x/samples/spring-bigbank-stockquote/src/main/resources/StockQuote.composite
index 3f606e1216..06544c6883 100644
--- a/branches/sca-java-1.x/samples/spring-bigbank-stockquote/src/main/resources/StockQuote.composite
+++ b/branches/sca-java-1.x/samples/spring-bigbank-stockquote/src/main/resources/StockQuote.composite
@@ -25,7 +25,7 @@
<service name="StockQuoteService" promote="StockQuoteServiceComponent">
<interface.java interface="bigbank.stockquote.StockQuoteService"/>
- <binding.ws uri="http://localhost:8085/services/StockQuoteWebService"/>
+ <binding.ws uri="http://localhost:8081/services/StockQuoteWebService"/>
</service>
<component name="StockQuoteServiceComponent">
diff --git a/branches/sca-java-1.x/samples/store-webapp/pom.xml b/branches/sca-java-1.x/samples/store-webapp/pom.xml
index 483e5c11fd..8b6f0412f1 100644
--- a/branches/sca-java-1.x/samples/store-webapp/pom.xml
+++ b/branches/sca-java-1.x/samples/store-webapp/pom.xml
@@ -103,6 +103,23 @@
<build>
<finalName>${artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-maven-ant-generator</artifactId>
+ <version>1.6-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <configuration>
+ <buildDependencyFileOnly>true</buildDependencyFileOnly>
+ </configuration>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
</build>
</project>
diff --git a/branches/sca-java-1.x/samples/store-webapp/src/main/webapp/META-INF/sca-contribution.xml b/branches/sca-java-1.x/samples/store-webapp/src/main/webapp/META-INF/sca-contribution.xml
index 8d744c2834..41c84c9a44 100644
--- a/branches/sca-java-1.x/samples/store-webapp/src/main/webapp/META-INF/sca-contribution.xml
+++ b/branches/sca-java-1.x/samples/store-webapp/src/main/webapp/META-INF/sca-contribution.xml
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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.
--->
-<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:store="http://store">
- <deployable composite="store:store"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ xmlns:store="http://store">
+ <deployable composite="store:store"/>
</contribution> \ No newline at end of file
diff --git a/branches/sca-java-1.x/samples/store-webapp/src/main/webapp/store.html b/branches/sca-java-1.x/samples/store-webapp/src/main/webapp/store.html
index e77389c552..ba004e02ac 100644
--- a/branches/sca-java-1.x/samples/store-webapp/src/main/webapp/store.html
+++ b/branches/sca-java-1.x/samples/store-webapp/src/main/webapp/store.html
@@ -1,162 +1,162 @@
-<!--
- * 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.
--->
-<html>
-<head>
-<title>Store</title>
-
-<script type="text/javascript" src="store.js"></script>
-
-<script language="JavaScript">
-
- //@Reference
- var catalog = new tuscany.sca.Reference("catalog");
-
- //@Reference
- var shoppingCart = new tuscany.sca.Reference("shoppingCart");
-
- //@Reference
- var shoppingTotal = new tuscany.sca.Reference("shoppingTotal");
-
- var catalogItems;
-
- function catalog_getResponse(items,exception) {
- if(exception){
- alert(exception.message);
- return;
- }
- var catalog = "";
-
- for (var i=0; i<items.length; i++) {
- var item = items[i].name + ' - ' + items[i].price;
- catalog += '<input name="items" type="checkbox" value="' +
- item + '">' + item + ' <br>';
- }
- document.getElementById('catalog').innerHTML=catalog;
- catalogItems = items;
- }
-
- function shoppingCart_getResponse(feed) {
- if (feed != null) {
- var entries = feed.getElementsByTagName("entry");
- var list = "";
- for (var i=0; i<entries.length; i++) {
- var content = entries[i].getElementsByTagName("content")[0];
- var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
- var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
- list += name + ' - ' + price + ' <br>';
- }
- document.getElementById("shoppingCart").innerHTML = list;
-
- if (entries.length != 0) {
- try {
- shoppingTotal.getTotal(shoppingTotal_getTotalResponse);
- }
- catch(e){
- alert(e);
- }
- }
- }
- }
-
- function shoppingTotal_getTotalResponse(total,exception) {
- if(exception) {
- alert(exception.message);
- return;
- }
- document.getElementById('total').innerHTML = total;
- }
-
- function shoppingCart_postResponse(entry) {
- shoppingCart.get("", shoppingCart_getResponse);
- }
-
- function addToCart() {
- var items = document.catalogForm.items;
- var j = 0;
- for (var i=0; i<items.length; i++)
- if (items[i].checked) {
-
- var entry = '<entry xmlns="http://www.w3.org/2005/Atom"><title>item</title><content type="text/xml">' +
- '<Item xmlns="http://services/">' +
- '<name xmlns="">' + catalogItems[i].name + '</name>' + '<price xmlns="">' + catalogItems[i].price + '</price>' +
- '</Item>' + '</content></entry>';
- shoppingCart.post(entry, shoppingCart_postResponse);
- items[i].checked = false;
- }
- }
- function checkoutCart() {
- document.getElementById('store').innerHTML='<h2>' +
- 'Thanks for Shopping With Us!</h2>'+
- '<h2>Your Order</h2>'+
- '<form name="orderForm">'+
- document.getElementById('shoppingCart').innerHTML+
- '<br>'+
- document.getElementById('total').innerHTML+
- '<br>'+
- '<br>'+
- '<input type="submit" value="Continue Shopping">'+
- '</form>';
- shoppingCart.del("", null);
- }
- function deleteCart() {
- shoppingCart.del("", null);
- document.getElementById('shoppingCart').innerHTML = "";
- document.getElementById('total').innerHTML = "";
- }
-
- function init() {
-
- try {
- catalog.get(catalog_getResponse);
- shoppingCart.get("", shoppingCart_getResponse);
- }
- catch(e){
- alert(e);
- }
- }
-
-</script>
-
-</head>
-
-<body onload="init()">
-<h1>Store</h1>
- <div id="store">
- <h2>Catalog</h2>
- <form name="catalogForm">
- <div id="catalog" ></div>
- <br>
- <input type="button" onClick="addToCart()" value="Add to Cart">
- </form>
-
- <br>
-
- <h2>Your Shopping Cart</h2>
- <form name="shoppingCartForm">
- <div id="shoppingCart"></div>
- <br>
- <div id="total"></div>
- <br>
- <input type="button" onClick="checkoutCart()" value="Checkout">
- <input type="button" onClick="deleteCart()" value="Empty">
- <a href="../ShoppingCart/Cart/">(feed)</a>
- </form>
- </div>
-</body>
-</html>
+<!--
+ * 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.
+-->
+<html>
+<head>
+<title>Store</title>
+
+<script type="text/javascript" src="store.js"></script>
+
+<script language="JavaScript">
+
+ //@Reference
+ var catalog = new tuscany.sca.Reference("catalog");
+
+ //@Reference
+ var shoppingCart = new tuscany.sca.Reference("shoppingCart");
+
+ //@Reference
+ var shoppingTotal = new tuscany.sca.Reference("shoppingTotal");
+
+ var catalogItems;
+
+ function catalog_getResponse(items,exception) {
+ if(exception){
+ alert(exception.message);
+ return;
+ }
+ var catalog = "";
+
+ for (var i=0; i<items.length; i++) {
+ var item = items[i].name + ' - ' + items[i].price;
+ catalog += '<input name="items" type="checkbox" value="' +
+ item + '">' + item + ' <br>';
+ }
+ document.getElementById('catalog').innerHTML=catalog;
+ catalogItems = items;
+ }
+
+ function shoppingCart_getResponse(feed) {
+ if (feed != null) {
+ var entries = feed.getElementsByTagName("entry");
+ var list = "";
+ for (var i=0; i<entries.length; i++) {
+ var content = entries[i].getElementsByTagName("content")[0];
+ var name = content.getElementsByTagName("name")[0].firstChild.nodeValue;
+ var price = content.getElementsByTagName("price")[0].firstChild.nodeValue;
+ list += name + ' - ' + price + ' <br>';
+ }
+ document.getElementById("shoppingCart").innerHTML = list;
+
+ if (entries.length != 0) {
+ try {
+ shoppingTotal.getTotal(shoppingTotal_getTotalResponse);
+ }
+ catch(e){
+ alert(e);
+ }
+ }
+ }
+ }
+
+ function shoppingTotal_getTotalResponse(total,exception) {
+ if(exception) {
+ alert(exception.message);
+ return;
+ }
+ document.getElementById('total').innerHTML = total;
+ }
+
+ function shoppingCart_postResponse(entry) {
+ shoppingCart.get("", shoppingCart_getResponse);
+ }
+
+ function addToCart() {
+ var items = document.catalogForm.items;
+ var j = 0;
+ for (var i=0; i<items.length; i++)
+ if (items[i].checked) {
+
+ var entry = '<entry xmlns="http://www.w3.org/2005/Atom"><title>item</title><content type="text/xml">' +
+ '<Item xmlns="http://services/">' +
+ '<name xmlns="">' + catalogItems[i].name + '</name>' + '<price xmlns="">' + catalogItems[i].price + '</price>' +
+ '</Item>' + '</content></entry>';
+ shoppingCart.post(entry, shoppingCart_postResponse);
+ items[i].checked = false;
+ }
+ }
+ function checkoutCart() {
+ document.getElementById('store').innerHTML='<h2>' +
+ 'Thanks for Shopping With Us!</h2>'+
+ '<h2>Your Order</h2>'+
+ '<form name="orderForm">'+
+ document.getElementById('shoppingCart').innerHTML+
+ '<br>'+
+ document.getElementById('total').innerHTML+
+ '<br>'+
+ '<br>'+
+ '<input type="submit" value="Continue Shopping">'+
+ '</form>';
+ shoppingCart.del("", null);
+ }
+ function deleteCart() {
+ shoppingCart.del("", null);
+ document.getElementById('shoppingCart').innerHTML = "";
+ document.getElementById('total').innerHTML = "";
+ }
+
+ function init() {
+
+ try {
+ catalog.get(catalog_getResponse);
+ shoppingCart.get("", shoppingCart_getResponse);
+ }
+ catch(e){
+ alert(e);
+ }
+ }
+
+</script>
+
+</head>
+
+<body onload="init()">
+<h1>Store</h1>
+ <div id="store">
+ <h2>Catalog</h2>
+ <form name="catalogForm">
+ <div id="catalog" ></div>
+ <br>
+ <input type="button" onClick="addToCart()" value="Add to Cart">
+ </form>
+
+ <br>
+
+ <h2>Your Shopping Cart</h2>
+ <form name="shoppingCartForm">
+ <div id="shoppingCart"></div>
+ <br>
+ <div id="total"></div>
+ <br>
+ <input type="button" onClick="checkoutCart()" value="Checkout">
+ <input type="button" onClick="deleteCart()" value="Empty">
+ <a href="../ShoppingCart/Cart/">(feed)</a>
+ </form>
+ </div>
+</body>
+</html>