geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r834813 - in /geronimo/plugins/tuscany/trunk/samples: helloworld-rewire-ejb/src/main/java/sample/ejb3/ helloworld-rewire-ejb/src/main/resources/META-INF/ helloworld-simple-servlet/src/main/java/sample/ helloworld-simple-servlet/src/main/web...
Date Wed, 11 Nov 2009 09:14:55 GMT
Author: vamsic007
Date: Wed Nov 11 09:14:55 2009
New Revision: 834813

URL: http://svn.apache.org/viewvc?rev=834813&view=rev
Log:
Update the sample
 o Rewiring EJB references using SCA with annotations on methods

Modified:
    geronimo/plugins/tuscany/trunk/samples/helloworld-rewire-ejb/src/main/java/sample/ejb3/HelloworldRewireBean.java
    geronimo/plugins/tuscany/trunk/samples/helloworld-rewire-ejb/src/main/resources/META-INF/ejb-jar.composite
    geronimo/plugins/tuscany/trunk/samples/helloworld-rewire-ejb/src/main/resources/META-INF/openejb-jar.xml
    geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/java/sample/HelloworldServlet.java
    geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/geronimo-web.xml
    geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/web.composite

Modified: geronimo/plugins/tuscany/trunk/samples/helloworld-rewire-ejb/src/main/java/sample/ejb3/HelloworldRewireBean.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/samples/helloworld-rewire-ejb/src/main/java/sample/ejb3/HelloworldRewireBean.java?rev=834813&r1=834812&r2=834813&view=diff
==============================================================================
--- geronimo/plugins/tuscany/trunk/samples/helloworld-rewire-ejb/src/main/java/sample/ejb3/HelloworldRewireBean.java
(original)
+++ geronimo/plugins/tuscany/trunk/samples/helloworld-rewire-ejb/src/main/java/sample/ejb3/HelloworldRewireBean.java
Wed Nov 11 09:14:55 2009
@@ -41,6 +41,28 @@
     @EJB
     protected HelloworldService ejbService;
 
+    @EJB
+    @Reference(required=false)
+    protected HelloworldService ejbService2;
+
+    @EJB
+    @Reference(required=false)
+    protected HelloworldService ejbService3;
+    
+    private HelloworldService ejbService4;
+    @EJB
+    @Reference(required=false)
+    public void setEjbService4(HelloworldService service) {
+        this.ejbService4 = service;
+    }
+
+    private HelloworldService ejbService5;
+    @EJB
+    @Reference(required=false)
+    public void setEjbService5(HelloworldService service) {
+        this.ejbService5 = service;
+    }
+    
     @Property
     protected String scaProperty;
     
@@ -72,6 +94,10 @@
         String greeting = service.getGreetings(name);
         String scaGreeting = scaService.getGreetings(name);
         String ejbGreeting = ejbService.getGreetings(name);
+        String greeting4 = ejbService2.getGreetings(name);
+        String greeting5 = ejbService3.getGreetings(name);
+        String greeting6 = ejbService4.getGreetings(name);
+        String greeting7 = ejbService5.getGreetings(name);
         
         sb.append("");
         sb.append("<br><br>EJB :: HelloworldService.getGreeting: "+name);
@@ -80,6 +106,14 @@
         sb.append("<br>"+scaGreeting);
         sb.append("<br><br>EJB rewired using SCA :: HelloworldService.getGreeting:
"+name);
         sb.append("<br>"+ejbGreeting);
+        sb.append("<br><br>Field with @EJB and @Reference annotations :: HelloworldService.getGreeting:
"+name);
+        sb.append("<br>"+greeting4);
+        sb.append("<br><br>Field with @EJB and @Reference annotations, rewired
using SCA :: HelloworldService.getGreeting: "+name);
+        sb.append("<br>"+greeting5);
+        sb.append("<br><br>Method with @EJB and @Reference annotations :: HelloworldService.getGreeting:
"+name);
+        sb.append("<br>"+greeting6);
+        sb.append("<br><br>Method with @EJB and @Reference annotations, rewired
using SCA :: HelloworldService.getGreeting: "+name);
+        sb.append("<br>"+greeting7);
         sb.append("<hr>");
         
         sb.append("<br>SCA Property");

Modified: geronimo/plugins/tuscany/trunk/samples/helloworld-rewire-ejb/src/main/resources/META-INF/ejb-jar.composite
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/samples/helloworld-rewire-ejb/src/main/resources/META-INF/ejb-jar.composite?rev=834813&r1=834812&r2=834813&view=diff
==============================================================================
--- geronimo/plugins/tuscany/trunk/samples/helloworld-rewire-ejb/src/main/resources/META-INF/ejb-jar.composite
(original)
+++ geronimo/plugins/tuscany/trunk/samples/helloworld-rewire-ejb/src/main/resources/META-INF/ejb-jar.composite
Wed Nov 11 09:14:55 2009
@@ -31,6 +31,10 @@
         <reference name="scaService" target="HelloworldServiceComponent"/>
         <reference name="sample.ejb3.HelloworldRewireBean_ejbService" target="HelloworldServiceComponent"/>
         <property name="scaProperty">SCA property1</property>
+        <!--reference name="ejbService2" target="HelloworldServiceComponent"/-->
+        <reference name="ejbService3" target="HelloworldServiceComponent"/>
+        <!--reference name="ejbService4" target="HelloworldServiceComponent"/-->
+        <reference name="ejbService5" target="HelloworldServiceComponent"/>
         <property name="envEntry2">value configured through SCA property</property>
         <property name="a_b_envEntry3">value configured through SCA property</property>
     </component>

Modified: geronimo/plugins/tuscany/trunk/samples/helloworld-rewire-ejb/src/main/resources/META-INF/openejb-jar.xml
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/samples/helloworld-rewire-ejb/src/main/resources/META-INF/openejb-jar.xml?rev=834813&r1=834812&r2=834813&view=diff
==============================================================================
--- geronimo/plugins/tuscany/trunk/samples/helloworld-rewire-ejb/src/main/resources/META-INF/openejb-jar.xml
(original)
+++ geronimo/plugins/tuscany/trunk/samples/helloworld-rewire-ejb/src/main/resources/META-INF/openejb-jar.xml
Wed Nov 11 09:14:55 2009
@@ -40,7 +40,7 @@
         <ejb:session>
             <ejb:ejb-name>HelloworldRewireBean</ejb:ejb-name>
 		    <nam:ejb-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
-		        <nam:ref-name>service</nam:ref-name>
+		        <nam:ref-name>sample.ejb3.HelloworldRewireBean/service</nam:ref-name>
 		        <nam:pattern>
 		            <nam:groupId>test</nam:groupId>
 		            <nam:artifactId>helloworld-simple-ejb</nam:artifactId>
@@ -49,7 +49,43 @@
 		        </nam:pattern>
 		    </nam:ejb-ref>
 		    <nam:ejb-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
-		        <nam:ref-name>ejbService</nam:ref-name>
+		        <nam:ref-name>sample.ejb3.HelloworldRewireBean/ejbService</nam:ref-name>
+		        <nam:pattern>
+		            <nam:groupId>test</nam:groupId>
+		            <nam:artifactId>helloworld-simple-ejb</nam:artifactId>
+		            <nam:version>1.0</nam:version>
+		            <nam:name>HelloworldServiceSimpleBean</nam:name>
+		        </nam:pattern>
+		    </nam:ejb-ref>
+		    <nam:ejb-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
+		        <nam:ref-name>sample.ejb3.HelloworldRewireBean/ejbService2</nam:ref-name>
+		        <nam:pattern>
+		            <nam:groupId>test</nam:groupId>
+		            <nam:artifactId>helloworld-simple-ejb</nam:artifactId>
+		            <nam:version>1.0</nam:version>
+		            <nam:name>HelloworldServiceSimpleBean</nam:name>
+		        </nam:pattern>
+		    </nam:ejb-ref>
+		    <nam:ejb-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
+		        <nam:ref-name>sample.ejb3.HelloworldRewireBean/ejbService3</nam:ref-name>
+		        <nam:pattern>
+		            <nam:groupId>test</nam:groupId>
+		            <nam:artifactId>helloworld-simple-ejb</nam:artifactId>
+		            <nam:version>1.0</nam:version>
+		            <nam:name>HelloworldServiceSimpleBean</nam:name>
+		        </nam:pattern>
+		    </nam:ejb-ref>
+		    <nam:ejb-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
+		        <nam:ref-name>sample.ejb3.HelloworldRewireBean/ejbService4</nam:ref-name>
+		        <nam:pattern>
+		            <nam:groupId>test</nam:groupId>
+		            <nam:artifactId>helloworld-simple-ejb</nam:artifactId>
+		            <nam:version>1.0</nam:version>
+		            <nam:name>HelloworldServiceSimpleBean</nam:name>
+		        </nam:pattern>
+		    </nam:ejb-ref>
+		    <nam:ejb-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
+		        <nam:ref-name>sample.ejb3.HelloworldRewireBean/ejbService5</nam:ref-name>
 		        <nam:pattern>
 		            <nam:groupId>test</nam:groupId>
 		            <nam:artifactId>helloworld-simple-ejb</nam:artifactId>

Modified: geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/java/sample/HelloworldServlet.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/java/sample/HelloworldServlet.java?rev=834813&r1=834812&r2=834813&view=diff
==============================================================================
--- geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/java/sample/HelloworldServlet.java
(original)
+++ geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/java/sample/HelloworldServlet.java
Wed Nov 11 09:14:55 2009
@@ -46,7 +46,29 @@
     
     @EJB
     protected HelloworldService ejbService;
+    
+    @EJB
+    @Reference(name="ejbService2", required=false)
+    protected HelloworldService ejbService2;
+
+    @EJB
+    @Reference(name="ejbService3", required=false)
+    protected HelloworldService ejbService3;
+    
+    private HelloworldService ejbService4;
+    @EJB
+    @Reference(name="ejbService4", required=false)
+    public void setEjbService4(HelloworldService service) {
+        this.ejbService4 = service;
+    }
 
+    private HelloworldService ejbService5;
+    @EJB
+    @Reference(name="ejbService5", required=false)
+    public void setEjbService5(HelloworldService service) {
+        this.ejbService5 = service;
+    }
+    
     @Property
     protected String scaProperty;
     
@@ -68,6 +90,10 @@
         String greeting = service.getGreetings(name);
         String greeting2 = scaService.getGreetings(name);
         String greeting3 = ejbService.getGreetings(name);
+        String greeting4 = ejbService2.getGreetings(name);
+        String greeting5 = ejbService3.getGreetings(name);
+        String greeting6 = ejbService4.getGreetings(name);
+        String greeting7 = ejbService5.getGreetings(name);
 
         Writer out = response.getWriter();
         out.write("<html><head><title>Apache Tuscany Helloworld Simple
Servlet Sample</title></head><body>");
@@ -79,6 +105,14 @@
         out.write("<br>"+greeting2);
         out.write("<br><br>EJB rewired using SCA :: HelloworldService.getGreeting:
"+name);
         out.write("<br>"+greeting3);
+        out.write("<br><br>Field with @EJB and @Reference annotations :: HelloworldService.getGreeting:
"+name);
+        out.write("<br>"+greeting4);
+        out.write("<br><br>Field with @EJB and @Reference annotations, rewired
using SCA :: HelloworldService.getGreeting: "+name);
+        out.write("<br>"+greeting5);
+        out.write("<br><br>Method with @EJB and @Reference annotations :: HelloworldService.getGreeting:
"+name);
+        out.write("<br>"+greeting6);
+        out.write("<br><br>Method with @EJB and @Reference annotations, rewired
using SCA :: HelloworldService.getGreeting: "+name);
+        out.write("<br>"+greeting7);
         out.write("<hr>");
         out.write("<br>SCA Property");
         out.write("<br>"+scaProperty);

Modified: geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/geronimo-web.xml?rev=834813&r1=834812&r2=834813&view=diff
==============================================================================
--- geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/geronimo-web.xml
(original)
+++ geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/geronimo-web.xml
Wed Nov 11 09:14:55 2009
@@ -53,4 +53,40 @@
             <nam:name>HelloworldServiceSimpleBean</nam:name>
         </nam:pattern>
     </nam:ejb-ref>
+    <nam:ejb-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
+        <nam:ref-name>sample.HelloworldServlet/ejbService2</nam:ref-name>
+        <nam:pattern>
+            <nam:groupId>test</nam:groupId>
+            <nam:artifactId>helloworld-simple-ejb</nam:artifactId>
+            <nam:version>1.0</nam:version>
+            <nam:name>HelloworldServiceSimpleBean</nam:name>
+        </nam:pattern>
+    </nam:ejb-ref>
+    <nam:ejb-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
+        <nam:ref-name>sample.HelloworldServlet/ejbService3</nam:ref-name>
+        <nam:pattern>
+            <nam:groupId>test</nam:groupId>
+            <nam:artifactId>helloworld-simple-ejb</nam:artifactId>
+            <nam:version>1.0</nam:version>
+            <nam:name>HelloworldServiceSimpleBean</nam:name>
+        </nam:pattern>
+    </nam:ejb-ref>
+    <nam:ejb-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
+        <nam:ref-name>sample.HelloworldServlet/EjbService4</nam:ref-name>
+        <nam:pattern>
+            <nam:groupId>test</nam:groupId>
+            <nam:artifactId>helloworld-simple-ejb</nam:artifactId>
+            <nam:version>1.0</nam:version>
+            <nam:name>HelloworldServiceSimpleBean</nam:name>
+        </nam:pattern>
+    </nam:ejb-ref>
+    <nam:ejb-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
+        <nam:ref-name>sample.HelloworldServlet/EjbService5</nam:ref-name>
+        <nam:pattern>
+            <nam:groupId>test</nam:groupId>
+            <nam:artifactId>helloworld-simple-ejb</nam:artifactId>
+            <nam:version>1.0</nam:version>
+            <nam:name>HelloworldServiceSimpleBean</nam:name>
+        </nam:pattern>
+    </nam:ejb-ref>
 </web-app>
\ No newline at end of file

Modified: geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/web.composite
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/web.composite?rev=834813&r1=834812&r2=834813&view=diff
==============================================================================
--- geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/web.composite
(original)
+++ geronimo/plugins/tuscany/trunk/samples/helloworld-simple-servlet/src/main/webapp/WEB-INF/web.composite
Wed Nov 11 09:14:55 2009
@@ -25,6 +25,10 @@
         <implementation.web web-uri="helloworld-simple-servlet.war"/>
         <reference name="sample.HelloworldServlet_scaService" target="HelloworldServiceComponent"/>
         <reference name="sample.HelloworldServlet_ejbService" target="HelloworldServiceComponent"/>
+        <!--reference name="ejbService2" target="HelloworldServiceComponent"/-->
+        <reference name="ejbService3" target="HelloworldServiceComponent"/>
+        <!--reference name="ejbService4" target="HelloworldServiceComponent"/-->
+        <reference name="ejbService5" target="HelloworldServiceComponent"/>
         <property name="sample.HelloworldServlet_scaProperty">property1</property>
         <property name="envEntry2">value configured through SCA property</property>
         <property name="a_b_envEntry3">value configured through SCA property</property>



Mime
View raw message