Updating store sample application to the latest OASIS namespace/packages and updating the launcher to use 2.x Node
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@881166 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b33133d72f
commit
c40ade3c51
10 changed files with 45 additions and 43 deletions
|
@ -22,7 +22,7 @@
|
|||
<parent>
|
||||
<groupId>org.apache.tuscany.sca</groupId>
|
||||
<artifactId>tuscany-sca</artifactId>
|
||||
<version>1.6-SNAPSHOT</version>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>sample-store</artifactId>
|
||||
|
@ -38,70 +38,69 @@
|
|||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.tuscany.sca</groupId>
|
||||
<artifactId>tuscany-host-embedded</artifactId>
|
||||
<version>1.6-SNAPSHOT</version>
|
||||
<artifactId>tuscany-node-impl</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.tuscany.sca</groupId>
|
||||
<artifactId>tuscany-data-api</artifactId>
|
||||
<version>1.6-SNAPSHOT</version>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.tuscany.sca</groupId>
|
||||
<artifactId>tuscany-implementation-java-runtime</artifactId>
|
||||
<version>1.6-SNAPSHOT</version>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.tuscany.sca</groupId>
|
||||
<artifactId>tuscany-implementation-widget-runtime-tuscany</artifactId>
|
||||
<version>1.6-SNAPSHOT</version>
|
||||
<artifactId>tuscany-implementation-widget-runtime-dojo</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.tuscany.sca</groupId>
|
||||
<artifactId>tuscany-binding-atom-abdera</artifactId>
|
||||
<version>1.6-SNAPSHOT</version>
|
||||
<artifactId>tuscany-binding-atom-runtime</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.tuscany.sca</groupId>
|
||||
<artifactId>tuscany-binding-atom-js</artifactId>
|
||||
<version>1.6-SNAPSHOT</version>
|
||||
<artifactId>tuscany-binding-atom-js-dojo</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.tuscany.sca</groupId>
|
||||
<artifactId>tuscany-binding-jsonrpc-runtime</artifactId>
|
||||
<version>1.6-SNAPSHOT</version>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.tuscany.sca</groupId>
|
||||
<artifactId>tuscany-binding-jsonrpc-js</artifactId>
|
||||
<version>1.6-SNAPSHOT</version>
|
||||
<artifactId>tuscany-binding-jsonrpc-js-dojo</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.tuscany.sca</groupId>
|
||||
<artifactId>tuscany-binding-http-runtime</artifactId>
|
||||
<version>1.6-SNAPSHOT</version>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.tuscany.sca</groupId>
|
||||
<artifactId>tuscany-host-tomcat</artifactId>
|
||||
<version>1.6-SNAPSHOT</version>
|
||||
<artifactId>tuscany-host-jetty</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
|
@ -111,7 +110,6 @@
|
|||
<version>4.5</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -19,16 +19,21 @@
|
|||
|
||||
package launch;
|
||||
|
||||
import org.apache.tuscany.sca.host.embedded.SCADomain;
|
||||
import org.apache.tuscany.sca.node.Contribution;
|
||||
import org.apache.tuscany.sca.node.ContributionLocationHelper;
|
||||
import org.apache.tuscany.sca.node.Node;
|
||||
import org.apache.tuscany.sca.node.NodeFactory;
|
||||
|
||||
public class Launch {
|
||||
public static void main(String[] args) throws Exception {
|
||||
System.out.println("Starting ...");
|
||||
SCADomain scaDomain = SCADomain.newInstance("store.composite");
|
||||
String contribution = ContributionLocationHelper.getContributionLocation(Launch.class);
|
||||
Node node = NodeFactory.newInstance().createNode("store.composite", new Contribution("test", contribution));
|
||||
System.out.println("store.composite ready for big business !!!");
|
||||
System.in.read();
|
||||
System.out.println("Stopping ...");
|
||||
scaDomain.close();
|
||||
node.stop();
|
||||
node.destroy();
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
package services;
|
||||
|
||||
import org.apache.tuscany.sca.data.collection.Collection;
|
||||
import org.osoa.sca.annotations.Remotable;
|
||||
import org.oasisopen.sca.annotation.Remotable;
|
||||
|
||||
@Remotable
|
||||
public interface Cart extends Collection<String, Item> {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
package services;
|
||||
|
||||
import org.osoa.sca.annotations.Remotable;
|
||||
import org.oasisopen.sca.annotation.Remotable;
|
||||
|
||||
@Remotable
|
||||
public interface Catalog {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
package services;
|
||||
|
||||
import org.osoa.sca.annotations.Remotable;
|
||||
import org.oasisopen.sca.annotation.Remotable;
|
||||
|
||||
@Remotable
|
||||
public interface CurrencyConverter {
|
||||
|
|
|
@ -22,9 +22,9 @@ package services;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.osoa.sca.annotations.Init;
|
||||
import org.osoa.sca.annotations.Property;
|
||||
import org.osoa.sca.annotations.Reference;
|
||||
import org.oasisopen.sca.annotation.Init;
|
||||
import org.oasisopen.sca.annotation.Property;
|
||||
import org.oasisopen.sca.annotation.Reference;
|
||||
|
||||
public class FruitsCatalogImpl implements Catalog {
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
package services;
|
||||
|
||||
|
||||
public class Item {
|
||||
private String name;
|
||||
private String price;
|
||||
|
|
|
@ -27,8 +27,8 @@ import java.util.UUID;
|
|||
|
||||
import org.apache.tuscany.sca.data.collection.Entry;
|
||||
import org.apache.tuscany.sca.data.collection.NotFoundException;
|
||||
import org.osoa.sca.annotations.Init;
|
||||
import org.osoa.sca.annotations.Scope;
|
||||
import org.oasisopen.sca.annotation.Init;
|
||||
import org.oasisopen.sca.annotation.Scope;
|
||||
|
||||
@Scope("COMPOSITE")
|
||||
public class ShoppingCartImpl implements Cart, Total {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
package services;
|
||||
|
||||
import org.osoa.sca.annotations.Remotable;
|
||||
import org.oasisopen.sca.annotation.Remotable;
|
||||
|
||||
@Remotable
|
||||
public interface Total {
|
||||
|
|
|
@ -17,24 +17,24 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
-->
|
||||
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
|
||||
xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
|
||||
<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
|
||||
xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
|
||||
targetNamespace="http://store"
|
||||
name="store">
|
||||
|
||||
<component name="Store">
|
||||
<t:implementation.widget location="uiservices/store.html"/>
|
||||
<tuscany:implementation.widget location="uiservices/store.html"/>
|
||||
<service name="Widget">
|
||||
<t:binding.http uri="/store"/>
|
||||
<tuscany:binding.http uri="/store"/>
|
||||
</service>
|
||||
<reference name="catalog" target="Catalog">
|
||||
<t:binding.jsonrpc/>
|
||||
<tuscany:binding.jsonrpc/>
|
||||
</reference>
|
||||
<reference name="shoppingCart" target="ShoppingCart/Cart">
|
||||
<t:binding.atom/>
|
||||
<tuscany:binding.atom/>
|
||||
</reference>
|
||||
<reference name="shoppingTotal" target="ShoppingCart/Total">
|
||||
<t:binding.jsonrpc/>
|
||||
<tuscany:binding.jsonrpc/>
|
||||
</reference>
|
||||
</component>
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
|||
<implementation.java class="services.FruitsCatalogImpl"/>
|
||||
<property name="currencyCode">USD</property>
|
||||
<service name="Catalog">
|
||||
<t:binding.jsonrpc/>
|
||||
<tuscany:binding.jsonrpc/>
|
||||
</service>
|
||||
<reference name="currencyConverter" target="CurrencyConverter"/>
|
||||
</component>
|
||||
|
@ -50,10 +50,10 @@
|
|||
<component name="ShoppingCart">
|
||||
<implementation.java class="services.ShoppingCartImpl"/>
|
||||
<service name="Cart">
|
||||
<t:binding.atom uri="/ShoppingCart/Cart"/>
|
||||
<tuscany:binding.atom uri="/ShoppingCart/Cart"/>
|
||||
</service>
|
||||
<service name="Total">
|
||||
<t:binding.jsonrpc/>
|
||||
<tuscany:binding.jsonrpc/>
|
||||
</service>
|
||||
</component>
|
||||
|
||||
|
|
Loading…
Reference in a new issue