geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r720951 - in /geronimo/plugins/tuscany/trunk: ./ samples/helloworld-ejb/ samples/helloworld-ejb/src/ samples/helloworld-ejb/src/main/ samples/helloworld-ejb/src/main/java/ samples/helloworld-ejb/src/main/java/sample/ samples/helloworld-ejb/...
Date Wed, 26 Nov 2008 19:16:09 GMT
Author: vamsic007
Date: Wed Nov 26 11:16:08 2008
New Revision: 720951

URL: http://svn.apache.org/viewvc?rev=720951&view=rev
Log:
Helloworld EJB Sample application.

Added:
    geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/
    geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/pom.xml   (with props)
    geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/
    geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/
    geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/
    geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/
    geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/Helloworld.java
  (with props)
    geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/ejb3/
    geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/ejb3/HelloworldService.java
  (with props)
    geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/ejb3/HelloworldServiceBean.java
  (with props)
    geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/
    geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/META-INF/
    geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/META-INF/ejb-jar.composite
  (with props)
    geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/META-INF/openejb-jar.xml
  (with props)
Modified:
    geronimo/plugins/tuscany/trunk/pom.xml

Modified: geronimo/plugins/tuscany/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/pom.xml?rev=720951&r1=720950&r2=720951&view=diff
==============================================================================
--- geronimo/plugins/tuscany/trunk/pom.xml (original)
+++ geronimo/plugins/tuscany/trunk/pom.xml Wed Nov 26 11:16:08 2008
@@ -290,6 +290,11 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.geronimo.specs</groupId>
+                <artifactId>geronimo-ejb_3.0_spec</artifactId>
+                <version>1.0.1</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.geronimo.specs</groupId>
                 <artifactId>geronimo-jsp_2.1_spec</artifactId>
                 <version>1.0</version>
         </dependency>

Added: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/pom.xml?rev=720951&view=auto
==============================================================================
--- geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/pom.xml (added)
+++ geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/pom.xml Wed Nov 26 11:16:08 2008
@@ -0,0 +1,49 @@
+<?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.    
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.geronimo.plugins</groupId>
+        <artifactId>tuscany-parent</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>helloworld-ejb</artifactId>
+    <name>Geronimo Plugins :: Helloworld EJB Sample</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-sca-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-ejb_3.0_spec</artifactId>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+       <finalName>${artifactId}</finalName>
+    </build>
+</project>

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/Helloworld.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/Helloworld.java?rev=720951&view=auto
==============================================================================
--- geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/Helloworld.java
(added)
+++ geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/Helloworld.java
Wed Nov 26 11:16:08 2008
@@ -0,0 +1,32 @@
+/*
+ * 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 sample;
+
+import org.osoa.sca.annotations.Remotable;
+
+/**
+ * Helloworld SCA service interface.
+ * 
+ * @version $Rev$ $Date$
+ */
+@Remotable
+public interface Helloworld {
+    String sayHello(String name);
+}

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/Helloworld.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/Helloworld.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/Helloworld.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/ejb3/HelloworldService.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/ejb3/HelloworldService.java?rev=720951&view=auto
==============================================================================
--- geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/ejb3/HelloworldService.java
(added)
+++ geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/ejb3/HelloworldService.java
Wed Nov 26 11:16:08 2008
@@ -0,0 +1,33 @@
+/*
+ * 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 sample.ejb3;
+
+import javax.ejb.Remote;
+
+/**
+ * HelloworldService EJB interface.
+ * 
+ * @version $Rev$ $Date$
+ */
+
+@Remote
+public interface HelloworldService {
+	String getGreetings(String name);
+}

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/ejb3/HelloworldService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/ejb3/HelloworldService.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/ejb3/HelloworldService.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/ejb3/HelloworldServiceBean.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/ejb3/HelloworldServiceBean.java?rev=720951&view=auto
==============================================================================
--- geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/ejb3/HelloworldServiceBean.java
(added)
+++ geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/ejb3/HelloworldServiceBean.java
Wed Nov 26 11:16:08 2008
@@ -0,0 +1,146 @@
+/**
+ *  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 sample.ejb3;
+
+import javax.ejb.Stateless;
+
+import org.osoa.sca.ComponentContext;
+import org.osoa.sca.annotations.ComponentName;
+import org.osoa.sca.annotations.Context;
+import org.osoa.sca.annotations.Property;
+import org.osoa.sca.annotations.Reference;
+
+import sample.Helloworld;
+
+/**
+ * HelloworldService EJB implementation that accesses Helloworld SCA services through injected
references.
+ * 
+ * @version $Rev$ $Date$
+ */
+@Stateless
+public class HelloworldServiceBean implements HelloworldService {
+    @Reference
+    protected Helloworld service1;
+    
+    // Reference name specified in the annotation
+    @Reference(name="service2")
+    protected Helloworld ser2;
+    
+    // Reference annotation on setter method
+    private Helloworld ser3;
+    @Reference
+    public void setService3(Helloworld service3) {
+        this.ser3 = service3;
+    }
+    
+    /* Test for required */
+    @Reference(required=false)
+    protected Helloworld service4;
+    
+    @Reference(required=false)
+    protected Helloworld service5;
+    
+    @Reference(required=true)
+    protected Helloworld service6;
+
+    @Property
+    protected String property1;
+    
+    // Property name specified in the annotation
+    @Property(name="property2")
+    protected int prop2;
+    
+    // Property annotation on setter method
+    private double prop3;
+    @Property
+    public void setProperty3(double property3) {
+        this.prop3 = property3;
+    }
+    
+    /* Test for required */
+    @Property(required=false)
+    protected String property4;
+
+    @Property(required=false)
+    protected String property5;
+
+    @Property(required=true)
+    protected String property6;
+    
+    @ComponentName
+    protected String scaComponentName;
+
+    // Annotation on setter method
+    private String scaComponentName1;
+    @ComponentName
+    public void setScaComponentName1(String scaComponentName1) {
+        this.scaComponentName1 = scaComponentName1;
+    }
+    
+    @Context
+    protected ComponentContext componentContext;
+
+    // Annotation on setter method
+    private ComponentContext componentContext1;
+    @Context
+    public void setCompContext(ComponentContext ctx) {
+        componentContext1 = ctx;
+    }
+
+	public String getGreetings(String name) {
+		System.out.println(scaComponentName+": HelloworldServiceBean.getGreetings: "+name);
+		return prepareResponse(name);
+	}
+	
+	private String prepareResponse(String name) {
+		StringBuffer sb = new StringBuffer();
+        String greeting = service1.sayHello(name);
+        String greeting2 = ser2.sayHello(name);
+        String greeting3 = ser3.sayHello(name);
+        
+        sb.append("<h3>@Reference</h3>");
+        sb.append("<br>Injected into field. <br><strong>Result: </strong>"
+ greeting);
+        sb.append("<br><br>Injected into field with reference name specified
in the annotation. <br><strong>Result: </strong>" + greeting2);
+        sb.append("<br><br>Injected using setter method. <br><strong>Result:
</strong>" + greeting3);
+        sb.append("<br><br>Required is false. Reference is not specified. "+service4);
+        sb.append("<br><br>Required is false. Reference is specified. "+service5);
+        sb.append("<br><br>Required is true. Reference is specified. "+service6);
+        sb.append("<hr>");
+        
+        sb.append("<h3>@Property</h3>");
+        sb.append("<br>Injected into field: property1 = "+property1);
+        sb.append("<br>Injected into field with property name specified in the annotation:
property2 = "+prop2);
+        sb.append("<br>Injected using setter method: Property3 = "+prop3);
+        sb.append("<br>Required is false. Property is not specified. "+property4);
+        sb.append("<br>Required is false. Property is specified. "+property5);
+        sb.append("<br>Required is true. Property is specified. "+property6);
+        sb.append("<hr>");
+        
+        sb.append("<h3>@ComponentName</h3>");
+        sb.append("<br>Injected into annotated field: "+scaComponentName);
+        sb.append("<br>Injected using annotated method: "+scaComponentName1);
+        sb.append("<hr>");
+
+        sb.append("<h3>@Context</h3>");
+        sb.append("<br>Injected into annotated field: "+componentContext);
+        sb.append("<br>Injected using annotated method: "+componentContext1);
+        sb.append("<hr>");
+
+        return sb.toString();
+	}
+}

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/ejb3/HelloworldServiceBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/ejb3/HelloworldServiceBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/java/sample/ejb3/HelloworldServiceBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/META-INF/ejb-jar.composite
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/META-INF/ejb-jar.composite?rev=720951&view=auto
==============================================================================
--- geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/META-INF/ejb-jar.composite
(added)
+++ geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/META-INF/ejb-jar.composite
Wed Nov 26 11:16:08 2008
@@ -0,0 +1,43 @@
+<?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.    
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+           targetNamespace="http://sample"
+           xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+           name="helloworld-ejb">
+
+    <component name="helloworldEjbComponent">
+        <implementation.ejb ejb-link="HelloworldServiceBean"/>
+
+        <reference name="service1" target="HelloworldComponent" />
+        <reference name="service2" target="HelloworldTeluguComponent" />
+        <reference name="Service3" target="HelloworldFrenchComponent" />
+        <!-- <reference name="service4" target="HelloworldComponent"/> -->
+        <reference name="service5" target="HelloworldComponent"/>
+        <reference name="service6" target="HelloworldComponent"/>
+
+        <property name="property1" type="xsd:string">Prop1</property>
+        <property name="property2" type="xsd:int">7</property>
+        <property name="Property3" type="xsd:double">0.7</property>
+        <!-- <property name="property4" type="xsd:string">Prop4</property>
-->
+        <property name="property5" type="xsd:string">Prop5</property>
+        <property name="property6" type="xsd:string">Prop6</property>
+    </component>
+</composite>
+

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/META-INF/ejb-jar.composite
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/META-INF/ejb-jar.composite
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/META-INF/ejb-jar.composite
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/META-INF/openejb-jar.xml
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/META-INF/openejb-jar.xml?rev=720951&view=auto
==============================================================================
--- geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/META-INF/openejb-jar.xml
(added)
+++ geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/META-INF/openejb-jar.xml
Wed Nov 26 11:16:08 2008
@@ -0,0 +1,32 @@
+<?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.    
+-->
+<ejb:openejb-jar xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2" xmlns:ejb="http://openejb.apache.org/xml/ns/openejb-jar-2.2">
+    <dep:environment>
+        <dep:moduleId>
+            <dep:groupId>test</dep:groupId>
+            <dep:artifactId>helloworld-ejb</dep:artifactId>
+            <dep:version>1.0</dep:version>
+            <dep:type>jar</dep:type>
+        </dep:moduleId>
+        <dep:dependencies/>
+        <dep:hidden-classes/>
+        <dep:non-overridable-classes/>
+    </dep:environment>
+</ejb:openejb-jar>

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/META-INF/openejb-jar.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/META-INF/openejb-jar.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/plugins/tuscany/trunk/samples/helloworld-ejb/src/main/resources/META-INF/openejb-jar.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message