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 2008/01/10 02:58:10 UTC
svn commit: r610641 - in /incubator/tuscany/java/sca/tutorial/catalog-ejb:
./ src/main/java/client/ src/main/java/services/ src/main/resources/
Author: jsdelfino
Date: Wed Jan 9 17:57:34 2008
New Revision: 610641
URL: http://svn.apache.org/viewvc?rev=610641&view=rev
Log:
Cleaning up Catalog EJB module.
Added:
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/CatalogEJB.java (with props)
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/Vegetable.java
- copied, changed from r609080, incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/Item.java
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/VegetablesCatalogEJBImpl.java
- copied, changed from r609080, incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/VegetablesCatalogImpl.java
Removed:
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/Catalog.java
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/Item.java
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/VegetablesCatalogImpl.java
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/resources/CatalogEJB.componentType
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/resources/catalog-jee.composite
Modified:
incubator/tuscany/java/sca/tutorial/catalog-ejb/pom.xml
incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/client/Client.java
Modified: incubator/tuscany/java/sca/tutorial/catalog-ejb/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/catalog-ejb/pom.xml?rev=610641&r1=610640&r2=610641&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/catalog-ejb/pom.xml (original)
+++ incubator/tuscany/java/sca/tutorial/catalog-ejb/pom.xml Wed Jan 9 17:57:34 2008
@@ -17,13 +17,12 @@
specific language governing permissions and limitations
under the License.
-->
-
-<!-- $Rev: 508080 $ $Date: 2007-02-15 14:06:57 -0500 (Thu, 15 Feb 2007) $ -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
-
<parent>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-tutorial</artifactId>
Modified: incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/client/Client.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/client/Client.java?rev=610641&r1=610640&r2=610641&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/client/Client.java (original)
+++ incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/client/Client.java Wed Jan 9 17:57:34 2008
@@ -1,14 +1,12 @@
package client;
-import java.net.URI;
-import java.util.Hashtable;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
-import services.Catalog;
-import services.Item;
+import services.CatalogEJB;
+import services.Vegetable;
public class Client {
@@ -23,13 +21,9 @@
properties.setProperty(Context.PROVIDER_URL, "ejbd://localhost:4201");
InitialContext context = new InitialContext(properties);
- URI uri = URI.create("JEEVegetablesCatalog/").resolve("java:VegetablesCatalogImplRemote");
- System.out.println(uri.toString());
-
- Catalog catalog = (Catalog)context.lookup("java:VegetablesCatalogImplRemote");
- //Catalog catalog = (Catalog)context.lookup("java:JEEVegetablesCatalog/VegetablesCatalogImplRemote");
+ CatalogEJB catalog = (CatalogEJB)context.lookup("java:VegetablesCatalogEJB");
- Item items[] = catalog.get();
+ Vegetable items[] = catalog.get();
System.out.println(items[0].getName());
} catch (Exception ex) {
Added: incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/CatalogEJB.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/CatalogEJB.java?rev=610641&view=auto
==============================================================================
--- incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/CatalogEJB.java (added)
+++ incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/CatalogEJB.java Wed Jan 9 17:57:34 2008
@@ -0,0 +1,27 @@
+/*
+ * 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;
+
+import javax.ejb.Remote;
+
+@Remote
+public interface CatalogEJB {
+ Vegetable[] get();
+}
Propchange: incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/CatalogEJB.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/CatalogEJB.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Copied: incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/Vegetable.java (from r609080, incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/Item.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/Vegetable.java?p2=incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/Vegetable.java&p1=incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/Item.java&r1=609080&r2=610641&rev=610641&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/Item.java (original)
+++ incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/Vegetable.java Wed Jan 9 17:57:34 2008
@@ -21,16 +21,16 @@
import java.io.Serializable;
-public class Item implements Serializable {
+public class Vegetable implements Serializable {
private static final long serialVersionUID = -5847326138627338217L;
private String name;
private String price;
- public Item() {
+ public Vegetable() {
}
- public Item(String name, String price) {
+ public Vegetable(String name, String price) {
this.name = name;
this.price = price;
}
Copied: incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/VegetablesCatalogEJBImpl.java (from r609080, incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/VegetablesCatalogImpl.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/VegetablesCatalogEJBImpl.java?p2=incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/VegetablesCatalogEJBImpl.java&p1=incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/VegetablesCatalogImpl.java&r1=609080&r2=610641&rev=610641&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/VegetablesCatalogImpl.java (original)
+++ incubator/tuscany/java/sca/tutorial/catalog-ejb/src/main/java/services/VegetablesCatalogEJBImpl.java Wed Jan 9 17:57:34 2008
@@ -25,21 +25,20 @@
import javax.ejb.Init;
import javax.ejb.Stateless;
-@Stateless(name="VegetablesCatalogImpl")
-//@Stateless
-public class VegetablesCatalogImpl implements Catalog {
- private List<Item> catalog = new ArrayList<Item>();
+@Stateless(name="VegetablesCatalogEJB")
+public class VegetablesCatalogEJBImpl implements CatalogEJB {
+ private List<Vegetable> catalog = new ArrayList<Vegetable>();
@Init
public void init() {
- catalog.add(new Item("Broccoli", "$2.99"));
- catalog.add(new Item("Asparagus", "$3.55"));
- catalog.add(new Item("Cauliflower", "$1.55"));
+ catalog.add(new Vegetable("Broccoli", "$2.99"));
+ catalog.add(new Vegetable("Asparagus", "$3.55"));
+ catalog.add(new Vegetable("Cauliflower", "$1.55"));
}
- public Item[] get() {
+ public Vegetable[] get() {
init();
- Item[] catalogArray = new Item[catalog.size()];
+ Vegetable[] catalogArray = new Vegetable[catalog.size()];
catalog.toArray(catalogArray);
return catalogArray;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org