tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1040250 - in /openejb/branches/openejb-3.1.x/examples: lookup-of-ejbs-with-descriptor/ lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/ lookup-of-ejbs-with-descriptor/src/main/resources/META-INF/ lookup-of-ejbs-with-des...
Date Mon, 29 Nov 2010 19:46:39 GMT
Author: dblevins
Date: Mon Nov 29 19:46:38 2010
New Revision: 1040250

URL: http://svn.apache.org/viewvc?rev=1040250&view=rev
Log:
OPENEJB-342: Example: Lookup of EJBs with descriptor

Added:
    openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/
      - copied from r1040236, openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/
Modified:
    openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/pom.xml
    openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/BlueBean.java
    openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/Friend.java
    openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/RedBean.java
    openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/resources/META-INF/ejb-jar.xml
    openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java
    openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/BlueBean.java
    openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/Friend.java
    openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/RedBean.java
    openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java

Modified: openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/pom.xml
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/pom.xml?rev=1040250&r1=1040236&r2=1040250&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/pom.xml (original)
+++ openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/pom.xml Mon Nov
29 19:46:38 2010
@@ -22,10 +22,10 @@
 <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>
   <groupId>org.superbiz</groupId>
-  <artifactId>lookup-of-ejbs</artifactId>
+  <artifactId>lookup-of-ejbs-with-descriptor</artifactId>
   <packaging>jar</packaging>
   <version>1.0-SNAPSHOT</version>
-  <name>OpenEJB :: Examples :: @EJB Lookup</name>
+  <name>OpenEJB :: Examples :: EJB Lookup with descriptor</name>
   <properties>
     <!--
        - http://docs.codehaus.org/display/MAVENUSER/POM+Element+for+Source+File+Encoding

Modified: openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/BlueBean.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/BlueBean.java?rev=1040250&r1=1040236&r2=1040250&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/BlueBean.java
(original)
+++ openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/BlueBean.java
Mon Nov 29 19:46:38 2010
@@ -23,15 +23,13 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 
 //START SNIPPET: code
-@Stateless
-@EJB(beanInterface = Friend.class, beanName = "RedBean", name = "myFriend")
 public class BlueBean implements Friend {
 
 	public String sayHello() {
 		return "Blue says, Hello!";
 	}
 
-    public String helloToFriend() {
+    public String helloFromFriend() {
         try {
             Friend friend = (Friend) new InitialContext().lookup("java:comp/env/myFriend");
             return "My friend " + friend.sayHello();

Modified: openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/Friend.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/Friend.java?rev=1040250&r1=1040236&r2=1040250&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/Friend.java
(original)
+++ openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/Friend.java
Mon Nov 29 19:46:38 2010
@@ -26,11 +26,10 @@ import javax.ejb.Local;
  * if the bean does not implement any other interfaces
  */
 //START SNIPPET: code
-@Local
 public interface Friend {
 	
     public String sayHello();
-    public String helloToFriend();
+    public String helloFromFriend();
 	
 }
 //END SNIPPET: code

Modified: openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/RedBean.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/RedBean.java?rev=1040250&r1=1040236&r2=1040250&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/RedBean.java
(original)
+++ openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/java/org/superbiz/ejblookup/RedBean.java
Mon Nov 29 19:46:38 2010
@@ -23,15 +23,13 @@ import javax.naming.InitialContext;
 import javax.naming.NamingException;
 
 //START SNIPPET: code
-@Stateless
-@EJB(beanInterface = Friend.class, beanName = "BlueBean", name = "myFriend")
 public class RedBean implements Friend {
 
     public String sayHello() {
         return "Red says, Hello!";
     }
 
-    public String helloToFriend() {
+    public String helloFromFriend() {
         try {
             Friend friend = (Friend) new InitialContext().lookup("java:comp/env/myFriend");
             return "My friend " + friend.sayHello();

Modified: openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/resources/META-INF/ejb-jar.xml
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/resources/META-INF/ejb-jar.xml?rev=1040250&r1=1040236&r2=1040250&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/resources/META-INF/ejb-jar.xml
(original)
+++ openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/main/resources/META-INF/ejb-jar.xml
Mon Nov 29 19:46:38 2010
@@ -1 +1,29 @@
-<ejb-jar/>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee">
+    <enterprise-beans>
+        <session>
+            <ejb-name>BlueBean</ejb-name>
+            <business-local>org.superbiz.ejblookup.Friend</business-local>
+            <ejb-class>org.superbiz.ejblookup.BlueBean</ejb-class>
+            <session-type>Stateless</session-type>
+            <transaction-type>Container</transaction-type>
+            <ejb-local-ref>
+                <ejb-ref-name>myFriend</ejb-ref-name>
+                <local>org.superbiz.ejblookup.Friend</local>
+                <ejb-link>RedBean</ejb-link>
+            </ejb-local-ref>
+        </session>
+        <session>
+            <ejb-name>RedBean</ejb-name>
+            <business-local>org.superbiz.ejblookup.Friend</business-local>
+            <ejb-class>org.superbiz.ejblookup.RedBean</ejb-class>
+            <session-type>Stateless</session-type>
+            <transaction-type>Container</transaction-type>
+            <ejb-local-ref>
+                <ejb-ref-name>myFriend</ejb-ref-name>
+                <local>org.superbiz.ejblookup.Friend</local>
+                <ejb-link>BlueBean</ejb-link>
+            </ejb-local-ref>
+        </session>
+    </enterprise-beans>
+</ejb-jar>

Modified: openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java?rev=1040250&r1=1040236&r2=1040250&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java
(original)
+++ openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs-with-descriptor/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java
Mon Nov 29 19:46:38 2010
@@ -31,7 +31,6 @@ public class EjbDependencyTest extends T
     protected void setUp() throws Exception {
         Properties properties = new Properties();
         properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
-
         initialContext = new InitialContext(properties);
     }
 
@@ -41,7 +40,7 @@ public class EjbDependencyTest extends T
 
         assertNotNull(red);
         assertEquals("Red says, Hello!", red.sayHello());
-    	assertEquals("My friend Blue says, Hello!", red.helloToFriend());
+    	assertEquals("My friend Blue says, Hello!", red.helloFromFriend());
 
     }
 
@@ -51,7 +50,7 @@ public class EjbDependencyTest extends T
 
         assertNotNull(blue);
         assertEquals("Blue says, Hello!", blue.sayHello());
-        assertEquals("My friend Red says, Hello!", blue.helloToFriend());
+        assertEquals("My friend Red says, Hello!", blue.helloFromFriend());
 
     }
 

Modified: openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/BlueBean.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/BlueBean.java?rev=1040250&r1=1040249&r2=1040250&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/BlueBean.java
(original)
+++ openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/BlueBean.java
Mon Nov 29 19:46:38 2010
@@ -31,7 +31,7 @@ public class BlueBean implements Friend 
 		return "Blue says, Hello!";
 	}
 
-    public String helloToFriend() {
+    public String helloFromFriend() {
         try {
             Friend friend = (Friend) new InitialContext().lookup("java:comp/env/myFriend");
             return "My friend " + friend.sayHello();

Modified: openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/Friend.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/Friend.java?rev=1040250&r1=1040249&r2=1040250&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/Friend.java
(original)
+++ openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/Friend.java
Mon Nov 29 19:46:38 2010
@@ -30,7 +30,7 @@ import javax.ejb.Local;
 public interface Friend {
 	
     public String sayHello();
-    public String helloToFriend();
+    public String helloFromFriend();
 	
 }
 //END SNIPPET: code

Modified: openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/RedBean.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/RedBean.java?rev=1040250&r1=1040249&r2=1040250&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/RedBean.java
(original)
+++ openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/main/java/org/superbiz/ejblookup/RedBean.java
Mon Nov 29 19:46:38 2010
@@ -31,7 +31,7 @@ public class RedBean implements Friend {
         return "Red says, Hello!";
     }
 
-    public String helloToFriend() {
+    public String helloFromFriend() {
         try {
             Friend friend = (Friend) new InitialContext().lookup("java:comp/env/myFriend");
             return "My friend " + friend.sayHello();

Modified: openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java?rev=1040250&r1=1040249&r2=1040250&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java
(original)
+++ openejb/branches/openejb-3.1.x/examples/lookup-of-ejbs/src/test/java/org/superbiz/ejblookup/EjbDependencyTest.java
Mon Nov 29 19:46:38 2010
@@ -41,7 +41,7 @@ public class EjbDependencyTest extends T
 
         assertNotNull(red);
         assertEquals("Red says, Hello!", red.sayHello());
-    	assertEquals("My friend Blue says, Hello!", red.helloToFriend());
+    	assertEquals("My friend Blue says, Hello!", red.helloFromFriend());
 
     }
 
@@ -51,7 +51,7 @@ public class EjbDependencyTest extends T
 
         assertNotNull(blue);
         assertEquals("Blue says, Hello!", blue.sayHello());
-        assertEquals("My friend Red says, Hello!", blue.helloToFriend());
+        assertEquals("My friend Red says, Hello!", blue.helloFromFriend());
 
     }
 



Mime
View raw message