[jboss-cvs] JBossAS SVN: r82625 - in projects/ejb3/trunk/docs/tutorial: ejb21_client_adaptors and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jan 6 06:42:37 EST 2009


Author: jaikiran
Date: 2009-01-06 06:42:34 -0500 (Tue, 06 Jan 2009)
New Revision: 82625

Added:
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/META-INF/
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/build.xml
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.html
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.wiki
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/jndi.properties
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/log4j.xml
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/pom.xml
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/src/
Removed:
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/META-INF/
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/build.xml
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.html
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.wiki
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/jndi.properties
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/log4j.xml
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/src/
Modified:
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/META-INF/jboss.xml
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session1Bean.java
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2Bean.java
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2Local.java
   projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2LocalHome.java
Log:
EJBTHREE-1662 EJB2.1 Client Adaptors tutorial for JBossAS-5.0 GA

Copied: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors (from rev 82032, projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors)

Copied: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/META-INF (from rev 82620, projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors/META-INF)

Modified: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/META-INF/jboss.xml
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors/META-INF/jboss.xml	2009-01-06 03:19:19 UTC (rev 82620)
+++ projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/META-INF/jboss.xml	2009-01-06 11:42:34 UTC (rev 82625)
@@ -1,10 +1,7 @@
 <?xml version="1.0"?>
-<jboss
-        xmlns="http://www.jboss.com/xml/ns/javaee"
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
-                            http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
-        version="3.0">
+<jboss xmlns:xs="http://www.jboss.org/j2ee/schema"
+       xs:schemaLocation="http://www.jboss.org/j2ee/schema jboss_5_0.xsd"
+             version="5.0"> 
    <enterprise-beans>
       <session>
          <ejb-name>DeploymentDescriptorSession1</ejb-name>
@@ -14,5 +11,13 @@
          <ejb-name>DeploymentDescriptorSession2</ejb-name>
          <local-jndi-name>DeploymentDescriptorSession2Local</local-jndi-name>
       </session>
+      <session>
+      	<ejb-name>Session1</ejb-name>
+      	<jndi-name>Session1Remote</jndi-name>
+      </session>
+      <session>
+      	<ejb-name>Session2</ejb-name>
+      	<local-jndi-name>Session2Local</local-jndi-name>
+      </session>
    </enterprise-beans>
 </jboss>

Deleted: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/build.xml
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors/build.xml	2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/build.xml	2009-01-06 11:42:34 UTC (rev 82625)
@@ -1,91 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- ======================================================================= -->
-<!-- JBoss build file                                                       -->
-<!-- ======================================================================= -->
-
-<project name="JBoss" default="ejbjar" basedir=".">
-
-   <property environment="env"/>
-   <property name="src.dir" value="${basedir}/src"/>
-   <property name="jboss.home" value="${env.JBOSS_HOME}"/>   <property name="jboss.server.config" value="all"/>
-   <property name="build.dir" value="${basedir}/build"/>
-   <property name="build.classes.dir" value="${build.dir}/classes"/>
-
-   <!-- Build classpath -->
-   <path id="classpath">
-      <!-- So that we can get jndi.properties for InitialContext -->
-      <pathelement location="${basedir}"/>
-      <fileset dir="${jboss.home}/lib">
-         <include name="**/*.jar"/>
-      </fileset>
-      <fileset dir="${jboss.home}/server/${jboss.server.config}/lib">
-         <include name="**/*.jar"/>
-      </fileset>
-      <fileset dir="${jboss.home}/server/${jboss.server.config}/deploy/ejb3.deployer">
-         <include name="*.jar"/>
-      </fileset>
-      <fileset dir="${jboss.home}/server/${jboss.server.config}/deploy/jboss-aop-jdk50.deployer">
-         <include name="*.jar"/>
-      </fileset>
-      <pathelement location="${build.classes.dir}"/>
-   </path>
-
-   <property name="build.classpath" refid="classpath"/>
-
-   <!-- =================================================================== -->
-   <!-- Prepares the build directory                                        -->
-   <!-- =================================================================== -->
-   <target name="prepare">
-      <mkdir dir="${build.dir}"/>
-      <mkdir dir="${build.classes.dir}"/>
-   </target>
-
-   <!-- =================================================================== -->
-   <!-- Compiles the source code                                            -->
-   <!-- =================================================================== -->
-   <target name="compile" depends="prepare">
-      <javac srcdir="${src.dir}"
-         destdir="${build.classes.dir}"
-         debug="on"
-         deprecation="on"
-         optimize="off"
-         includes="**">
-         <classpath refid="classpath"/>
-      </javac>
-   </target>
-
-   <target name="ejbjar" depends="compile">
-      <jar jarfile="build/tutorial.jar">
-         <fileset dir="${build.classes.dir}">
-            <include name="**/*.class"/>
-         </fileset>
-         <fileset dir=".">
-            <include name="META-INF/*.xml"/>
-         </fileset>
-
-      </jar>
-      <copy file="build/tutorial.jar" todir="${jboss.home}/server/${jboss.server.config}/deploy"/>
-   </target>
-
-   <target name="run">
-      <java classname="org.jboss.tutorial.ejb21_client_adaptors.client.Client" fork="yes" dir=".">
-         <classpath refid="classpath"/>
-      </java>
-   </target>
-
-   <!-- =================================================================== -->
-   <!-- Cleans up generated stuff                                           -->
-   <!-- =================================================================== -->
-   <target name="clean.db">
-      <delete dir="${jboss.home}/server/${jboss.server.config}/data/hypersonic"/>
-   </target>
-
-   <target name="clean">
-      <delete dir="${build.dir}"/>
-      <delete file="${jboss.home}/server/${jboss.server.config}/deploy/tutorial.jar"/>
-   </target>
-
-
-</project>
-

Copied: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/build.xml (from rev 82620, projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors/build.xml)
===================================================================
--- projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/build.xml	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/build.xml	2009-01-06 11:42:34 UTC (rev 82625)
@@ -0,0 +1,85 @@
+<?xml version="1.0"?>
+
+<!-- ======================================================================= -->
+<!-- JBoss build file                                                       -->
+<!-- ======================================================================= -->
+
+<project name="JBoss" default="ejbjar" basedir=".">
+
+   <property environment="env"/>
+   <property name="src.dir" value="${basedir}/src"/>
+   <property name="jboss.home" value="${env.JBOSS_HOME}"/>
+   <property name="jboss.server.config" value="default"/>
+   <property name="build.dir" value="${basedir}/build"/>
+   <property name="build.classes.dir" value="${build.dir}/classes"/>
+   <property name="build.artifact" value="jboss-ejb3-tutorial-ejb21_client_adaptors.jar"/>
+
+   <!-- Build classpath -->
+   <path id="classpath">
+      <!-- So that we can get jndi.properties for InitialContext -->
+      <pathelement location="${basedir}"/>
+   		<!-- Only the jbossall-client.jar should ideally be sufficient -->
+      <fileset dir="${jboss.home}/client">
+         <include name="**/jbossall-client.jar"/>
+      </fileset>
+      <pathelement location="${build.classes.dir}"/>
+   </path>
+
+   <property name="build.classpath" refid="classpath"/>
+
+   <!-- =================================================================== -->
+   <!-- Prepares the build directory                                        -->
+   <!-- =================================================================== -->
+   <target name="prepare">
+      <mkdir dir="${build.dir}"/>
+      <mkdir dir="${build.classes.dir}"/>
+   </target>
+
+   <!-- =================================================================== -->
+   <!-- Compiles the source code                                            -->
+   <!-- =================================================================== -->
+   <target name="compile" depends="prepare">
+      <javac srcdir="${src.dir}"
+         destdir="${build.classes.dir}"
+         debug="on"
+         deprecation="on"
+         optimize="off"
+         includes="**">
+         <classpath refid="classpath"/>
+      </javac>
+   </target>
+
+   <target name="ejbjar" depends="compile">
+      <jar jarfile="build/${build.artifact}">
+         <fileset dir="${build.classes.dir}">
+            <include name="**/*.class"/>
+         </fileset>
+         <fileset dir=".">
+            <include name="META-INF/*.xml"/>
+         </fileset>
+
+      </jar>
+      <copy file="build/${build.artifact}" todir="${jboss.home}/server/${jboss.server.config}/deploy"/>
+   </target>
+
+   <target name="run">
+      <java classname="org.jboss.tutorial.ejb21_client_adaptors.client.Client" fork="yes" dir=".">
+         <classpath refid="classpath"/>
+      </java>
+   </target>
+
+   <!-- =================================================================== -->
+   <!-- Cleans up generated stuff                                           -->
+   <!-- =================================================================== -->
+   <target name="clean.db">
+      <delete dir="${jboss.home}/server/${jboss.server.config}/data/hypersonic"/>
+   </target>
+
+   <target name="clean">
+      <delete dir="${build.dir}"/>
+      <delete file="${jboss.home}/server/${jboss.server.config}/deploy/${build.artifact}"/>
+   </target>
+
+
+</project>
+

Deleted: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.html
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.html	2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.html	2009-01-06 11:42:34 UTC (rev 82625)
@@ -1,51 +0,0 @@
-<html>
-<body>
-<p>
-<h2>EJB 2.1 Client Adaptors</h2>
-
-EJB 3.0 is backward compatible to EJB 2.x clients and supports the use of local and remote home interfaces as well as 
-initialization methods (e.g. ejbCreate()). This capability is configured through annotations and/or through deployment 
-descriptors. Take a look at <a href="src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session1Bean.java">Session1Bean.java</a>. Note
-that the class is annotated with <tt>@RemoteHome</tt> and the ejbCreate() method is annotated with <tt>@Init</tt>. The former 
-annotation indicates that the bean provides a EJB 2.1 style home interface. The latter annotation indicates that when the create()
-method is invoked from the home interface, the bean is initialized via the ejbCreate method. Note that the initializion method name
-is not restricted to ejbCreate().
-</p><p>
-<a href="src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2Bean.java">Session2Bean.java</a> illustrates the use of a
-local home interface.
-</p><p>
-Similiarly, <a href="src/org/jboss/tutorial/ejb21_client_adaptors/bean/DeploymentDescriptorSession1Bean.java">DeploymentDescriptorSession1Bean.java</a> and 
-<a href="src/org/jboss/tutorial/ejb21_client_adaptors/bean/DeploymentDescriptorSession2Bean.java">DeploymentDescriptorSession2Bean.java</a>
-mimic the behavior of the first two beans, but use deployment descriptors to indicate the home interface(s) and initialization method(s).
-</p><p>
-Take a look at <a href="META-INF/ejb-jar.xml">ejb-jar.xml</a>. Note the "home" and "local-home" tags that indicate the respective home interfaces.
-Also, note the "init-list" tag that indicates the initialization method(s) executed when beans are created via the home interface(s).
-</p><p>
-<h4>Building and Running</h4>
-
-To build and run the example, make sure you have <tt>ejb3.deployer</tt> installed in JBoss 4.0.x and have JBoss running.  See the reference manual on how to install EJB 3.0.  
-<pre>
-Unix:    $ export JBOSS_HOME=&lt;where your jboss 4.0 distribution is&gt;
-Windows: $ set JBOSS_HOME=&lt;where your jboss 4.0 distribution is&gt;
-$ ant
-$ ant run
-
-run:
-     [java] Session1 init value is initialized
-     [java] Session2 init value is initialized
-     [java] DeploymentDescriptor Session1 init value is initialized
-     [java] DeploymentDescriptor Session2 init value is initialized
-</pre>
-</p><p>
-The INFO message you can ignore.  It will be fixed in later releases of JBoss 4.0.
-</p><p>
-<h4>Jar structure</h4>
-
-EJB 3.0 beans must be packaged in a JAR file with the suffix <tt>.jar</tt>.  Running the ant script above creates a JAR file within the deploy/ directory of JBoss.  All that needs to be in that jar is your server-side class files.  So basically just the CalculatorBean and the interfaces it implements.  JBoss will automatically browse the JAR file to determine if any EJBs are annotated by any classes within it.  THere is no precompilation step.
-</p><p>
-</p><p>
-</p><p>
-</p><p>
-</p>
-</body>
-</html>

Copied: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.html (from rev 82620, projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.html)
===================================================================
--- projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.html	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.html	2009-01-06 11:42:34 UTC (rev 82625)
@@ -0,0 +1,51 @@
+<html>
+<body>
+<p>
+<h2>EJB 2.1 Client Adaptors</h2>
+
+EJB 3.0 is backward compatible to EJB 2.x clients and supports the use of local and remote home interfaces as well as 
+initialization methods (e.g. ejbCreate()). This capability is configured through annotations and/or through deployment 
+descriptors. Take a look at <a href="src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session1Bean.java">Session1Bean.java</a>. Note
+that the class is annotated with <tt>@RemoteHome</tt> and the ejbCreate() method is annotated with <tt>@Init</tt>. The former 
+annotation indicates that the bean provides a EJB 2.1 style home interface. The latter annotation indicates that when the create()
+method is invoked from the home interface, the bean is initialized via the ejbCreate method. Note that the initializion method name
+is not restricted to ejbCreate().
+</p><p>
+<a href="src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2Bean.java">Session2Bean.java</a> illustrates the use of a
+local home interface.
+</p><p>
+Similiarly, <a href="src/org/jboss/tutorial/ejb21_client_adaptors/bean/DeploymentDescriptorSession1Bean.java">DeploymentDescriptorSession1Bean.java</a> and 
+<a href="src/org/jboss/tutorial/ejb21_client_adaptors/bean/DeploymentDescriptorSession2Bean.java">DeploymentDescriptorSession2Bean.java</a>
+mimic the behavior of the first two beans, but use deployment descriptors to indicate the home interface(s) and initialization method(s).
+</p><p>
+Take a look at <a href="META-INF/ejb-jar.xml">ejb-jar.xml</a>. Note the "home" and "local-home" tags that indicate the respective home interfaces.
+Also, note the "init-list" tag that indicates the initialization method(s) executed when beans are created via the home interface(s).
+</p><p>
+<h4>Building and Running</h4>
+
+To build and run the example, make sure you have <tt>ejb3.deployer</tt> installed in JBoss 4.0.x and have JBoss running.  See the reference manual on how to install EJB 3.0.  
+<pre>
+Unix:    $ export JBOSS_HOME=&lt;where your jboss 4.0 distribution is&gt;
+Windows: $ set JBOSS_HOME=&lt;where your jboss 4.0 distribution is&gt;
+$ ant
+$ ant run
+
+run:
+     [java] Session1 init value is initialized
+     [java] Session2 init value is initialized
+     [java] DeploymentDescriptor Session1 init value is initialized
+     [java] DeploymentDescriptor Session2 init value is initialized
+</pre>
+</p><p>
+The INFO message you can ignore.  It will be fixed in later releases of JBoss 4.0.
+</p><p>
+<h4>Jar structure</h4>
+
+EJB 3.0 beans must be packaged in a JAR file with the suffix <tt>.jar</tt>.  Running the ant script above creates a JAR file within the deploy/ directory of JBoss.  All that needs to be in that jar is your server-side class files.  So basically just the CalculatorBean and the interfaces it implements.  JBoss will automatically browse the JAR file to determine if any EJBs are annotated by any classes within it.  THere is no precompilation step.
+</p><p>
+</p><p>
+</p><p>
+</p><p>
+</p>
+</body>
+</html>

Deleted: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.wiki
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.wiki	2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.wiki	2009-01-06 11:42:34 UTC (rev 82625)
@@ -1,42 +0,0 @@
-!!!EJB 2.1 Client Adaptors
-EJB 3.0 is backward compatible to EJB 2.x clients and supports the use of local and remote home interfaces as well as 
-initialization methods (e.g. ejbCreate()). This capability is configured through annotations and/or through deployment 
-descriptors. Take a look at [Session1Bean.java|src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session1Bean.java]. Note
-that the class is annotated with {{@RemoteHome}} and the ejbCreate() method is annotated with {{@Init}}. The former 
-annotation indicates that the bean provides a EJB 2.1 style home interface. The latter annotation indicates that when the create()
-method is invoked from the home interface, the bean is initialized via the ejbCreate method. Note that the initializion method name
-is not restricted to ejbCreate().
-
-[Session2Bean.java|src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2Bean.java] illustrates the use of a
-local home interface.
-
-Similiarly, [DeploymentDescriptorSession1Bean.java|src/org/jboss/tutorial/ejb21_client_adaptors/bean/DeploymentDescriptorSession1Bean.java] and 
-[DeploymentDescriptorSession2Bean.java|src/org/jboss/tutorial/ejb21_client_adaptors/bean/DeploymentDescriptorSession2Bean.java]
-mimic the behavior of the first two beans, but use deployment descriptors to indicate the home interface(s) and initialization method(s).
-
-Take a look at [ejb-jar.xml|META-INF/ejb-jar.xml]. Note the "home" and "local-home" tags that indicate the respective home interfaces.
-Also, note the "init-list" tag that indicates the initialization method(s) executed when beans are created via the home interface(s).
-
-!Building and Running
-To build and run the example, make sure you have {{ejb3.deployer}} installed in JBoss 4.0.x and have JBoss running.  See the reference manual on how to install EJB 3.0.  
-{{{
-Unix:    $ export JBOSS_HOME=<where your jboss 4.0 distribution is>
-Windows: $ set JBOSS_HOME=<where your jboss 4.0 distribution is>
-$ ant
-$ ant run
-
-run:
-     [java] Session1 init value is initialized
-     [java] Session2 init value is initialized
-     [java] DeploymentDescriptor Session1 init value is initialized
-     [java] DeploymentDescriptor Session2 init value is initialized
-}}}
-
-The INFO message you can ignore.  It will be fixed in later releases of JBoss 4.0.
-
-!Jar structure
-EJB 3.0 beans must be packaged in a JAR file with the suffix {{.jar}}.  Running the ant script above creates a JAR file within the deploy/ directory of JBoss.  All that needs to be in that jar is your server-side class files.  So basically just the CalculatorBean and the interfaces it implements.  JBoss will automatically browse the JAR file to determine if any EJBs are annotated by any classes within it.  THere is no precompilation step.
-
-
-
-

Copied: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.wiki (from rev 82620, projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.wiki)
===================================================================
--- projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.wiki	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/ejb21_client_adaptors.wiki	2009-01-06 11:42:34 UTC (rev 82625)
@@ -0,0 +1,42 @@
+!!!EJB 2.1 Client Adaptors
+EJB 3.0 is backward compatible to EJB 2.x clients and supports the use of local and remote home interfaces as well as 
+initialization methods (e.g. ejbCreate()). This capability is configured through annotations and/or through deployment 
+descriptors. Take a look at [Session1Bean.java|src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session1Bean.java]. Note
+that the class is annotated with {{@RemoteHome}} and the ejbCreate() method is annotated with {{@Init}}. The former 
+annotation indicates that the bean provides a EJB 2.1 style home interface. The latter annotation indicates that when the create()
+method is invoked from the home interface, the bean is initialized via the ejbCreate method. Note that the initializion method name
+is not restricted to ejbCreate().
+
+[Session2Bean.java|src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2Bean.java] illustrates the use of a
+local home interface.
+
+Similiarly, [DeploymentDescriptorSession1Bean.java|src/org/jboss/tutorial/ejb21_client_adaptors/bean/DeploymentDescriptorSession1Bean.java] and 
+[DeploymentDescriptorSession2Bean.java|src/org/jboss/tutorial/ejb21_client_adaptors/bean/DeploymentDescriptorSession2Bean.java]
+mimic the behavior of the first two beans, but use deployment descriptors to indicate the home interface(s) and initialization method(s).
+
+Take a look at [ejb-jar.xml|META-INF/ejb-jar.xml]. Note the "home" and "local-home" tags that indicate the respective home interfaces.
+Also, note the "init-list" tag that indicates the initialization method(s) executed when beans are created via the home interface(s).
+
+!Building and Running
+To build and run the example, make sure you have {{ejb3.deployer}} installed in JBoss 4.0.x and have JBoss running.  See the reference manual on how to install EJB 3.0.  
+{{{
+Unix:    $ export JBOSS_HOME=<where your jboss 4.0 distribution is>
+Windows: $ set JBOSS_HOME=<where your jboss 4.0 distribution is>
+$ ant
+$ ant run
+
+run:
+     [java] Session1 init value is initialized
+     [java] Session2 init value is initialized
+     [java] DeploymentDescriptor Session1 init value is initialized
+     [java] DeploymentDescriptor Session2 init value is initialized
+}}}
+
+The INFO message you can ignore.  It will be fixed in later releases of JBoss 4.0.
+
+!Jar structure
+EJB 3.0 beans must be packaged in a JAR file with the suffix {{.jar}}.  Running the ant script above creates a JAR file within the deploy/ directory of JBoss.  All that needs to be in that jar is your server-side class files.  So basically just the CalculatorBean and the interfaces it implements.  JBoss will automatically browse the JAR file to determine if any EJBs are annotated by any classes within it.  THere is no precompilation step.
+
+
+
+

Deleted: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/jndi.properties
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors/jndi.properties	2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/jndi.properties	2009-01-06 11:42:34 UTC (rev 82625)
@@ -1,3 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
-java.naming.provider.url=localhost

Copied: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/jndi.properties (from rev 82620, projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors/jndi.properties)
===================================================================
--- projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/jndi.properties	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/jndi.properties	2009-01-06 11:42:34 UTC (rev 82625)
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+java.naming.provider.url=localhost

Deleted: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/log4j.xml
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors/log4j.xml	2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/log4j.xml	2009-01-06 11:42:34 UTC (rev 82625)
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  Log4j Configuration                                                  -->
-<!--                                                                       -->
-<!-- ===================================================================== -->
-
-<!-- $Id$ -->
-
-<!--
-   | For more configuration infromation and examples see the Jakarta Log4j
-   | owebsite: http://jakarta.apache.org/log4j
- -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-   
-<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
-      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-      <param name="Target" value="System.out"/>
-      <param name="Threshold" value="INFO"/>
-
-      <layout class="org.apache.log4j.PatternLayout">
-         <!-- The default pattern: Date Priority [Category] Messagen -->
-         <!--
-         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
-         -->
-         <param name="ConversionPattern" value="%-5p %d{dd-MM HH:mm:ss,SSS} (%F:%M:%L)  -%m%n"/>
-      </layout>
-</appender>
-
-   <root>
-      <appender-ref ref="CONSOLE"/>
-   </root>
-
-</log4j:configuration>

Copied: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/log4j.xml (from rev 82620, projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors/log4j.xml)
===================================================================
--- projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/log4j.xml	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/log4j.xml	2009-01-06 11:42:34 UTC (rev 82625)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id$ -->
+
+<!--
+   | For more configuration infromation and examples see the Jakarta Log4j
+   | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+   
+<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Messagen -->
+         <!--
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+         -->
+         <param name="ConversionPattern" value="%-5p %d{dd-MM HH:mm:ss,SSS} (%F:%M:%L)  -%m%n"/>
+      </layout>
+</appender>
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+   </root>
+
+</log4j:configuration>

Added: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/pom.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/pom.xml	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/pom.xml	2009-01-06 11:42:34 UTC (rev 82625)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<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">
+
+
+
+
+
+	<!-- Model Version -->
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.jboss.ejb3</groupId>
+		<artifactId>jboss-ejb3-tutorial-common</artifactId>
+		<version>0.1.0-SNAPSHOT</version>
+		<relativePath>../common/</relativePath>
+	</parent>
+
+	<properties>
+		<ejb3.tutorial.client>org.jboss.tutorial.ejb21_client_adaptors.client.Client</ejb3.tutorial.client>
+	</properties>
+
+
+	<artifactId>jboss-ejb3-tutorial-ejb21_client_adaptors</artifactId>
+	<version>0.1.0-SNAPSHOT</version>
+	<packaging>jar</packaging>
+	<name>EJB2.1 style clients with EJB3</name>
+	<url>http://labs.jboss.com/jbossejb3/</url>
+	<description>
+    Tutorial about EJB2.1 style clients using EJB3
+  </description>
+
+
+
+</project>


Property changes on: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/pom.xml
___________________________________________________________________
Name: svn:executable
   + *

Copied: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/src (from rev 82620, projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors/src)

Modified: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session1Bean.java
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors/src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session1Bean.java	2009-01-06 03:19:19 UTC (rev 82620)
+++ projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session1Bean.java	2009-01-06 11:42:34 UTC (rev 82625)
@@ -21,51 +21,50 @@
  */
 package org.jboss.tutorial.ejb21_client_adaptors.bean;
 
-import javax.naming.*;
 import javax.ejb.EJB;
 import javax.ejb.EJBs;
-import javax.ejb.Remote;
-import javax.ejb.Stateful;
 import javax.ejb.Init;
 import javax.ejb.RemoteHome;
+import javax.ejb.Stateful;
+import javax.naming.InitialContext;
 
-import org.jboss.annotation.ejb.RemoteBinding;
 import org.jboss.ejb3.Container;
 import org.jboss.logging.Logger;
 
 /**
  * @version <tt>$Revision$</tt>
  * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @author Jaikiran Pai
  */
- at Stateful(name="Session1")
- at Remote(Session1Remote.class)
+ at Stateful(name = "Session1")
 @RemoteHome(Session1RemoteHome.class)
- at RemoteBinding(jndiBinding = "Session1Remote")
- at EJBs({@EJB(name="session2", beanInterface=org.jboss.tutorial.ejb21_client_adaptors.bean.Session2LocalHome.class, beanName="Session2")})
-public class Session1Bean 
+ at EJBs(
+{@EJB(name = "session2", beanInterface = org.jboss.tutorial.ejb21_client_adaptors.bean.Session2LocalHome.class, beanName = "Session2")})
+public class Session1Bean
 {
    private static final Logger log = Logger.getLogger(Session1Bean.class);
-   
+
    private String initValue = null;
-   
+
    public String getInitValue()
    {
       return initValue;
    }
-   
+
    public String getLocalSession2InitValue() throws Exception
    {
       InitialContext jndiContext = new InitialContext();
       Object s = jndiContext.lookup(Container.ENC_CTX_NAME + "/env/session2");
-      Session2LocalHome home = (Session2LocalHome)jndiContext.lookup(Container.ENC_CTX_NAME + "/env/session2");
+      Session2LocalHome home = (Session2LocalHome) jndiContext.lookup(Container.ENC_CTX_NAME + "/env/session2");
       Session2Local session2 = home.create("initialized");
       return session2.getInitValue();
    }
-   
+
    @Init
    public void ejbCreate()
    {
       initValue = "initialized";
+      log.info("ejbCreate() of " + this.getClass() + " called");
    }
-   
+
 }

Modified: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2Bean.java
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors/src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2Bean.java	2009-01-06 03:19:19 UTC (rev 82620)
+++ projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2Bean.java	2009-01-06 11:42:34 UTC (rev 82625)
@@ -21,37 +21,35 @@
  */
 package org.jboss.tutorial.ejb21_client_adaptors.bean;
 
-import javax.ejb.Stateful;
-import javax.ejb.Local;
 import javax.ejb.Init;
 import javax.ejb.LocalHome;
+import javax.ejb.Stateful;
 
-import org.jboss.annotation.ejb.LocalBinding;
 import org.jboss.logging.Logger;
 
 /**
  * @version <tt>$Revision$</tt>
  * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @author Jaikiran Pai
  */
- at Stateful(name="Session2")
- at Local(Session2Local.class)
+ at Stateful(name = "Session2")
 @LocalHome(Session2LocalHome.class)
- at LocalBinding(jndiBinding = "Session2Local")
-public class Session2Bean 
+public class Session2Bean
 {
    private static final Logger log = Logger.getLogger(Session2Bean.class);
-   
+
    private String initValue = null;
-   
+
    public String getInitValue()
    {
       return initValue;
    }
-   
+
    @Init
    public void ejbCreate(String initValue)
    {
       this.initValue = initValue;
+      log.info("ejbCreate() of " + this.getClass() + " called with initValue= " + initValue);
    }
-   
+
 }

Modified: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2Local.java
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors/src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2Local.java	2009-01-06 03:19:19 UTC (rev 82620)
+++ projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2Local.java	2009-01-06 11:42:34 UTC (rev 82625)
@@ -21,14 +21,13 @@
  */
 package org.jboss.tutorial.ejb21_client_adaptors.bean;
 
-import javax.ejb.EJBObject;
+import javax.ejb.EJBLocalObject;
 
 /**
  * @version <tt>$Revision$</tt>
  * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
  */
-public interface Session2Local extends EJBObject
+public interface Session2Local extends EJBLocalObject
 {
    String getInitValue();
 }
-

Modified: projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2LocalHome.java
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/ejb21_client_adaptors/src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2LocalHome.java	2009-01-06 03:19:19 UTC (rev 82620)
+++ projects/ejb3/trunk/docs/tutorial/ejb21_client_adaptors/src/org/jboss/tutorial/ejb21_client_adaptors/bean/Session2LocalHome.java	2009-01-06 11:42:34 UTC (rev 82625)
@@ -28,7 +28,7 @@
  * @version <tt>$Revision$</tt>
  * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
  */
-public interface Session2LocalHome extends EJBHome {
+public interface Session2LocalHome extends EJBLocalHome {
     
   public Session2Local create(String initValue) throws java.rmi.RemoteException, javax.ejb.CreateException;
 } 




More information about the jboss-cvs-commits mailing list