[jboss-cvs] JBossAS SVN: r82107 - in projects/ejb3/trunk: docs and 9 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Dec 8 05:29:49 EST 2008


Author: jaikiran
Date: 2008-12-08 05:29:49 -0500 (Mon, 08 Dec 2008)
New Revision: 82107

Added:
   projects/ejb3/trunk/docs/
   projects/ejb3/trunk/docs/tutorial/
   projects/ejb3/trunk/docs/tutorial/build.xml
   projects/ejb3/trunk/docs/tutorial/stateless/
   projects/ejb3/trunk/docs/tutorial/stateless/build.xml
   projects/ejb3/trunk/docs/tutorial/stateless/jndi.properties
   projects/ejb3/trunk/docs/tutorial/stateless/log4j.xml
   projects/ejb3/trunk/docs/tutorial/stateless/pom.xml
   projects/ejb3/trunk/docs/tutorial/stateless/src/
   projects/ejb3/trunk/docs/tutorial/stateless/src/org/
   projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/
   projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/
   projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/
   projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/
   projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/Calculator.java
   projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/CalculatorBean.java
   projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/CalculatorLocal.java
   projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/CalculatorRemote.java
   projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/client/
   projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/client/Client.java
   projects/ejb3/trunk/docs/tutorial/stateless/stateless.html
   projects/ejb3/trunk/docs/tutorial/stateless/stateless.wiki
Log:
EJB3.0 Tutorials.

The initial working "stateless" tutorial.

Added: projects/ejb3/trunk/docs/tutorial/build.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/build.xml	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/build.xml	2008-12-08 10:29:49 UTC (rev 82107)
@@ -0,0 +1,379 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE project [
+]>
+
+<!-- ====================================================================== -->
+<!--                                                                        -->
+<!--  JBoss, the OpenSource J2EE webOS                                      -->
+<!--                                                                        -->
+<!--  Distributable under LGPL license.                                     -->
+<!--  See terms of license at http://www.gnu.org.                           -->
+<!--                                                                        -->
+<!-- ====================================================================== -->
+
+<project default="main" name="JBoss/EJB3 Tutorials">
+
+	<target name="main">
+		<antcall target="asynch" inheritRefs="true"/>
+		<antcall target="blob" inheritRefs="true"/>
+		<antcall target="callbacks" inheritRefs="true"/>
+		<antcall target="clusteredentity" inheritRefs="true"/>
+		<!--antcall target="clustering" inheritRefs="true"/-->
+		<antcall target="composite" inheritRefs="true"/>
+		<antcall target="consumer" inheritRefs="true"/>
+		<antcall target="consumer_deployment_descriptor" inheritRefs="true"/>
+		<antcall target="dependency" inheritRefs="true"/>
+		<antcall target="dependent" inheritRefs="true"/>
+		<antcall target="ear" inheritRefs="true"/>
+		<antcall target="ejb21_client_adaptors" inheritRefs="true"/>
+		<antcall target="entity" inheritRefs="true"/>
+		<antcall target="extended_pc" inheritRefs="true"/>
+		<antcall target="injection" inheritRefs="true"/>
+		<antcall target="interceptor" inheritRefs="true"/>
+		<antcall target="jboss_deployment_descriptor" inheritRefs="true"/>
+		<!--antcall target="jca/inflow/swiftmq" inheritRefs="true"/-->
+		<antcall target="jndibinding" inheritRefs="true"/>
+		<antcall target="joininheritance" inheritRefs="true"/>
+		<antcall target="mdb" inheritRefs="true"/>
+		<antcall target="jndibinding" inheritRefs="true"/>
+		<antcall target="merge" inheritRefs="true"/>
+		<antcall target="packaging" inheritRefs="true"/>
+		<antcall target="relationships" inheritRefs="true"/>
+		<antcall target="secondary" inheritRefs="true"/>
+		<antcall target="security" inheritRefs="true"/>
+		<antcall target="service" inheritRefs="true"/>
+		<antcall target="service_deployment_descriptor" inheritRefs="true"/>
+		<antcall target="singleinheritance" inheritRefs="true"/>
+		<antcall target="stateful" inheritRefs="true"/>
+		<antcall target="stateful_deployment_descriptor" inheritRefs="true"/>
+		<antcall target="stateless" inheritRefs="true"/>
+		<antcall target="stateless_deployment_descriptor" inheritRefs="true"/>
+		<antcall target="tableperinheritance" inheritRefs="true"/>
+		<antcall target="timer" inheritRefs="true"/>
+	</target>
+
+	<target name="asynch"> 
+		<echo message="---------------- Running asynch ------------"/>     
+		<ant dir="asynch" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="asynch" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="asynch" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="blob">       
+		<echo message="---------------- Running blob ------------"/>
+		<ant dir="blob" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="blob" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="blob" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="callbacks">     
+		<echo message="---------------- Running callbacks ------------"/>  
+		<ant dir="callbacks" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="callbacks" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="callbacks" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="clusteredentity">  
+		<echo message="---------------- Running clusteredentity ------------"/>     
+		<ant dir="clusteredentity" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="clusteredentity" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="clusteredentity" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="clustering">     
+		<echo message="---------------- Running clustering ------------"/>  
+		<ant dir="clustering" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="clustering" antfile="build.xml" target="run.stateless"/>
+		<ant dir="clustering" antfile="build.xml" target="run.stateful"/>
+		<sleep seconds="4"/>
+		<ant dir="clustering" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="composite">   
+		<echo message="---------------- Running composite ------------"/>    
+		<ant dir="composite" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="composite" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="composite" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="consumer">   
+		<echo message="---------------- Running consumer ------------"/>    
+		<ant dir="consumer" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="consumer" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="consumer" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="consumer_deployment_descriptor">   
+		<echo message="---------------- Running consumer_deployment_descriptor ------------"/>    
+		<ant dir="consumer_deployment_descriptor" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="consumer_deployment_descriptor" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="consumer_deployment_descriptor" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="dependency">       
+		<echo message="---------------- Running dependency ------------"/>
+		<ant dir="dependency" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="dependency" antfile="build.xml" target="run"/>
+		<ant dir="dependency" antfile="build.xml" target="deploy-dependency"/>
+		<sleep seconds="4"/>
+		<ant dir="dependency" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="dependent">    
+		<echo message="---------------- Running dependent ------------"/>   
+		<ant dir="dependent" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="dependent" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="dependent" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="ear">      
+		<echo message="---------------- Running ear ------------"/> 
+		<ant dir="ear" antfile="build.xml"/>
+		<sleep seconds="4"/>
+		<ant dir="ear" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="ejb21_client_adaptors"> 
+		<echo message="---------------- Running ejb21_client_adaptors ------------"/>      
+		<ant dir="ejb21_client_adaptors" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="ejb21_client_adaptors" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="ejb21_client_adaptors" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="entity">       
+		<echo message="---------------- Running entity ------------"/>
+		<ant dir="entity" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="entity" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="entity" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="extended_pc">       
+		<echo message="---------------- Running extended_pc ------------"/>
+		<ant dir="extended_pc" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="extended_pc" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="extended_pc" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="injection">       
+		<echo message="---------------- Running injection ------------"/>
+		<ant dir="injection" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="injection" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="injection" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="interceptor">   
+		<echo message="---------------- Running interceptor ------------"/>    
+		<ant dir="interceptor" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="interceptor" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="interceptor" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="jboss_deployment_descriptor"> 
+		<echo message="---------------- Running jboss_deployment_descriptor ------------"/>      
+		<ant dir="jboss_deployment_descriptor" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="jboss_deployment_descriptor" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="jboss_deployment_descriptor" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="jca/inflow/swiftmq">    
+		<echo message="---------------- Running jca/inflow/swiftmq ------------"/>   
+		<ant dir="jca/inflow/swiftmq" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="jca/inflow/swiftmq" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="jca/inflow/swiftmq" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="jndibinding">  
+		<echo message="---------------- Running jndibinding ------------"/>     
+		<ant dir="jndibinding" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="jndibinding" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="jndibinding" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="joininheritance">    
+		<echo message="---------------- Running joininheritance ------------"/>   
+		<ant dir="joininheritance" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="joininheritance" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="joininheritance" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="mdb">      
+		<echo message="---------------- Running mdb ------------"/> 
+		<ant dir="mdb" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="mdb" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="mdb" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="mdb_deployment_descriptor"> 
+		<echo message="---------------- Running mdb_deployment_descriptor ------------"/>      
+		<ant dir="mdb_deployment_descriptor" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="mdb_deployment_descriptor" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="mdb_deployment_descriptor" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="merge">       
+		<echo message="---------------- Running merge ------------"/>
+		<ant dir="merge" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="merge" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="merge" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="packaging">   
+		<echo message="---------------- Running packaging ------------"/>    
+		<ant dir="packaging" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="packaging" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="packaging" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="relationships">  
+		<echo message="---------------- Running relationships ------------"/>     
+		<ant dir="relationships" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="relationships" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="relationships" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="secondary">   
+		<echo message="---------------- Running secondary ------------"/>    
+		<ant dir="secondary" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="secondary" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="secondary" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="security"> 
+		<echo message="---------------- Running security ------------"/>      
+		<ant dir="security" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="security" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="security" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="service"> 
+		<echo message="---------------- Running service ------------"/>      
+		<ant dir="service" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="service" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="service" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="service_deployment_descriptor">   
+		<echo message="---------------- Running service_deployment_descriptor ------------"/>    
+		<ant dir="service_deployment_descriptor" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="service_deployment_descriptor" antfile="build.xml" target="run"/>	
+		<sleep seconds="4"/>
+		<ant dir="service_deployment_descriptor" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="singleinheritance">  
+		<echo message="---------------- Running singleinheritance ------------"/>     
+		<ant dir="singleinheritance" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="singleinheritance" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="singleinheritance" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="stateful">    
+		<echo message="---------------- Running stateful ------------"/>   
+		<ant dir="stateful" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="stateful" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="stateful" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="stateful_deployment_descriptor"> 
+		<echo message="---------------- Running stateful_deployment_descriptor ------------"/>      
+		<ant dir="stateful_deployment_descriptor" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="stateful_deployment_descriptor" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="stateful_deployment_descriptor" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="stateless">       
+		<echo message="---------------- Running stateless ------------"/>
+		<ant dir="stateless" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="stateless" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="stateless" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="stateless_deployment_descriptor">     
+		<echo message="---------------- Running stateless_deployment_descriptor ------------"/>  
+		<ant dir="stateless_deployment_descriptor" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="stateless_deployment_descriptor" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="stateless_deployment_descriptor" antfile="build.xml" target="clean"/>
+	</target>
+	
+	<target name="tableperinheritance">       
+		<echo message="---------------- Running tableperinheritance ------------"/>
+		<ant dir="tableperinheritance" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="tableperinheritance" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="tableperinheritance" antfile="build.xml" target="clean"/>
+	</target>
+
+	<target name="timer">    
+		<echo message="---------------- Running timer ------------"/>   
+		<ant dir="timer" antfile="build.xml"/>
+		<sleep seconds="5"/>
+		<ant dir="timer" antfile="build.xml" target="run"/>
+		<sleep seconds="4"/>
+		<ant dir="timer" antfile="build.xml" target="clean"/>
+	</target>
+
+</project>


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

Added: projects/ejb3/trunk/docs/tutorial/stateless/build.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/stateless/build.xml	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/stateless/build.xml	2008-12-08 10:29:49 UTC (rev 82107)
@@ -0,0 +1,81 @@
+<?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-stateless.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>
+      </jar>
+      <copy file="build/${build.artifact}" todir="${jboss.home}/server/${jboss.server.config}/deploy"/>
+   </target>
+
+   <target name="run" depends="ejbjar">
+      <java classname="org.jboss.tutorial.stateless.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>
+


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

Added: projects/ejb3/trunk/docs/tutorial/stateless/jndi.properties
===================================================================
--- projects/ejb3/trunk/docs/tutorial/stateless/jndi.properties	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/stateless/jndi.properties	2008-12-08 10:29:49 UTC (rev 82107)
@@ -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


Property changes on: projects/ejb3/trunk/docs/tutorial/stateless/jndi.properties
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/ejb3/trunk/docs/tutorial/stateless/log4j.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/stateless/log4j.xml	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/stateless/log4j.xml	2008-12-08 10:29:49 UTC (rev 82107)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml 32809 2005-06-24 04:49:29Z bill $ -->
+
+<!--
+   | 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>


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

Added: projects/ejb3/trunk/docs/tutorial/stateless/pom.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/stateless/pom.xml	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/stateless/pom.xml	2008-12-08 10:29:49 UTC (rev 82107)
@@ -0,0 +1,38 @@
+<?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-parent</artifactId>
+    <version>0.1.0-SNAPSHOT</version>
+  </parent>
+
+  <properties>
+    <ejb3.tutorial.client>org.jboss.tutorial.stateless.client.Client</ejb3.tutorial.client>
+  </properties>
+
+
+  <artifactId>jboss-ejb3-tutorial-stateless</artifactId>
+  <version>0.1.0-SNAPSHOT</version>
+  <packaging>jar</packaging>
+  <name>EJB3.0 Stateless Bean Tutorial</name>
+  <url>http://labs.jboss.com/jbossejb3/</url>
+  <description>
+    Tutorial for Stateless EJB 3.0
+  </description>
+  
+  
+  
+  
+
+
+</project>

Added: projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/Calculator.java
===================================================================
--- projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/Calculator.java	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/Calculator.java	2008-12-08 10:29:49 UTC (rev 82107)
@@ -0,0 +1,29 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.tutorial.stateless.bean;
+
+public interface Calculator
+{
+   int add(int x, int y);
+
+   int subtract(int x, int y);
+}


Property changes on: projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/Calculator.java
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/CalculatorBean.java
===================================================================
--- projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/CalculatorBean.java	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/CalculatorBean.java	2008-12-08 10:29:49 UTC (rev 82107)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.tutorial.stateless.bean;
+
+import javax.ejb.Stateless;
+import javax.sql.DataSource;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+ at Stateless
+public class CalculatorBean implements CalculatorRemote, CalculatorLocal
+{
+   public int add(int x, int y)
+   {
+      try
+      {
+         DataSource ds = (DataSource)new InitialContext().lookup("java:/DefaultDS");
+      }
+      catch (NamingException e)
+      {
+         throw new RuntimeException(e);
+      }
+      return x + y;
+   }
+
+   public int subtract(int x, int y)
+   {
+      return x - y;
+   }
+}


Property changes on: projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/CalculatorBean.java
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/CalculatorLocal.java
===================================================================
--- projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/CalculatorLocal.java	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/CalculatorLocal.java	2008-12-08 10:29:49 UTC (rev 82107)
@@ -0,0 +1,30 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.tutorial.stateless.bean;
+
+import javax.ejb.Local;
+
+
+ at Local
+public interface CalculatorLocal extends Calculator
+{
+}


Property changes on: projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/CalculatorLocal.java
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/CalculatorRemote.java
===================================================================
--- projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/CalculatorRemote.java	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/CalculatorRemote.java	2008-12-08 10:29:49 UTC (rev 82107)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.tutorial.stateless.bean;
+
+import javax.ejb.Remote;
+
+
+ at Remote
+public interface CalculatorRemote extends Calculator
+{
+
+}


Property changes on: projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/bean/CalculatorRemote.java
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/client/Client.java
===================================================================
--- projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/client/Client.java	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/client/Client.java	2008-12-08 10:29:49 UTC (rev 82107)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.tutorial.stateless.client;
+
+import org.jboss.tutorial.stateless.bean.Calculator;
+import org.jboss.tutorial.stateless.bean.CalculatorRemote;
+
+import javax.naming.InitialContext;
+
+public class Client
+{
+   public static void main(String[] args) throws Exception
+   {
+      InitialContext ctx = new InitialContext();
+      Calculator calculator = (Calculator) ctx.lookup("CalculatorBean/remote");
+
+      System.out.println("1 + 1 = " + calculator.add(1, 1));
+      System.out.println("1 - 1 = " + calculator.subtract(1, 1));
+   }
+}


Property changes on: projects/ejb3/trunk/docs/tutorial/stateless/src/org/jboss/tutorial/stateless/client/Client.java
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/ejb3/trunk/docs/tutorial/stateless/stateless.html
===================================================================
--- projects/ejb3/trunk/docs/tutorial/stateless/stateless.html	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/stateless/stateless.html	2008-12-08 10:29:49 UTC (rev 82107)
@@ -0,0 +1,63 @@
+<html>
+<body>
+<p>
+<h2>Stateless Beans</h2>
+
+It is very easy to create a Stateless Bean with EJB 3.0.  All bean types are homeless in EJB 3.0 so all you have to do to
+create a Stateless bean is to create a bean class and have it implement at least one interface.
+Take a look at <a href="src/org/jboss/tutorial/stateless/bean/CalculatorBean.java">CalculatorBean.java</a>
+</p><p>
+The first thing to notice is that the class is tagged as <tt>@Stateless</tt>.  This marks the class as a stateless bean and
+the deployer will deploy that class as a stateless bean EJB container.
+</p><p>
+CalculatorBean also implements two interfaces.  One is the remote interface of the EJB the other is the local interface.
+</p><p>
+Take a look at <a href="src/org/jboss/tutorial/stateless/bean/CalculatorRemote.java">CalculatorRemote.java</a>.  To define this as the remote interface of Calculator bean
+you either annotate the bean class and specify what the remote interfaces are, or you annotate each remote interface the bean class
+implements with @javax.ejb.Remote. only need to annotate the bean class with @javax.ejb.Remote.  Similar for <a href="src/org/jboss/tutorial/stateless/bean/CalculatorLocal.java">CalculatorLocal.java</a> as you need to annotate the bean class with @javax.ejb.Local for it to be the local interface of the CalculatorBean.
+</p><p>
+<h4>JNDI Bindings</h4>
+
+The Calculator bean will have two JNDI bindings for the remote and Local interface.  By default, JBoss will use ejbName/local and ejbName/remote for the local and
+remote interfaces, respectively.
+</p><p>
+<h4>Client</h4>
+
+Open up <a href="src/org/jboss/tutorial/stateless/client/Client.java">Client.java</a>.  You'll see that it looks up the stateless bean under "ejbName/remote".
+Also notice that there is no Home interface and you can begin executing on the stateless bean right away.
+</p><p>
+<h4>Building and Running</h4>
+
+To build and run the example, make sure you have installed JBoss 5.x and have JBoss running.    
+<pre>
+Unix:    $ export JBOSS_HOME=&lt;where your jboss 5.x distribution is&gt;
+Windows: $ set JBOSS_HOME=&lt;where your jboss 5.x distribution is&gt;
+</pre>
+
+<b> Ant Users: </b>
+<pre>
+$ ant
+$ ant run
+
+run:
+     [java] 1 + 1 = 2
+     [java] 1 - 1 = 0
+</pre>
+
+<b> Maven Users: </b>
+<pre>
+$ mvn clean install
+TODO: This part needs to be fixed. In progress.
+$ mvn exec:exec
+</pre>
+
+<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>


Property changes on: projects/ejb3/trunk/docs/tutorial/stateless/stateless.html
___________________________________________________________________
Name: svn:executable
   + *

Added: projects/ejb3/trunk/docs/tutorial/stateless/stateless.wiki
===================================================================
--- projects/ejb3/trunk/docs/tutorial/stateless/stateless.wiki	                        (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/stateless/stateless.wiki	2008-12-08 10:29:49 UTC (rev 82107)
@@ -0,0 +1,54 @@
+!!!Stateless Beans
+It is very easy to create a Stateless Bean with EJB 3.0.  All bean types are homeless in EJB 3.0 so all you have to do to
+create a Stateless bean is to create a bean class and have it implement at least one interface.
+Take a look at [CalculatorBean.java|src/org/jboss/tutorial/stateless/bean/CalculatorBean.java]
+
+The first thing to notice is that the class is tagged as {{@Stateless}}.  This marks the class as a stateless bean and
+the deployer will deploy that class as a stateless bean EJB container.
+
+CalculatorBean also implements two interfaces.  One is the remote interface of the EJB the other is the local interface.
+
+Take a look at [CalculatorRemote.java|src/org/jboss/tutorial/stateless/bean/CalculatorRemote.java].  To define this as the remote interface of Calculator bean
+you either annotate the bean class and specify what the remote interfaces are, or you annotate each remote interface the bean class
+implements with @javax.ejb.Remote. only need to annotate the bean class with @javax.ejb.Remote.  Similar for [CalculatorLocal.java|src/org/jboss/tutorial/stateless/bean/CalculatorLocal.java] as you need to annotate the bean class with @javax.ejb.Local for it to be the local interface of the CalculatorBean.
+
+!JNDI Bindings
+The Calculator bean will have two JNDI bindings for the remote and Local interface.  By default, JBoss will use ejbName/local and ejbName/remote for the local and
+remote interfaces, respectively.
+
+!Client
+Open up [Client.java|src/org/jboss/tutorial/stateless/client/Client.java].  You'll see that it looks up the stateless bean under "ejbName/remote".
+Also notice that there is no Home interface and you can begin executing on the stateless bean right away.
+
+!Building and Running
+To build and run the example, make sure you have installed JBoss 5.x and have JBoss running.  
+{{{
+Unix:    $ export JBOSS_HOME=<where your jboss 5.x distribution is>
+Windows: $ set JBOSS_HOME=<where your jboss 5.x distribution is>
+}}}
+
+!Ant Users:
+{{{
+$ ant
+$ ant run
+
+run:
+     [java] 2004-10-06 19:10:35,857 INFO org.jboss.remoting.InvokerRegistry[main] - Failed to load soap remoting transpo
+rt: org/apache/axis/AxisFault
+     [java] 1 + 1 = 2
+     [java] 1 - 1 = 0
+}}}
+
+!Maven Users:
+{{{
+$ mvn clean install
+TODO: This part needs to be fixed. In progress.
+$ mvn exec:exec
+}}}
+
+!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.
+
+
+
+


Property changes on: projects/ejb3/trunk/docs/tutorial/stateless/stateless.wiki
___________________________________________________________________
Name: svn:executable
   + *




More information about the jboss-cvs-commits mailing list