[jboss-cvs] JBossAS SVN: r78081 - in projects/ejb3/trunk/api: .settings and 21 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Sep 5 09:08:33 EDT 2008
Author: wolfc
Date: 2008-09-05 09:08:33 -0400 (Fri, 05 Sep 2008)
New Revision: 78081
Added:
projects/ejb3/trunk/api/.classpath
projects/ejb3/trunk/api/.project
projects/ejb3/trunk/api/.settings/
projects/ejb3/trunk/api/.settings/org.eclipse.jdt.core.prefs
projects/ejb3/trunk/api/.settings/org.maven.ide.eclipse.prefs
projects/ejb3/trunk/api/pom.xml
projects/ejb3/trunk/api/src/
projects/ejb3/trunk/api/src/main/
projects/ejb3/trunk/api/src/main/java/
projects/ejb3/trunk/api/src/main/java/javax/
projects/ejb3/trunk/api/src/main/java/javax/ejb/AccessTimeout.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/AfterBegin.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/AfterCompletion.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/AsyncResult.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/Asynchronous.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/BeforeCompletion.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/ConcurrencyManagement.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/ConcurrencyManagementType.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/ConcurrentAccessTimeoutException.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/DependsOn.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/EJBContainer.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/Lock.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/LockType.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/Schedule.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/ScheduleExpression.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/Schedules.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/Singleton.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/Startup.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/TimerConfig.java
projects/ejb3/trunk/api/src/main/java/org/
projects/ejb3/trunk/api/src/main/java/org/jboss/
projects/ejb3/trunk/api/src/main/java/org/jboss/ejb3/
projects/ejb3/trunk/api/src/main/java/org/jboss/ejb3/api/
projects/ejb3/trunk/api/src/main/java/org/jboss/ejb3/api/spi/
projects/ejb3/trunk/api/src/main/java/org/jboss/ejb3/api/spi/EJBContainerProvider.java
projects/ejb3/trunk/api/src/main/java/org/jboss/ejb3/api/spi/EJBContainerWrapper.java
projects/ejb3/trunk/api/src/test/
projects/ejb3/trunk/api/src/test/java/
projects/ejb3/trunk/api/src/test/java/org/
projects/ejb3/trunk/api/src/test/java/org/jboss/
projects/ejb3/trunk/api/src/test/java/org/jboss/ejb3/
projects/ejb3/trunk/api/src/test/java/org/jboss/ejb3/api/
projects/ejb3/trunk/api/src/test/java/org/jboss/ejb3/api/test/
projects/ejb3/trunk/api/src/test/java/org/jboss/ejb3/api/test/embedded/
projects/ejb3/trunk/api/src/test/java/org/jboss/ejb3/api/test/embedded/JBossEJBContainer.java
projects/ejb3/trunk/api/src/test/java/org/jboss/ejb3/api/test/embedded/JBossEJBContainerProvider.java
projects/ejb3/trunk/api/src/test/java/org/jboss/ejb3/api/test/embedded/unit/
projects/ejb3/trunk/api/src/test/java/org/jboss/ejb3/api/test/embedded/unit/EJBContainerTestCase.java
projects/ejb3/trunk/api/src/test/resources/
projects/ejb3/trunk/api/src/test/resources/META-INF/
projects/ejb3/trunk/api/src/test/resources/META-INF/services/
projects/ejb3/trunk/api/src/test/resources/META-INF/services/org.jboss.ejb3.api.spi.EJBContainerProvider
Modified:
projects/ejb3/trunk/api/
projects/ejb3/trunk/api/src/main/java/javax/ejb/SessionContext.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/Timer.java
projects/ejb3/trunk/api/src/main/java/javax/ejb/TimerService.java
Log:
EJBTHREE-1484: EJB 3.1 PDR 26-Aug-2008
Property changes on: projects/ejb3/trunk/api
___________________________________________________________________
Name: svn:ignore
+ eclipse-target
target
Added: projects/ejb3/trunk/api/.classpath
===================================================================
--- projects/ejb3/trunk/api/.classpath (rev 0)
+++ projects/ejb3/trunk/api/.classpath 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,8 @@
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/test/java" output="eclipse-target/tests-classes"/>
+ <classpathentry kind="src" path="src/test/resources" output="eclipse-target/tests-classes" excluding="**/*.java"/>
+ <classpathentry kind="output" path="eclipse-target/classes"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+</classpath>
\ No newline at end of file
Added: projects/ejb3/trunk/api/.project
===================================================================
--- projects/ejb3/trunk/api/.project (rev 0)
+++ projects/ejb3/trunk/api/.project 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,17 @@
+<projectDescription>
+ <name>jboss-ejb3-api</name>
+ <comment>JBoss EJB 3.1 API classes</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Added: projects/ejb3/trunk/api/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/ejb3/trunk/api/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ projects/ejb3/trunk/api/.settings/org.eclipse.jdt.core.prefs 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,5 @@
+#Fri Sep 05 11:03:56 CEST 2008
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
Added: projects/ejb3/trunk/api/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/ejb3/trunk/api/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ projects/ejb3/trunk/api/.settings/org.maven.ide.eclipse.prefs 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,8 @@
+#Fri Sep 05 14:26:37 CEST 2008
+activeProfiles=eclipse
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+version=1
Added: projects/ejb3/trunk/api/pom.xml
===================================================================
--- projects/ejb3/trunk/api/pom.xml (rev 0)
+++ projects/ejb3/trunk/api/pom.xml 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,39 @@
+<!--
+ vi:ts=2:sw=2:expandtab
+-->
+<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>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-build</artifactId>
+ <version>1.0.0-Beta1</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>jboss-ejb3-api</artifactId>
+ <packaging>jar</packaging>
+ <version>3.1.0-SNAPSHOT</version>
+ <name>JBoss EJB 3.1 API</name>
+ <description>JBoss EJB 3.1 API classes</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>jboss.jbossws</groupId>
+ <artifactId>jboss-jaxrpc</artifactId>
+ <version>1.0.4.GA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.javaee</groupId>
+ <artifactId>jboss-transaction-api</artifactId>
+ <version>1.0.1.CR2</version>
+ </dependency>
+ </dependencies>
+</project>
Copied: projects/ejb3/trunk/api/src/main/java/javax (from rev 78069, projects/javaee/trunk/jboss-ejb-api/src/main/javax)
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/AccessTimeout.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/AccessTimeout.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/AccessTimeout.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,46 @@
+/*
+ * 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 javax.ejb;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Specifies the amount of time(in milliseconds) that a concurrent access
+ * attempt on a Singleton session bean should block before timing out.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @since 3.1
+ */
+ at Target({METHOD,TYPE})
+ at Retention(RUNTIME)
+public @interface AccessTimeout {
+ /**
+ * Timeout in milliseconds.
+ */
+ int value();
+}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/AfterBegin.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/AfterBegin.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/AfterBegin.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,42 @@
+/*
+ * 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 javax.ejb;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Designate a stateful session bean method to receive the AfterBegin
+ * Session Synchronization callback.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @since 3.1
+ */
+ at Target(METHOD)
+ at Retention(RUNTIME)
+public @interface AfterBegin {
+
+}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/AfterCompletion.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/AfterCompletion.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/AfterCompletion.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,41 @@
+/*
+ * 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 javax.ejb;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Designate a stateful session bean method to receive the AfterCompletion
+ * Session Synchronization callback.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+ at Target(METHOD)
+ at Retention(RUNTIME)
+public @interface AfterCompletion {
+
+}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/AsyncResult.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/AsyncResult.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/AsyncResult.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,75 @@
+/*
+ * 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 javax.ejb;
+
+import java.io.Serializable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+/**
+ * Wraps the result of an asynchronous method call as a Future object
+ * preserving compatability with the business interface signature. The
+ * value specified in the constructor will be retrieved by the container
+ * and made available to the client.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @since 3.1
+ */
+public final class AsyncResult<V> implements Future<V>, Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ private V result;
+
+ public AsyncResult(V result)
+ {
+ this.result = result;
+ }
+
+ public boolean cancel(boolean mayInterruptIfRunning)
+ {
+ return false;
+ }
+
+ public V get() throws InterruptedException, ExecutionException
+ {
+ return result;
+ }
+
+ public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
+ {
+ return result;
+ }
+
+ public boolean isCancelled()
+ {
+ return false;
+ }
+
+ public boolean isDone()
+ {
+ return true;
+ }
+}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/Asynchronous.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/Asynchronous.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/Asynchronous.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,43 @@
+/*
+ * 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 javax.ejb;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Used to mark a method as an asynchronous method or to designate all
+ * business methods of a class or interface as asynchronous.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @since 3.1
+ */
+ at Target({METHOD,TYPE})
+ at Retention(RUNTIME)
+public @interface Asynchronous {
+
+}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/BeforeCompletion.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/BeforeCompletion.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/BeforeCompletion.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,42 @@
+/*
+ * 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 javax.ejb;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Designate a stateful session bean method to receive the
+ * BeforeCompletion Session Synchronization callback.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @since 3.1
+ */
+ at Target(METHOD)
+ at Retention(RUNTIME)
+public @interface BeforeCompletion {
+
+}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/ConcurrencyManagement.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/ConcurrencyManagement.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/ConcurrencyManagement.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,42 @@
+/*
+ * 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 javax.ejb;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.ejb.ConcurrencyManagementType.CONTAINER;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Declares a Singleton bean's concurrency management type.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @since 3.1
+ */
+ at Target(TYPE)
+ at Retention(RUNTIME)
+public @interface ConcurrencyManagement {
+ ConcurrencyManagementType value() default CONTAINER;
+}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/ConcurrencyManagementType.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/ConcurrencyManagementType.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/ConcurrencyManagementType.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -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 javax.ejb;
+
+/**
+ * A Singleton bean's concurrency management type.
+ * <ul>
+ * <li>CONTAINER : Container managed concurrency</li>
+ * <li>BEAN : Bean managed concurrency</li>
+ * </ul>
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @since 3.1
+ */
+public enum ConcurrencyManagementType {
+ BEAN,
+ CONTAINER
+}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/ConcurrentAccessTimeoutException.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/ConcurrentAccessTimeoutException.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/ConcurrentAccessTimeoutException.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,46 @@
+/*
+ * 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 javax.ejb;
+
+/**
+ * This exception indicates that an attempt to concurrently
+ * access a method of a Singleton resulted in a timeout.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @see AccessTimeout
+ * @since 3.1
+ */
+public class ConcurrentAccessTimeoutException extends EJBException
+{
+ private static final long serialVersionUID = 1L;
+
+ public ConcurrentAccessTimeoutException()
+ {
+ super();
+ }
+
+ public ConcurrentAccessTimeoutException(String message)
+ {
+ super(message);
+ }
+}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/DependsOn.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/DependsOn.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/DependsOn.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,45 @@
+/*
+ * 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 javax.ejb;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Used to express an initialization dependency between Singleton components.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @since 3.1
+ */
+ at Target(TYPE)
+ at Retention(RUNTIME)
+public @interface DependsOn {
+ /**
+ * Holds one or more ejb-names of Singleton components whose
+ * initialization must occur before this Singleton.
+ */
+ String[] value();
+}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/EJBContainer.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/EJBContainer.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/EJBContainer.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,215 @@
+/*
+ * 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 javax.ejb;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.naming.Context;
+
+import org.jboss.ejb3.api.spi.EJBContainerProvider;
+import org.jboss.ejb3.api.spi.EJBContainerWrapper;
+
+/**
+ * Used to execute an EJB application in an embeddable container.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @since 3.1
+ */
+public abstract class EJBContainer
+{
+ public static final String EMBEDDABLE_INITIAL = "javax.ejb.embeddable.initial";
+
+ private static EJBContainerWrapper currentEJBContainer;
+
+ private static final Pattern nonCommentPattern = Pattern.compile("^([^#]+)");
+
+ private static List<EJBContainerProvider> factories = new ArrayList<EJBContainerProvider>();
+
+ static
+ {
+ findAllFactories();
+ }
+
+ /**
+ * Shutdown an embeddable EJBContainer instance.
+ */
+ public abstract void close();
+
+ /**
+ * Create and initialize an embeddable EJB container.
+ * JVM classpath is searched for all ejb-jars or exploded ejb-jars in directory format.
+ *
+ * @return EJBContainer instance
+ * @throws EJBException Thrown if the container or application could not
+ * be successfully initialized.
+ */
+ public static EJBContainer createEJBContainer() throws EJBException
+ {
+ return createEJBContainer(null);
+ }
+
+ /**
+ * Create and initialize an embeddable EJB container with an
+ * optional set of configuration properties and names of modules to be initialized.
+ *
+ * @param properties One or more spec-defined or vendor-specific properties.
+ * The spec reserves the prefix "javax.ejb." for spec-defined properties. Can be null.
+ * @param modules Specific set of module names to be initialized. Can be null.
+ * If null, defaults to module scanning algorithm in createEJBContainer().
+ * @return EJBContainer instance
+ * @throws EJBException Thrown if the container or application could not
+ * be successfully initialized.
+ */
+ public static EJBContainer createEJBContainer(Map<?, ?> properties, String... modules)
+ throws EJBException
+ {
+ for(EJBContainerProvider factory : factories)
+ {
+ EJBContainer container = factory.createEJBContainer(properties, modules);
+ if(container != null)
+ {
+ currentEJBContainer = new EJBContainerWrapper(container);
+ return currentEJBContainer;
+ }
+ }
+ throw new EJBException("Unable to instantiate container with factories " + factories);
+ }
+
+ /**
+ * Create and initialize an embeddable EJB container with an
+ * optional set of configuration properties and names of modules to be initialized.
+ *
+ * @param properties One or more spec-defined or vendor-specific properties.
+ * The spec reserves the prefix "javax.ejb." for spec-defined properties. Can be null.
+ * @param modules Specific set of module names to be initialized. Can be null.
+ * If null, defaults to module scanning algorithm in createEJBContainer().
+ * @return EJBContainer instance
+ * @throws EJBException Thrown if the container or application could not
+ * be successfully initialized.
+ */
+ @Deprecated
+ public static EJBContainer createEJBContainer(Map<String, Object> properties, Set<String> modules)
+ throws EJBException
+ {
+ String[] modulesArray = null;
+ if(modules != null)
+ modulesArray = modules.toArray(new String[0]);
+ return createEJBContainer(properties, modulesArray);
+ }
+
+ private static List<String> factoryNamesFromReader(BufferedReader reader) throws IOException
+ {
+ List<String> names = new ArrayList<String>();
+ String line;
+ while ((line = reader.readLine()) != null)
+ {
+ line = line.trim();
+ Matcher m = nonCommentPattern.matcher(line);
+ if (m.find())
+ {
+ names.add(m.group().trim());
+ }
+ }
+ return names;
+ }
+
+ private static void findAllFactories()
+ {
+ try
+ {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ Enumeration<URL> resources = loader.getResources("META-INF/services/" + EJBContainerProvider.class.getName());
+ Set<String> names = new HashSet<String>();
+ while (resources.hasMoreElements())
+ {
+ URL url = resources.nextElement();
+ InputStream is = url.openStream();
+ try
+ {
+ names.addAll(factoryNamesFromReader(new BufferedReader(new InputStreamReader(is))));
+ }
+ finally
+ {
+ is.close();
+ }
+ }
+ for (String s : names)
+ {
+ Class<?> factoryClass = loader.loadClass(s);
+ factories.add(EJBContainerProvider.class.cast(factoryClass.newInstance()));
+ }
+ }
+ catch (IOException e)
+ {
+ throw new EJBException(e);
+ }
+ catch (InstantiationException e)
+ {
+ throw new EJBException(e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new EJBException(e);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new EJBException(e);
+ }
+ }
+
+ /**
+ * Retrieve the last EJBContainer instance to be successfully returned
+ * from an invocation to a createEJBContainer method.
+ * @return EJBContainer instance, or null if none exists or if the last EJBContainer
+ * instance has been closed.
+ */
+ public static EJBContainer getCurrentEJBContainer()
+ {
+ if(currentEJBContainer != null && currentEJBContainer.isClosed())
+ return null;
+ return currentEJBContainer;
+ }
+
+ /**
+ * Retrieve a naming context for looking up references to session beans executing in
+ * the embeddable container.
+ *
+ * @return The naming context.
+ */
+ public Context getContext()
+ {
+ throw new UnsupportedOperationException(this + " does not support a naming context");
+ }
+}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/Lock.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/Lock.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/Lock.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,43 @@
+/*
+ * 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 javax.ejb;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.ejb.LockType.WRITE;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Declares a concurrency lock for a singleton method.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @since 3.1
+ */
+ at Target({METHOD,TYPE})
+ at Retention(RUNTIME)
+public @interface Lock {
+ LockType value() default WRITE;
+}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/LockType.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/LockType.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/LockType.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,39 @@
+/*
+ * 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 javax.ejb;
+
+/**
+ * Concurrency lock type.
+ * <ul>
+ * <li>READ : For read-only operations. Allows simultaneous access to
+ * methods designated as READ, as long as no WRITE lock is held.</li>
+ * <li>WRITE : For write operations. The WRITE lock is exclusive.</li>
+ * </ul>
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @since 3.1
+ */
+public enum LockType {
+ READ,
+ WRITE
+}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/Schedule.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/Schedule.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/Schedule.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,59 @@
+/*
+ * 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 javax.ejb;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Schedule a timer for automatic creation with a timeout schedule
+ * based on a cron-like time expression. The annotated method is used
+ * as the timeout callback method.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @since 3.1
+ */
+ at Target(value=METHOD)
+ at Retention(value=RUNTIME)
+public @interface Schedule {
+ String dayOfMonth() default "*";
+
+ String dayOfWeek() default "*";
+
+ String hour() default "0";
+
+ String info() default "";
+
+ String minute() default "0";
+
+ String month() default "*";
+
+ boolean persistent() default true;
+
+ String second() default "0";
+
+ String year() default "*";
+}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/ScheduleExpression.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/ScheduleExpression.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/ScheduleExpression.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,197 @@
+/*
+ * 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 javax.ejb;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * A calendar-based timeout expression for an enterprise bean timer.
+ * See the Schedule annotation for the defaults.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @since 3.1
+ */
+public final class ScheduleExpression implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ private String dayOfMonth = "*";
+
+ private String dayOfWeek = "*";
+
+ private Date end;
+
+ private String hour = "0";
+
+ private String minute = "0";
+
+ private String month = "*";
+
+ private String second = "0";
+
+ private Date start;
+
+ private String year = "*";
+
+ public ScheduleExpression dayOfMonth(int d)
+ {
+ this.dayOfMonth = Integer.toString(d);
+ return this;
+ }
+
+ public ScheduleExpression dayOfMonth(String d)
+ {
+ this.dayOfMonth = d;
+ return this;
+ }
+
+ public ScheduleExpression dayOfWeek(int d)
+ {
+ this.dayOfWeek = Integer.toString(d);
+ return this;
+ }
+
+ public ScheduleExpression dayOfWeek(String d)
+ {
+ this.dayOfWeek = d;
+ return this;
+ }
+
+ public ScheduleExpression end(Date e)
+ {
+ this.end = e;
+ return this;
+ }
+
+ public String getDayOfMonth()
+ {
+ return dayOfMonth;
+ }
+
+ public String getDayOfWeek()
+ {
+ return dayOfWeek;
+ }
+
+ public Date getEnd()
+ {
+ return end;
+ }
+
+ public String getHour()
+ {
+ return hour ;
+ }
+
+ public String getMinute()
+ {
+ return minute ;
+ }
+
+ public String getMonth()
+ {
+ return month ;
+ }
+
+ public String getSecond()
+ {
+ return second ;
+ }
+
+ public Date getStart()
+ {
+ return start;
+ }
+
+ public String getYear()
+ {
+ return year ;
+ }
+
+ public ScheduleExpression hour(int h)
+ {
+ this.hour = Integer.toString(h);
+ return this;
+ }
+
+ public ScheduleExpression hour(String h)
+ {
+ this.hour = h;
+ return this;
+ }
+
+ public ScheduleExpression minute(int m)
+ {
+ this.minute = Integer.toString(m);
+ return this;
+ }
+
+ public ScheduleExpression minute(String m)
+ {
+ this.minute = m;
+ return this;
+ }
+
+ public ScheduleExpression month(int m)
+ {
+ this.month = Integer.toString(m);
+ return this;
+ }
+
+ public ScheduleExpression month(String m)
+ {
+ this.month = m;
+ return this;
+ }
+
+ public ScheduleExpression second(int s)
+ {
+ this.second = Integer.toString(s);
+ return this;
+ }
+
+ public ScheduleExpression second(String s)
+ {
+ this.second = s;
+ return this;
+ }
+
+ public ScheduleExpression start(Date s)
+ {
+ this.start = s;
+ return this;
+ }
+
+ public ScheduleExpression year(int y)
+ {
+ this.year = Integer.toString(y);
+ return this;
+ }
+
+ public ScheduleExpression year(String y)
+ {
+ this.year = y;
+ return this;
+ }
+}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/Schedules.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/Schedules.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/Schedules.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,41 @@
+/*
+ * 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 javax.ejb;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Schedules multiple timers that use the same method as the timeout callback method.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @since 3.1
+ */
+ at Target(METHOD)
+ at Retention(RUNTIME)
+public @interface Schedules {
+ Schedule[] value();
+}
Modified: projects/ejb3/trunk/api/src/main/java/javax/ejb/SessionContext.java
===================================================================
--- projects/javaee/trunk/jboss-ejb-api/src/main/javax/ejb/SessionContext.java 2008-09-05 08:32:25 UTC (rev 78069)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/SessionContext.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -94,5 +94,14 @@
*/
public Class getInvokedBusinessInterface() throws IllegalStateException;
-
+ /**
+ * Check whether a client has requested that the current asynchronous invocation
+ * be cancelled.
+ *
+ * @return true if the client has invoked Future.cancel()
+ * @throws IllegalStateException Thrown if not invoked from within an asynchronous
+ * business method invocation with return type Future.
+ * @since 3.1
+ */
+ boolean isCancelled() throws IllegalStateException;
}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/Singleton.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/Singleton.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/Singleton.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,55 @@
+/*
+ * 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 javax.ejb;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Component-defining annotation for a singleton session bean.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @since 3.1
+ */
+ at Target(TYPE)
+ at Retention(RUNTIME)
+public @interface Singleton {
+ String description() default "";
+
+ /**
+ * A product specific name (in JBoss the global JNDI name) that this
+ * session bean should be mapped to. Application servers are not
+ * required to support any particular form or type of mapped name,
+ * nor the ability to use mapped names. The mapped name is product-dependent
+ * and often installation-dependent. No use of a mapped name is portable.
+ */
+ String mappedName() default "";
+
+ /**
+ * The ejb-name of this bean.
+ */
+ String name() default "";
+}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/Startup.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/Startup.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/Startup.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,41 @@
+/*
+ * 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 javax.ejb;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Mark a Singleton for eager loading during application initialization.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @since 3.1
+ */
+ at Target(TYPE)
+ at Retention(RUNTIME)
+public @interface Startup {
+
+}
Modified: projects/ejb3/trunk/api/src/main/java/javax/ejb/Timer.java
===================================================================
--- projects/javaee/trunk/jboss-ejb-api/src/main/javax/ejb/Timer.java 2008-09-05 08:32:25 UTC (rev 78069)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/Timer.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -109,4 +109,36 @@
IllegalStateException,
NoSuchObjectLocalException,
EJBException;
+
+ /**
+ * Get the schedule expression corresponding to this timer.
+ *
+ * @return
+ * @throws IllegalStateException If this method is invoked while the instance
+ * is in a state that does not allow access to this method. Also thrown if
+ * invoked on a timer that was created with one of the non-ScheduleExpression
+ * TimerService.createTimer APIs.
+ * @throws NoSuchObjectLocalException If invoked on a timer that has expired or
+ * has been cancelled.
+ * @throws EJBException If this method could not complete due to a system-level
+ * failure.
+ * @since 3.1
+ */
+ ScheduleExpression getSchedule() throws IllegalStateException,
+ NoSuchObjectLocalException, EJBException;
+
+ /**
+ * Query whether this timer has persistent semantics.
+ *
+ * @return true if this timer has persistent guarantees.
+ * @throws IllegalStateException If this method is invoked while the instance
+ * is in a state that does not allow access to this method.
+ * @throws NoSuchObjectLocalException If invoked on a timer that has expired
+ * or has been cancelled.
+ * @throws EJBException If this method could not complete due to a system-level failure.
+ * @since 3.1
+ */
+ boolean isPersistent() throws IllegalStateException, NoSuchObjectLocalException,
+ EJBException;
+
}
Added: projects/ejb3/trunk/api/src/main/java/javax/ejb/TimerConfig.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/javax/ejb/TimerConfig.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/TimerConfig.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,57 @@
+/*
+ * 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 javax.ejb;
+
+import java.io.Serializable;
+
+/**
+ * Additional timer configuration options.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ * @since 3.1
+ */
+public class TimerConfig
+{
+ private Serializable info;
+ private boolean persistent;
+
+ public Serializable getInfo()
+ {
+ return info;
+ }
+
+ public boolean isPersistent()
+ {
+ return persistent;
+ }
+
+ public void setInfo(Serializable i )
+ {
+ this.info = i;
+ }
+
+ public void setPersistent(boolean p)
+ {
+ this.persistent = p;
+ }
+}
Modified: projects/ejb3/trunk/api/src/main/java/javax/ejb/TimerService.java
===================================================================
--- projects/javaee/trunk/jboss-ejb-api/src/main/javax/ejb/TimerService.java 2008-09-05 08:32:25 UTC (rev 78069)
+++ projects/ejb3/trunk/api/src/main/java/javax/ejb/TimerService.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -54,6 +54,26 @@
EJBException;
/**
+ * Create a single-action timer that expires after a specified duration.
+ *
+ * @param duration The number of milliseconds that must elapse before the timer expires.
+ * @param timerConfig Timer configuration.
+ *
+ * @return The newly created Timer.
+ *
+ * @throws IllegalArgumentException If duration is negative
+ * @throws IllegalStateException If this method is invoked while the instance is in
+ * a state that does not allow access to this method.
+ * @throws EJBException If this method could not complete due to a system-level failure.
+ * @since 3.1
+ **/
+ public Timer createTimer( long duration, TimerConfig timerConfig )
+ throws
+ IllegalArgumentException,
+ IllegalStateException,
+ EJBException;
+
+ /**
* Create an interval timer whose first expiration occurs after a specified duration,
* and whose subsequent expirations occur after a specified interval.
*
@@ -83,6 +103,35 @@
EJBException;
/**
+ * Create an interval timer whose first expiration occurs after a specified duration,
+ * and whose subsequent expirations occur after a specified interval.
+ *
+ * @param initialDuration The number of milliseconds that must elapse before the first
+ * timer expiration notification.
+ * @param intervalDuration The number of milliseconds that must elapse between timer
+ * expiration notifications. Expiration notifications are
+ * scheduled relative to the time of the first expiration. If
+ * expiration is delayed(e.g. due to the interleaving of other
+ * method calls on the bean) two or more expiration notifications
+ * may occur in close succession to "catch up".
+ * @param timerConfig Timer configuration.
+ *
+ * @return The newly created Timer.
+ *
+ * @throws IllegalArgumentException If initialDuration is negative, or intervalDuration
+ * is negative.
+ * @throws IllegalStateException If this method is invoked while the instance is in
+ * a state that does not allow access to this method.
+ * @throws EJBException If this method could not complete due to a system-level failure.
+ * @since 3.1
+ **/
+ public Timer createTimer( long initialDuration, long intervalDuration, TimerConfig timerConfig )
+ throws
+ IllegalArgumentException,
+ IllegalStateException,
+ EJBException;
+
+ /**
* Create a single-action timer that expires at a given point in time.
*
* @param expiration The point in time at which the timer must expire.
@@ -103,6 +152,26 @@
EJBException;
/**
+ * Create a single-action timer that expires at a given point in time.
+ *
+ * @param expiration The point in time at which the timer must expire.
+ * @param timerConfig Timer configuration.
+ *
+ * @return The newly created Timer.
+ *
+ * @throws IllegalArgumentException If expiration is null, or expiration.getTime() is negative.
+ * @throws IllegalStateException If this method is invoked while the instance is in
+ * a state that does not allow access to this method.
+ * @throws EJBException If this method could not complete due to a system-level failure.
+ * @since 3.1
+ **/
+ public Timer createTimer( Date expiration, TimerConfig timerConfig )
+ throws
+ IllegalArgumentException,
+ IllegalStateException,
+ EJBException;
+
+ /**
* Create an interval timer whose first expiration occurs at a given point in time and
* whose subsequent expirations occur after a specified interval.
*
@@ -131,6 +200,67 @@
EJBException;
/**
+ * Create an interval timer whose first expiration occurs at a given point in time and
+ * whose subsequent expirations occur after a specified interval.
+ *
+ * @param initialExpiration The point in time at which the first timer expiration must occur.
+ * @param intervalDuration The number of milliseconds that must elapse between timer
+ * expiration notifications. Expiration notifications are
+ * scheduled relative to the time of the first expiration. If
+ * expiration is delayed(e.g. due to the interleaving of other
+ * method calls on the bean) two or more expiration notifications
+ * may occur in close succession to "catch up".
+ * @param timerConfig Timer configuration.
+ *
+ * @return The newly created Timer.
+ *
+ * @throws IllegalArgumentException If initialExpiration is null, or initialExpiration.getTime()
+ * is negative, or intervalDuration is negative.
+ * @throws IllegalStateException If this method is invoked while the instance is in
+ * a state that does not allow access to this method.
+ * @throws EJBException If this method could not complete due to a system-level failure.
+ * @since 3.1
+ **/
+ public Timer createTimer( Date initialExpiration, long intervalDuration, TimerConfig timerConfig )
+ throws
+ IllegalArgumentException,
+ IllegalStateException,
+ EJBException;
+
+ /**
+ * Create a calendar-based timer based on the input schedule expression.
+ *
+ * @param schedule A schedule expression describing the timeouts for this timer.
+ * @param info Application information to be delivered along with the timer
+ * expiration. This can be null.
+ * @return The newly created Timer.
+ * @throws IllegalArgumentException If Schedule represents an invalid schedule
+ * expression.
+ * @throws IllegalStateException If this method is invoked while the instance
+ * is in a state that does not allow access to this method.
+ * @throws EJBException If this method could not complete due to a system-level failure.
+ * @since 3.1
+ */
+ Timer createTimer(ScheduleExpression schedule, Serializable info)
+ throws IllegalArgumentException, IllegalStateException, EJBException;
+
+ /**
+ * Create a calendar-based timer based on the input schedule expression.
+ *
+ * @param schedule A schedule expression describing the timeouts for this timer.
+ * @param timerConfig Timer configuration.
+ * @return The newly created Timer.
+ * @throws IllegalArgumentException If Schedule represents an invalid schedule
+ * expression.
+ * @throws IllegalStateException If this method is invoked while the instance
+ * is in a state that does not allow access to this method.
+ * @throws EJBException If this method could not complete due to a system-level failure.
+ * @since 3.1
+ */
+ Timer createTimer(ScheduleExpression schedule, TimerConfig timerConfig)
+ throws IllegalArgumentException, IllegalStateException, EJBException;
+
+ /**
* Get all the active timers associated with this bean.
*
* @return A collection of javax.ejb.Timer objects.
Added: projects/ejb3/trunk/api/src/main/java/org/jboss/ejb3/api/spi/EJBContainerProvider.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/org/jboss/ejb3/api/spi/EJBContainerProvider.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/org/jboss/ejb3/api/spi/EJBContainerProvider.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -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.api.spi;
+
+import java.util.Map;
+
+import javax.ejb.EJBContainer;
+import javax.ejb.EJBException;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface EJBContainerProvider
+{
+ EJBContainer createEJBContainer(Map<?, ?> properties, String... modules) throws EJBException;
+}
Added: projects/ejb3/trunk/api/src/main/java/org/jboss/ejb3/api/spi/EJBContainerWrapper.java
===================================================================
--- projects/ejb3/trunk/api/src/main/java/org/jboss/ejb3/api/spi/EJBContainerWrapper.java (rev 0)
+++ projects/ejb3/trunk/api/src/main/java/org/jboss/ejb3/api/spi/EJBContainerWrapper.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,54 @@
+/*
+ * 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.api.spi;
+
+import javax.ejb.EJBContainer;
+
+/**
+ * Provides a simple wrapper around an EJBContainer to see whether
+ * is has been closed.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class EJBContainerWrapper extends EJBContainer
+{
+ private boolean closed = false;
+ private EJBContainer delegate;
+
+ public EJBContainerWrapper(EJBContainer delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public void close()
+ {
+ this.closed = true;
+ delegate.close();
+ }
+
+ public boolean isClosed()
+ {
+ return closed;
+ }
+}
Added: projects/ejb3/trunk/api/src/test/java/org/jboss/ejb3/api/test/embedded/JBossEJBContainer.java
===================================================================
--- projects/ejb3/trunk/api/src/test/java/org/jboss/ejb3/api/test/embedded/JBossEJBContainer.java (rev 0)
+++ projects/ejb3/trunk/api/src/test/java/org/jboss/ejb3/api/test/embedded/JBossEJBContainer.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -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.api.test.embedded;
+
+import java.util.Map;
+
+import javax.ejb.EJBContainer;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class JBossEJBContainer extends EJBContainer
+{
+ /**
+ * @param properties
+ * @param modules
+ */
+ protected JBossEJBContainer(Map<?, ?> properties, String[] modules)
+ {
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public void close()
+ {
+ }
+}
Added: projects/ejb3/trunk/api/src/test/java/org/jboss/ejb3/api/test/embedded/JBossEJBContainerProvider.java
===================================================================
--- projects/ejb3/trunk/api/src/test/java/org/jboss/ejb3/api/test/embedded/JBossEJBContainerProvider.java (rev 0)
+++ projects/ejb3/trunk/api/src/test/java/org/jboss/ejb3/api/test/embedded/JBossEJBContainerProvider.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,41 @@
+/*
+ * 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.api.test.embedded;
+
+import java.util.Map;
+
+import javax.ejb.EJBContainer;
+import javax.ejb.EJBException;
+
+import org.jboss.ejb3.api.spi.EJBContainerProvider;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class JBossEJBContainerProvider implements EJBContainerProvider
+{
+ public EJBContainer createEJBContainer(Map<?, ?> properties, String... modules) throws EJBException
+ {
+ return new JBossEJBContainer(properties, modules);
+ }
+}
Added: projects/ejb3/trunk/api/src/test/java/org/jboss/ejb3/api/test/embedded/unit/EJBContainerTestCase.java
===================================================================
--- projects/ejb3/trunk/api/src/test/java/org/jboss/ejb3/api/test/embedded/unit/EJBContainerTestCase.java (rev 0)
+++ projects/ejb3/trunk/api/src/test/java/org/jboss/ejb3/api/test/embedded/unit/EJBContainerTestCase.java 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1,55 @@
+/*
+ * 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.api.test.embedded.unit;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import javax.ejb.EJBContainer;
+
+import org.junit.Test;
+
+/**
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class EJBContainerTestCase
+{
+ @Test
+ public void testCurrentEJBContainer()
+ {
+ EJBContainer container = EJBContainer.createEJBContainer();
+ assertNotNull(container);
+ assertEquals(container, EJBContainer.getCurrentEJBContainer());
+ container.close();
+ assertNull("CurrentEJBContainer should be null after close", EJBContainer.getCurrentEJBContainer());
+ }
+
+ @Test
+ public void testSimpleCreate()
+ {
+ EJBContainer container = EJBContainer.createEJBContainer();
+ assertNotNull(container);
+ container.close();
+ }
+}
Added: projects/ejb3/trunk/api/src/test/resources/META-INF/services/org.jboss.ejb3.api.spi.EJBContainerProvider
===================================================================
--- projects/ejb3/trunk/api/src/test/resources/META-INF/services/org.jboss.ejb3.api.spi.EJBContainerProvider (rev 0)
+++ projects/ejb3/trunk/api/src/test/resources/META-INF/services/org.jboss.ejb3.api.spi.EJBContainerProvider 2008-09-05 13:08:33 UTC (rev 78081)
@@ -0,0 +1 @@
+org.jboss.ejb3.api.test.embedded.JBossEJBContainerProvider
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list