[jboss-cvs] JBossAS SVN: r86241 - in projects/ejb3: examples and 20 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Mar 23 21:30:18 EDT 2009
Author: ALRubinger
Date: 2009-03-23 21:30:18 -0400 (Mon, 23 Mar 2009)
New Revision: 86241
Added:
projects/ejb3/examples/
projects/ejb3/examples/trunk/
projects/ejb3/examples/trunk/build/
projects/ejb3/examples/trunk/build/pom.xml
projects/ejb3/examples/trunk/firstejb/
projects/ejb3/examples/trunk/firstejb/pom.xml
projects/ejb3/examples/trunk/firstejb/src/
projects/ejb3/examples/trunk/firstejb/src/main/
projects/ejb3/examples/trunk/firstejb/src/main/java/
projects/ejb3/examples/trunk/firstejb/src/main/java/org/
projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/
projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/
projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/
projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/
projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/
projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorBeanBase.java
projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorCommonBusiness.java
projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorLocal.java
projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorLocalBusiness.java
projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorLocalHome.java
projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorRemote.java
projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorRemoteBusiness.java
projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorRemoteHome.java
projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/ManyViewCalculatorBean.java
projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/SimpleCalculatorBean.java
projects/ejb3/examples/trunk/firstejb/src/main/resources/
projects/ejb3/examples/trunk/firstejb/src/test/
projects/ejb3/examples/trunk/firstejb/src/test/java/
projects/ejb3/examples/trunk/firstejb/src/test/java/org/
projects/ejb3/examples/trunk/firstejb/src/test/java/org/jboss/
projects/ejb3/examples/trunk/firstejb/src/test/java/org/jboss/ejb3/
projects/ejb3/examples/trunk/firstejb/src/test/java/org/jboss/ejb3/examples/
projects/ejb3/examples/trunk/firstejb/src/test/java/org/jboss/ejb3/examples/ch04/
projects/ejb3/examples/trunk/firstejb/src/test/java/org/jboss/ejb3/examples/ch04/firstejb/
projects/ejb3/examples/trunk/firstejb/src/test/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorTestCase.java
projects/ejb3/examples/trunk/firstejb/src/test/resources/
projects/ejb3/examples/trunk/pom.xml
Log:
Add the skeleton and beginning of the EJB Examples
Property changes on: projects/ejb3/examples/trunk
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.classpath
.project
Property changes on: projects/ejb3/examples/trunk/build
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.classpath
.project
Added: projects/ejb3/examples/trunk/build/pom.xml
===================================================================
--- projects/ejb3/examples/trunk/build/pom.xml (rev 0)
+++ projects/ejb3/examples/trunk/build/pom.xml 2009-03-24 01:30:18 UTC (rev 86241)
@@ -0,0 +1,115 @@
+<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>
+
+ <!-- Artifact Information -->
+ <groupId>org.jboss.ejb3.examples</groupId>
+ <artifactId>jboss-ejb3-examples-build</artifactId>
+ <name>Build System and Parent for JBoss EJB3 Examples</name>
+ <version>0.0.1-SNAPSHOT</version>
+ <description>Build System and Parent for JBoss EJB3 Examples to accompany O'Reilly "Enterprise JavaBeans 6th Edition"</description>
+ <packaging>pom</packaging>
+
+ <!-- Properties -->
+ <properties>
+
+ <!-- Versioning -->
+ <version.org.jboss.ejb3_jboss-ejb3-api>3.1.0-Alpha1</version.org.jboss.ejb3_jboss-ejb3-api>
+ <version.junit_junit>4.5</version.junit_junit>
+
+ </properties>
+
+ <!-- Build Configuration -->
+ <build>
+
+ <plugins>
+
+ <!-- Compiler -->
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <showDeprecation>false</showDeprecation>
+ <showWarnings>true</showWarnings>
+ <optimize>true</optimize>
+ <compilerVersion>1.6</compilerVersion>
+ <fork>true</fork>
+ <executable>${JAVA_HOME}/bin/javac</executable>
+ </configuration>
+ </plugin>
+
+ <!-- Surefire (Tests) Plugin -->
+
+ <!--
+ To pass JVM Arguments (ie. Remote Debugging w/ suspend), pass
+ "maven.surefire.debug" as system property, ie: mvn test
+ -Dmaven.surefire.debug="-Xdebug
+ -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8787"
+ -->
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <printSummary>true</printSummary>
+ <includes>
+ <include>**/*TestCase.java</include>
+ <include>**/*TestSuite.java</include>
+ </includes>
+ <forkMode>always</forkMode>
+ <argLine>-ea</argLine>
+ </configuration>
+ </plugin>
+
+ <!-- Enforce Maven Environment -->
+ <plugin>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>enforce-maven-environment</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <rules>
+ <requireMavenVersion>
+ <version>[2.0.9,2.1)</version> <!-- Must be Maven 2.0.9 >= x > 2.1 -->
+ </requireMavenVersion>
+ <requireJavaVersion>
+ <version>1.6.0</version> <!-- Must be JDK6 -->
+ </requireJavaVersion>
+ </rules>
+ </configuration>
+ </plugin>
+
+ </plugins>
+
+ </build>
+
+ <!-- Dependency Versioning -->
+ <dependencyManagement>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-api</artifactId>
+ <version>${version.org.jboss.ejb3_jboss-ejb3-api}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${version.junit_junit}</version>
+ </dependency>
+
+ </dependencies>
+
+ </dependencyManagement>
+
+</project>
\ No newline at end of file
Property changes on: projects/ejb3/examples/trunk/firstejb
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.classpath
.project
Added: projects/ejb3/examples/trunk/firstejb/pom.xml
===================================================================
--- projects/ejb3/examples/trunk/firstejb/pom.xml (rev 0)
+++ projects/ejb3/examples/trunk/firstejb/pom.xml 2009-03-24 01:30:18 UTC (rev 86241)
@@ -0,0 +1,35 @@
+<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">
+
+ <!-- Parent Information -->
+ <parent>
+ <groupId>org.jboss.ejb3.examples</groupId>
+ <artifactId>jboss-ejb3-examples-build</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <!-- Model Version -->
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- Artifact Information -->
+ <artifactId>jboss-ejb3-examples-firstejb</artifactId>
+ <name>JBoss EJB 3.x Examples - My First EJB</name>
+ <description>Example to accompany O'Reilly "Enterprise Java Beans 6th Edition" Chapter 4</description>
+
+ <!-- Dependencies -->
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+
+ </dependencies>
+
+</project>
\ No newline at end of file
Added: projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorBeanBase.java
===================================================================
--- projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorBeanBase.java (rev 0)
+++ projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorBeanBase.java 2009-03-24 01:30:18 UTC (rev 86241)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.ejb3.examples.ch04.firstejb;
+
+/**
+ * CalculatorBeanBase
+ *
+ * Base for bean implementation classes of the CalculatorEJB,
+ * provides business logic for required contracts
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class CalculatorBeanBase implements CalculatorCommonBusiness
+{
+ // ---------------------------------------------------------------------------||
+ // Required Implementations --------------------------------------------------||
+ // ---------------------------------------------------------------------------||
+
+ /**
+ * Adds all arguments
+ *
+ * @return The sum of all arguments
+ */
+ @Override
+ public int add(final int... arguments)
+ {
+ // Initialize
+ int result = 0;
+
+ // Add all arguments
+ for (final int arg : arguments)
+ {
+ result += arg;
+ }
+
+ // Return
+ return result;
+ }
+
+}
Added: projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorCommonBusiness.java
===================================================================
--- projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorCommonBusiness.java (rev 0)
+++ projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorCommonBusiness.java 2009-03-24 01:30:18 UTC (rev 86241)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.ejb3.examples.ch04.firstejb;
+
+/**
+ * CalculatorCommonBusiness
+ *
+ * Contains the contract for operation common to
+ * all business interfaces of the CalculatorEJB
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface CalculatorCommonBusiness
+{
+
+ // ---------------------------------------------------------------------------||
+ // Contracts -----------------------------------------------------------------||
+ // ---------------------------------------------------------------------------||
+
+ /**
+ * Adds all arguments
+ *
+ * @return The sum of all arguments
+ */
+ int add(int... arguments);
+
+}
Added: projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorLocal.java
===================================================================
--- projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorLocal.java (rev 0)
+++ projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorLocal.java 2009-03-24 01:30:18 UTC (rev 86241)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.ejb3.examples.ch04.firstejb;
+
+import javax.ejb.EJBLocalObject;
+
+/**
+ * CalculatorLocal
+ *
+ * EJB 2.x Local Component interface of the CalculatorEJB
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface CalculatorLocal extends CalculatorCommonBusiness, EJBLocalObject
+{
+
+}
Added: projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorLocalBusiness.java
===================================================================
--- projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorLocalBusiness.java (rev 0)
+++ projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorLocalBusiness.java 2009-03-24 01:30:18 UTC (rev 86241)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.ejb3.examples.ch04.firstejb;
+
+/**
+ * CalculatorLocalBusiness
+ *
+ * Local business interface for the CalculatorEJB
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface CalculatorLocalBusiness extends CalculatorCommonBusiness
+{
+
+}
Added: projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorLocalHome.java
===================================================================
--- projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorLocalHome.java (rev 0)
+++ projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorLocalHome.java 2009-03-24 01:30:18 UTC (rev 86241)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.ejb3.examples.ch04.firstejb;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBLocalHome;
+
+/**
+ * CalculatorLocalHome
+ *
+ * EJB 2.x Local Home of the CalculatorEJB
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface CalculatorLocalHome extends EJBLocalHome
+{
+ // ---------------------------------------------------------------------------||
+ // create<METHOD> Methods ----------------------------------------------------||
+ // ---------------------------------------------------------------------------||
+
+ /**
+ * Returns a reference to a remote component view of the CalculatorEJB
+ */
+ CalculatorLocal create() throws CreateException;
+
+}
Added: projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorRemote.java
===================================================================
--- projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorRemote.java (rev 0)
+++ projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorRemote.java 2009-03-24 01:30:18 UTC (rev 86241)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.ejb3.examples.ch04.firstejb;
+
+import javax.ejb.EJBObject;
+
+/**
+ * CalculatorRemote
+ *
+ * EJB 2.x Remote Component interface of the CalculatorEJB
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface CalculatorRemote extends CalculatorCommonBusiness, EJBObject
+{
+
+}
Added: projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorRemoteBusiness.java
===================================================================
--- projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorRemoteBusiness.java (rev 0)
+++ projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorRemoteBusiness.java 2009-03-24 01:30:18 UTC (rev 86241)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.ejb3.examples.ch04.firstejb;
+
+/**
+ * CalculatorRemoteBusiness
+ *
+ * Remote business interface for the CalculatorEJB
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface CalculatorRemoteBusiness extends CalculatorCommonBusiness
+{
+
+}
Added: projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorRemoteHome.java
===================================================================
--- projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorRemoteHome.java (rev 0)
+++ projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorRemoteHome.java 2009-03-24 01:30:18 UTC (rev 86241)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.ejb3.examples.ch04.firstejb;
+
+import java.rmi.RemoteException;
+
+import javax.ejb.CreateException;
+import javax.ejb.EJBHome;
+
+/**
+ * CalculatorRemoteHome
+ *
+ * EJB 2.x Remote Home of the CalculatorEJB
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface CalculatorRemoteHome extends EJBHome
+{
+ // ---------------------------------------------------------------------------||
+ // create<METHOD> Methods ----------------------------------------------------||
+ // ---------------------------------------------------------------------------||
+
+ /**
+ * Returns a reference to a remote component view of the CalculatorEJB
+ */
+ CalculatorRemote create() throws CreateException, RemoteException;
+
+}
Added: projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/ManyViewCalculatorBean.java
===================================================================
--- projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/ManyViewCalculatorBean.java (rev 0)
+++ projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/ManyViewCalculatorBean.java 2009-03-24 01:30:18 UTC (rev 86241)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.ejb3.examples.ch04.firstejb;
+
+import javax.ejb.Local;
+import javax.ejb.LocalHome;
+import javax.ejb.Remote;
+import javax.ejb.RemoteHome;
+import javax.ejb.Stateless;
+
+/**
+ * ManyViewCalculatorBean
+ *
+ * Bean implementation class of the CalculatorEJB which
+ * exposes local and remote business and component views
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at Local(CalculatorLocalBusiness.class)
+ at Remote(CalculatorRemoteBusiness.class)
+ at LocalHome(CalculatorLocalHome.class)
+ at RemoteHome(CalculatorRemoteHome.class)
+public class ManyViewCalculatorBean extends CalculatorBeanBase implements CalculatorCommonBusiness
+{
+ /*
+ * Implementation supplied by common base class
+ */
+}
Added: projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/SimpleCalculatorBean.java
===================================================================
--- projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/SimpleCalculatorBean.java (rev 0)
+++ projects/ejb3/examples/trunk/firstejb/src/main/java/org/jboss/ejb3/examples/ch04/firstejb/SimpleCalculatorBean.java 2009-03-24 01:30:18 UTC (rev 86241)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.ejb3.examples.ch04.firstejb;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+
+/**
+ * SimpleCalculatorBean
+ *
+ * Bean implementation class of the CalculatorEJB which
+ * exposes one remote business view
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+ at Stateless
+ at Remote(CalculatorRemoteBusiness.class)
+public class SimpleCalculatorBean extends CalculatorBeanBase implements CalculatorCommonBusiness
+{
+ /*
+ * Implementation supplied by common base class
+ */
+}
Added: projects/ejb3/examples/trunk/firstejb/src/test/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorTestCase.java
===================================================================
--- projects/ejb3/examples/trunk/firstejb/src/test/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorTestCase.java (rev 0)
+++ projects/ejb3/examples/trunk/firstejb/src/test/java/org/jboss/ejb3/examples/ch04/firstejb/CalculatorTestCase.java 2009-03-24 01:30:18 UTC (rev 86241)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.ejb3.examples.ch04.firstejb;
+
+import junit.framework.TestCase;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * CalculatorTestCase
+ *
+ * Tests to ensure that the business methods of the CalculatorEJB
+ * are working as expected
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class CalculatorTestCase
+{
+ // ---------------------------------------------------------------------------||
+ // Required Implementations --------------------------------------------------||
+ // ---------------------------------------------------------------------------||
+
+ private static SimpleCalculatorBean calc;
+
+ // ---------------------------------------------------------------------------||
+ // Lifecycle Methods ---------------------------------------------------------||
+ // ---------------------------------------------------------------------------||
+
+ @BeforeClass
+ public static void beforeClass()
+ {
+ calc = new SimpleCalculatorBean();
+ }
+
+ // ---------------------------------------------------------------------------||
+ // Tests ---------------------------------------------------------------------||
+ // ---------------------------------------------------------------------------||
+
+ /**
+ * Ensures that the CalculatorEJB adds as expected
+ */
+ @Test
+ public void testAddition()
+ {
+ // Initialize
+ int expectedSum = 10;
+
+ // Add
+ int actualSum = calc.add(2, 3, 5);
+
+ // Test
+ TestCase.assertEquals("Addition did not return the expected result", expectedSum, actualSum);
+ }
+}
Added: projects/ejb3/examples/trunk/pom.xml
===================================================================
--- projects/ejb3/examples/trunk/pom.xml (rev 0)
+++ projects/ejb3/examples/trunk/pom.xml 2009-03-24 01:30:18 UTC (rev 86241)
@@ -0,0 +1,21 @@
+<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>
+
+ <!-- Artifact Information -->
+ <groupId>org.jboss.ejb3.examples</groupId>
+ <artifactId>jboss-ejb3-examples-aggregator</artifactId>
+ <name>Aggregator POM for JBoss EJB3 Examples</name>
+ <version>0.0.1-SNAPSHOT</version>
+ <description>Aggregator POM for JBoss EJB3 Examples</description>
+ <packaging>pom</packaging>
+
+ <!-- Modules in Aggregator -->
+ <modules>
+ <module>build</module>
+ <module>firstejb</module>
+ </modules>
+
+</project>
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list