├── .gitignore ├── .travis.yml ├── 4.0-PLAN.adoc ├── CONTRIBUTING.md ├── LICENSE.md ├── NOTICE.md ├── README.md ├── api ├── pom.xml └── src │ └── main │ ├── java │ ├── jakarta │ │ └── ejb │ │ │ ├── AccessLocalException.java │ │ │ ├── AccessTimeout.java │ │ │ ├── ActivationConfigProperty.java │ │ │ ├── AfterBegin.java │ │ │ ├── AfterCompletion.java │ │ │ ├── ApplicationException.java │ │ │ ├── AsyncResult.java │ │ │ ├── Asynchronous.java │ │ │ ├── BeforeCompletion.java │ │ │ ├── ConcurrencyManagement.java │ │ │ ├── ConcurrencyManagementType.java │ │ │ ├── ConcurrentAccessException.java │ │ │ ├── ConcurrentAccessTimeoutException.java │ │ │ ├── CreateException.java │ │ │ ├── DependsOn.java │ │ │ ├── DuplicateKeyException.java │ │ │ ├── EJB.java │ │ │ ├── EJBAccessException.java │ │ │ ├── EJBContext.java │ │ │ ├── EJBException.java │ │ │ ├── EJBHome.java │ │ │ ├── EJBLocalHome.java │ │ │ ├── EJBLocalObject.java │ │ │ ├── EJBMetaData.java │ │ │ ├── EJBObject.java │ │ │ ├── EJBTransactionRequiredException.java │ │ │ ├── EJBTransactionRolledbackException.java │ │ │ ├── EJBs.java │ │ │ ├── EnterpriseBean.java │ │ │ ├── EntityBean.java │ │ │ ├── EntityContext.java │ │ │ ├── FinderException.java │ │ │ ├── Handle.java │ │ │ ├── HomeHandle.java │ │ │ ├── IllegalLoopbackException.java │ │ │ ├── Init.java │ │ │ ├── Local.java │ │ │ ├── LocalBean.java │ │ │ ├── LocalHome.java │ │ │ ├── Lock.java │ │ │ ├── LockType.java │ │ │ ├── MessageDriven.java │ │ │ ├── MessageDrivenBean.java │ │ │ ├── MessageDrivenContext.java │ │ │ ├── NoMoreTimeoutsException.java │ │ │ ├── NoSuchEJBException.java │ │ │ ├── NoSuchEntityException.java │ │ │ ├── NoSuchObjectLocalException.java │ │ │ ├── ObjectNotFoundException.java │ │ │ ├── PostActivate.java │ │ │ ├── PrePassivate.java │ │ │ ├── Remote.java │ │ │ ├── RemoteHome.java │ │ │ ├── Remove.java │ │ │ ├── RemoveException.java │ │ │ ├── Schedule.java │ │ │ ├── ScheduleExpression.java │ │ │ ├── Schedules.java │ │ │ ├── SessionBean.java │ │ │ ├── SessionContext.java │ │ │ ├── SessionSynchronization.java │ │ │ ├── Singleton.java │ │ │ ├── Startup.java │ │ │ ├── Stateful.java │ │ │ ├── StatefulTimeout.java │ │ │ ├── Stateless.java │ │ │ ├── TimedObject.java │ │ │ ├── Timeout.java │ │ │ ├── Timer.java │ │ │ ├── TimerConfig.java │ │ │ ├── TimerHandle.java │ │ │ ├── TimerService.java │ │ │ ├── TransactionAttribute.java │ │ │ ├── TransactionAttributeType.java │ │ │ ├── TransactionManagement.java │ │ │ ├── TransactionManagementType.java │ │ │ ├── TransactionRequiredLocalException.java │ │ │ ├── TransactionRolledbackLocalException.java │ │ │ ├── embeddable │ │ │ ├── EJBContainer.java │ │ │ └── package.html │ │ │ ├── package.html │ │ │ └── spi │ │ │ ├── EJBContainerProvider.java │ │ │ ├── HandleDelegate.java │ │ │ └── package.html │ └── module-info.java │ └── javadoc │ └── doc-files │ └── EFSL.html ├── assembly.xml ├── pom.xml └── spec ├── README.md ├── assembly.xml ├── pom.xml └── src └── main ├── asciidoc ├── core │ ├── ClientViewOfSessionBean.adoc │ ├── CompatibilityAndMigration.adoc │ ├── DeploymentDescriptor.adoc │ ├── EBCore.adoc │ ├── EmbeddableUsage.adoc │ ├── EnterpriseBeanEnvironment.adoc │ ├── ExceptionHandling.adoc │ ├── Interceptors.adoc │ ├── Introduction.adoc │ ├── MessageDrivenBeanComponentContract.adoc │ ├── Overview.adoc │ ├── Packaging.adoc │ ├── Persistence.adoc │ ├── RelatedDocuments.adoc │ ├── ResponsibilitiesOfEJBRoles.adoc │ ├── RevisionHistory.adoc │ ├── RuntimeEnvironment.adoc │ ├── SecurityManagement.adoc │ ├── SessionBeanComponentContract.adoc │ ├── SupportForTransactions.adoc │ └── TimerService.adoc ├── enterprise-beans-spec-core.adoc ├── enterprise-beans-spec-opt.adoc ├── images │ ├── EBCore-10.svg │ ├── EBCore-11.svg │ ├── EBCore-12.svg │ ├── EBCore-13.svg │ ├── EBCore-14.svg │ ├── EBCore-15.svg │ ├── EBCore-16.svg │ ├── EBCore-17.svg │ ├── EBCore-18.svg │ ├── EBCore-19.svg │ ├── EBCore-20.svg │ ├── EBCore-21.svg │ ├── EBCore-22.svg │ ├── EBCore-23.svg │ ├── EBCore-24.svg │ ├── EBCore-25.svg │ ├── EBCore-26.svg │ ├── EBCore-27.svg │ ├── EBCore-6.svg │ ├── EBCore-7.svg │ ├── EBCore-8.svg │ ├── EBCore-9.svg │ ├── EBOpt-10.svg │ ├── EBOpt-11.svg │ ├── EBOpt-12.svg │ ├── EBOpt-13.svg │ ├── EBOpt-14.svg │ ├── EBOpt-15.svg │ ├── EBOpt-16.svg │ ├── EBOpt-17.svg │ ├── EBOpt-18.svg │ ├── EBOpt-19.svg │ ├── EBOpt-20.svg │ ├── EBOpt-21.svg │ ├── EBOpt-22.svg │ ├── EBOpt-23.svg │ ├── EBOpt-24.svg │ ├── EBOpt-25.svg │ ├── EBOpt-26.svg │ ├── EBOpt-27.svg │ ├── EBOpt-28.svg │ ├── EBOpt-29.svg │ ├── EBOpt-30.svg │ ├── EBOpt-31.svg │ ├── EBOpt-32.svg │ ├── EBOpt-33.svg │ ├── EBOpt-34.svg │ ├── EBOpt-35.svg │ ├── EBOpt-36.svg │ ├── EBOpt-37.svg │ ├── EBOpt-38.svg │ ├── EBOpt-39.svg │ ├── EBOpt-40.svg │ ├── EBOpt-41.svg │ ├── EBOpt-42.svg │ ├── EBOpt-6.svg │ ├── EBOpt-7.svg │ ├── EBOpt-8.svg │ ├── EBOpt-9.svg │ └── jakarta_ee_logo_schooner_color_stacked_default.png ├── license-efsl.adoc └── opt │ ├── ClientViewOfEntityBean.adoc │ ├── DeploymentDescriptor.adoc │ ├── EBOpt.adoc │ ├── EJB1.1EntityBeanComponentContractForContainerManagedPersistence.adoc │ ├── EJB2.1EntityBeanComponentContractForBeanManagedPersistence.adoc │ ├── EJB2.1EntityBeanComponentContractForContainerManagedPersistence.adoc │ ├── EJBQL-EJB2.1QueryLanguageForContainerManagedPersistenceQueryMethods.adoc │ ├── ExceptionHandling.adoc │ ├── Introduction.adoc │ ├── Overview.adoc │ ├── PackagingRestrictions.adoc │ ├── RelatedDocuments.adoc │ ├── RevisionHistory.adoc │ ├── SupportForTransactions.adoc │ └── TimerService.adoc └── theme └── jakartaee-theme.yml /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | .idea 3 | *.iml 4 | .java-version -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: openjdk8 3 | 4 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Jakarta Enterprise Beans 2 | 3 | Thanks for your interest in this project. 4 | 5 | ## Project description 6 | 7 | Jakarta Enterprise Beans is an architecture for the development and deployment of 8 | component-based business applications. 9 | 10 | * https://projects.eclipse.org/projects/ee4j.ejb 11 | 12 | ## Developer resources 13 | 14 | Information regarding source code management, builds, coding standards, and 15 | more. 16 | 17 | * https://projects.eclipse.org/projects/ee4j.ejb/developer 18 | 19 | The project maintains the following source code repositories 20 | 21 | * https://github.com/jakartaee/enterprise-beans 22 | 23 | ## Eclipse Contributor Agreement 24 | 25 | Before your contribution can be accepted by the project team contributors must 26 | electronically sign the Eclipse Contributor Agreement (ECA). 27 | 28 | * http://www.eclipse.org/legal/ECA.php 29 | 30 | Commits that are provided by non-committers must have a Signed-off-by field in 31 | the footer indicating that the author is aware of the terms by which the 32 | contribution has been provided to the project. The non-committer must 33 | additionally have an Eclipse Foundation account and must have a signed Eclipse 34 | Contributor Agreement (ECA) on file. 35 | 36 | For more information, please see the Eclipse Committer Handbook: 37 | https://www.eclipse.org/projects/handbook/#resources-commit 38 | 39 | ## Eclipse Development Process 40 | 41 | This Eclipse Foundation open project is governed by the Eclipse Foundation 42 | Development Process and operates under the terms of the Eclipse IP Policy. 43 | 44 | The Jakarta EE Specification Committee has adopted the Jakarta EE Specification 45 | Process (JESP) in accordance with the Eclipse Foundation Specification Process 46 | v1.2 (EFSP) to ensure that the specification process is complied with by all 47 | Jakarta EE specification projects. 48 | 49 | * https://eclipse.org/projects/dev_process 50 | * https://www.eclipse.org/org/documents/Eclipse_IP_Policy.pdf 51 | * https://jakarta.ee/about/jesp/ 52 | * https://www.eclipse.org/legal/efsp_non_assert.php 53 | 54 | ## Contact 55 | 56 | Contact the project developers via the project's "dev" list. 57 | 58 | * https://accounts.eclipse.org/mailing-list/ejb-dev 59 | -------------------------------------------------------------------------------- /NOTICE.md: -------------------------------------------------------------------------------- 1 | # Notices for Jakarta Enterprise Beans 2 | 3 | This content is produced and maintained by the Jakarta Enterprise Beans project. 4 | 5 | * Project home: https://projects.eclipse.org/projects/ee4j.ejb 6 | 7 | ## Trademarks 8 | 9 | Jakarta Enterprise Beans is a trademark of the Eclipse Foundation. 10 | 11 | ## Copyright 12 | 13 | All content is the property of the respective authors or their employers. For 14 | more information regarding authorship of content, please consult the listed 15 | source code repository logs. 16 | 17 | ## Declared Project Licenses 18 | 19 | This program and the accompanying materials are made available under the terms 20 | of the Eclipse Public License v. 2.0 which is available at 21 | http://www.eclipse.org/legal/epl-2.0. This Source Code may also be made 22 | available under the following Secondary Licenses when the conditions for such 23 | availability set forth in the Eclipse Public License v. 2.0 are satisfied: GNU 24 | General Public License, version 2 with the GNU Classpath Exception which is 25 | available at https://www.gnu.org/software/classpath/license.html. 26 | 27 | SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 28 | 29 | ## Source Code 30 | 31 | The project maintains the following source code repositories: 32 | 33 | * https://github.com/jakartaee/enterprise-beans 34 | 35 | ## Third-party Content 36 | 37 | ## Cryptography 38 | 39 | Content may contain encryption software. The country in which you are currently 40 | may have restrictions on the import, possession, and use, and/or re-export to 41 | another country, of encryption software. BEFORE using any encryption software, 42 | please check the country's laws, regulations and policies concerning the import, 43 | possession, or use, and re-export of encryption software, to see if this is 44 | permitted. 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Jakarta Enterprise Beans API 2 | 3 | This is the repository for Jakarta Enterprise Beans API. 4 | 5 | ## Build 6 | 7 | Use the following command: 8 | ```bash 9 | mvn clean install 10 | ``` 11 | 12 | ## Licensing 13 | 14 | - [Eclipse Public License v. 2.0](http://www.eclipse.org/legal/epl-2.0) 15 | - [GPL2 with Classpath Exception](https://www.gnu.org/software/classpath/license.html) 16 | 17 | ## Links 18 | 19 | - Official web site: https://github.com/jakartaee/enterprise-beans 20 | 21 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/AccessLocalException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | /** 20 | * An AccessLocalException is thrown to indicate that the caller does not have permission to call the method. This 21 | * exception is thrown to local clients. 22 | * 23 | * @since EJB 2.0 24 | */ 25 | public class AccessLocalException extends EJBException { 26 | 27 | private static final long serialVersionUID = -4089104928924996726L; 28 | 29 | /** 30 | * Constructs an AccessLocalException with no detail message. 31 | */ 32 | public AccessLocalException() { 33 | } 34 | 35 | /** 36 | * Constructs an AccessLocalException with the specified detail message. 37 | * 38 | * @param message a {@link java.lang.String} object. 39 | */ 40 | public AccessLocalException(String message) { 41 | super(message); 42 | } 43 | 44 | /** 45 | * Constructs an AccessLocalException with the specified detail message and a nested exception. 46 | * 47 | * @param message a {@link java.lang.String} object. 48 | * @param ex a {@link java.lang.Exception} object. 49 | */ 50 | public AccessLocalException(String message, Exception ex) { 51 | super(message, ex); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/AfterBegin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | import java.lang.annotation.Target; 20 | import static java.lang.annotation.ElementType.*; 21 | import java.lang.annotation.Retention; 22 | import static java.lang.annotation.RetentionPolicy.*; 23 | 24 | /** 25 | * Designate a stateful session bean method to receive the after begin session synchronization callback. 26 | *
27 | * 28 | * The after begin callback notifies a stateful session bean instance that a new transaction has started and that the 29 | * subsequent business methods on the instance will be invoked in the context of the transaction. 30 | *
31 | * This method executes in the proper transaction context.
32 | *
33 | * A bean must have at most one AfterBegin
method. The signature of this method must observe the following
34 | * rules:
35 | *
final
or static
.
37 | * void
.
39 | *
43 | * A stateful session bean class may use either the SessionSynchronization
interface or the session
44 | * synchronization annotations, but not both.
45 | *
46 | * @see SessionSynchronization
47 | * @see BeforeCompletion
48 | * @see AfterCompletion
49 | * @since EJB 3.1
50 | */
51 |
52 | @Target(METHOD)
53 | @Retention(RUNTIME)
54 | public @interface AfterBegin {
55 | }
56 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/AfterCompletion.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | import java.lang.annotation.Target;
20 | import static java.lang.annotation.ElementType.*;
21 | import java.lang.annotation.Retention;
22 | import static java.lang.annotation.RetentionPolicy.*;
23 |
24 | /**
25 | * Designate a stateful session bean method to receive the after completion session synchronization callback.
26 | *
27 | * 28 | * The after completion callback notifies a stateful session bean instance that a transaction commit protocol has 29 | * completed. A completion status of true indicates that the transaction has committed. A status of false indicates that 30 | * a rollback has occurred. 31 | *
32 | *
33 | * A bean must have at most one AfterCompletion
method. The signature of this method must observe the
34 | * following rules:
35 | *
final
or static
.
37 | * void
.
39 | * boolean
.
40 | * 43 | * This method executes with no transaction context. 44 | *
45 | * A stateful session bean class may use either the SessionSynchronization
interface or the session
46 | * synchronization annotations, but not both.
47 | *
48 | * @see SessionSynchronization
49 | * @see AfterBegin
50 | * @see BeforeCompletion
51 | * @since EJB 3.1
52 | */
53 |
54 | @Target(METHOD)
55 | @Retention(RUNTIME)
56 | public @interface AfterCompletion {
57 | }
58 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/ApplicationException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | import java.lang.annotation.Target;
20 | import static java.lang.annotation.ElementType.*;
21 | import java.lang.annotation.Retention;
22 | import static java.lang.annotation.RetentionPolicy.*;
23 |
24 | /**
25 | * Applied to an exception to denote that it is an application exception and should be reported to the client directly
26 | * (i.e., unwrapped).
27 | *
28 | * @since EJB 3.0
29 | */
30 |
31 | @Target(TYPE)
32 | @Retention(RUNTIME)
33 | public @interface ApplicationException {
34 |
35 | /**
36 | * Indicates whether the container should cause the transaction to rollback when the exception is thrown.
37 | *
38 | * @return a boolean.
39 | */
40 | boolean rollback() default false;
41 |
42 | /**
43 | * Indicates whether the application exception designation should apply to subclasses of the annotated exception class.
44 | *
45 | * @since EJB 3.1
46 | * @return a boolean.
47 | */
48 | boolean inherited() default true;
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/Asynchronous.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | import java.lang.annotation.Target;
20 | import static java.lang.annotation.ElementType.*;
21 | import java.lang.annotation.Retention;
22 | import static java.lang.annotation.RetentionPolicy.*;
23 |
24 | /**
25 | * Used to mark a session bean method as an asynchronous method or to designate all business methods of a session bean
26 | * class as asynchronous.
27 | *
28 | * An asychronous method must have return type void
or Future<V>
, where
29 | * V
is the result value type.
30 | *
31 | * Asynchronous method invocation semantics only apply to the no-interface, local business, and remote business client 32 | * views. Methods exposed through the enterprise bean 2.x local, enterprise bean 2.x remote, and web service client 33 | * views must not be designated as asynchronous. 34 | * 35 | * @see AsyncResult 36 | * @since EJB 3.1 37 | */ 38 | 39 | @Target({ METHOD, TYPE }) 40 | @Retention(RUNTIME) 41 | public @interface Asynchronous { 42 | } 43 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/BeforeCompletion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | import java.lang.annotation.Target; 20 | import static java.lang.annotation.ElementType.*; 21 | import java.lang.annotation.Retention; 22 | import static java.lang.annotation.RetentionPolicy.*; 23 | 24 | /** 25 | * Designate a stateful session bean method to receive the before completion session synchronization callback. 26 | *
27 | * 28 | * The before completion callback notifies a stateful session bean instance that a transaction is about to be committed. 29 | *
30 | * This method executes in the proper transaction context. 31 | * 32 | *
33 | * Note: The instance may still cause the container to rollback the transaction by invoking the
34 | * setRollbackOnly()
method on the session context or by throwing an exception.
35 | *
36 | * A bean must have at most one BeforeCompletion
method. The signature of this method must observe the
37 | * following rules:
38 | *
final
or static
.
40 | * void
.
42 | *
46 | * A stateful session bean class may use either the SessionSynchronization
interface or the session
47 | * synchronization annotations, but not both.
48 | *
49 | * @see SessionSynchronization
50 | * @see AfterBegin
51 | * @see AfterCompletion
52 | * @since EJB 3.1
53 | */
54 |
55 | @Target(METHOD)
56 | @Retention(RUNTIME)
57 | public @interface BeforeCompletion {
58 | }
59 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/ConcurrencyManagement.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | import java.lang.annotation.Target;
20 | import static java.lang.annotation.ElementType.*;
21 | import java.lang.annotation.Retention;
22 | import static java.lang.annotation.RetentionPolicy.*;
23 |
24 | /**
25 | * Declares a singleton session bean's concurrency management type.
26 | *
27 | *
28 | * If this annotation is not specified, the singleton bean is assumed to have container managed concurrency. 29 | * 30 | *
31 | * This annotation may be applied to stateful session beans, but doing so has no impact on the semantics of concurrency
32 | * management for such beans. The concurrency management type for bean-managed concurrency (BEAN
) does not
33 | * apply to stateful session beans.
34 | *
35 | * @see ConcurrencyManagementType
36 | * @see Lock
37 | * @since EJB 3.1
38 | */
39 |
40 | @Target({ TYPE })
41 | @Retention(RUNTIME)
42 | public @interface ConcurrencyManagement {
43 |
44 | /**
45 | *
value.
46 | * 47 | * @return a {@link jakarta.ejb.ConcurrencyManagementType} object. 48 | */ 49 | ConcurrencyManagementType value() default ConcurrencyManagementType.CONTAINER; 50 | 51 | } 52 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/ConcurrencyManagementType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | /** 20 | * Used to specify the value of theConcurrencyManagement
annotation for a singleton session bean.
21 | *
22 | * @see ConcurrencyManagement
23 | * @since EJB 3.1
24 | */
25 | public enum ConcurrencyManagementType {
26 | /**
27 | * Container is responsible for managing concurrent access to the bean instance.
28 | */
29 | CONTAINER,
30 |
31 | /**
32 | * Bean developer is responsible for managing concurrent access to the bean instance.
33 | */
34 | BEAN
35 | }
36 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/ConcurrentAccessException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | /**
20 | * A ConcurrentAccessException indicates that the client has attempted an invocation on a stateful session bean or
21 | * singleton bean while another invocation is in progress and such concurrent access is not allowed.
22 | *
23 | * @see AccessTimeout
24 | * @since EJB 3.1
25 | */
26 | public class ConcurrentAccessException extends EJBException {
27 |
28 | private static final long serialVersionUID = -8980855319866981477L;
29 |
30 | /**
31 | * Constructs an ConcurrentAccessException with no detail message.
32 | */
33 | public ConcurrentAccessException() {
34 | }
35 |
36 | /**
37 | * Constructs an ConcurrentAccessException with the specified detailed message.
38 | *
39 | * @param message a {@link java.lang.String} object.
40 | */
41 | public ConcurrentAccessException(String message) {
42 | super(message);
43 | }
44 |
45 | /**
46 | * Constructs an ConcurrentAccessException with the specified detail message and a nested exception.
47 | *
48 | * @param message a {@link java.lang.String} object.
49 | * @param ex a {@link java.lang.Exception} object.
50 | */
51 | public ConcurrentAccessException(String message, Exception ex) {
52 | super(message, ex);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/ConcurrentAccessTimeoutException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | /**
20 | * This exception indicates that an attempt to concurrently access a stateful session or singleton bean method resulted
21 | * in a timeout.
22 | *
23 | * @see AccessTimeout
24 | * @since EJB 3.1
25 | */
26 | public class ConcurrentAccessTimeoutException extends ConcurrentAccessException {
27 |
28 | private static final long serialVersionUID = 7899534274371798660L;
29 |
30 | /**
31 | * Constructor for ConcurrentAccessTimeoutException.
32 | */ 33 | public ConcurrentAccessTimeoutException() { 34 | } 35 | 36 | /** 37 | *Constructor for ConcurrentAccessTimeoutException.
38 | * 39 | * @param message a {@link java.lang.String} object. 40 | */ 41 | public ConcurrentAccessTimeoutException(String message) { 42 | super(message); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/CreateException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | /** 20 | * The CreateException exception must be included in the throws clauses of all create methods defined in an enterprise 21 | * bean's home or local home interface. 22 | * 23 | *24 | * This exception is used as a standard application-level exception to report a failure to create an enterprise bean 25 | * object or local object. 26 | * 27 | * @since EJB 1.0 28 | */ 29 | public class CreateException extends java.lang.Exception { 30 | 31 | private static final long serialVersionUID = 6295951740865457514L; 32 | 33 | /** 34 | * Constructs a CreateException with no detail message. 35 | */ 36 | public CreateException() { 37 | } 38 | 39 | /** 40 | * Constructs a CreateException with the specified detail message. 41 | * 42 | * @param message a {@link java.lang.String} object. 43 | */ 44 | public CreateException(String message) { 45 | super(message); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/DependsOn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | import java.lang.annotation.Target; 20 | import static java.lang.annotation.ElementType.*; 21 | import java.lang.annotation.Retention; 22 | import static java.lang.annotation.RetentionPolicy.*; 23 | 24 | /** 25 | * Used to express an initialization dependency between singleton components. 26 | *
27 | *
28 | * The container ensures that all singleton beans with which a singleton has a DependsOn
relationship have
29 | * been initialized before the singleton's PostConstruct
method is called.
30 | *
31 | * During application shutdown the container ensures that all singleton beans on with which the singleton has a
32 | * DependsOn
relationship are still available during the singleton's PreDestroy
method.
33 | *
34 | * @since EJB 3.1
35 | */
36 | @Target(TYPE)
37 | @Retention(RUNTIME)
38 | public @interface DependsOn {
39 |
40 | /**
41 | * The ejb-names of singleton components whose initialization must occur before this singleton. The order in which these
42 | * names are listed is not significant.
43 | *
44 | * @return an array of {@link java.lang.String} objects.
45 | */
46 | String[] value();
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/DuplicateKeyException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | /**
20 | * The DuplicateKeyException exception is thrown if an entity EJB object or enterprise bean local object cannot be
21 | * created because an object with the same key already exists. This exception is thrown by the create methods defined in
22 | * an entity bean's home or local home interface.
23 | *
24 | *
25 | * Note: Support for entity beans is optional as of EJB 3.2 26 | * 27 | * @since EJB 1.0 28 | */ 29 | public class DuplicateKeyException extends CreateException { 30 | 31 | private static final long serialVersionUID = -7287399994705270076L; 32 | 33 | /** 34 | * Constructs a DuplicateKeyException with no detail message. 35 | */ 36 | public DuplicateKeyException() { 37 | } 38 | 39 | /** 40 | * Constructs a DuplicateKeyException with the specified detail message. 41 | * 42 | * @param message a {@link java.lang.String} object. 43 | */ 44 | public DuplicateKeyException(String message) { 45 | super(message); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/EJBAccessException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | /** 20 | * This exception indicates that client access to a business method was denied. 21 | * 22 | * @since EJB 3.0 23 | */ 24 | public class EJBAccessException extends EJBException { 25 | 26 | private static final long serialVersionUID = 4923220329322198628L; 27 | 28 | /** 29 | * Constructs an EJBAccessException with no detail message. 30 | */ 31 | public EJBAccessException() { 32 | } 33 | 34 | /** 35 | * Constructs an EJBAccessException with the specified detailed message. 36 | * 37 | * @param message a {@link java.lang.String} object. 38 | */ 39 | public EJBAccessException(String message) { 40 | super(message); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/EJBException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | /** 20 | * The EJBException is thrown to report that the invoked business method or callback method could not be completed 21 | * because of an unexpected error (e.g. the instance failed to open a database connection). 22 | * 23 | * @since EJB 1.1 24 | */ 25 | public class EJBException extends java.lang.RuntimeException { 26 | 27 | private static final long serialVersionUID = 796770993296843510L; 28 | 29 | /** 30 | * Constructs an EJBException with no detail message. 31 | */ 32 | public EJBException() { 33 | } 34 | 35 | /** 36 | * Constructs an EJBException with the specified detailed message. 37 | * 38 | * @param message a {@link java.lang.String} object. 39 | */ 40 | public EJBException(String message) { 41 | super(message); 42 | } 43 | 44 | /** 45 | * Constructs an EJBException that embeds the originally thrown exception. 46 | * 47 | * @param ex a {@link java.lang.Exception} object. 48 | */ 49 | public EJBException(Exception ex) { 50 | super(ex); 51 | } 52 | 53 | /** 54 | * Constructs an EJBException that embeds the originally thrown exception with the specified detail message. 55 | * 56 | * @param message a {@link java.lang.String} object. 57 | * @param ex a {@link java.lang.Exception} object. 58 | */ 59 | public EJBException(String message, Exception ex) { 60 | super(message, ex); 61 | } 62 | 63 | /** 64 | * Obtain the exception that caused the EJBException to be thrown. It is recommended that the inherited 65 | * Throwable.getCause() method be used to retrieve the cause instead of this method. 66 | * 67 | * @return a {@link java.lang.Exception} object. 68 | */ 69 | public Exception getCausedByException() { 70 | return (Exception) getCause(); 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/EJBLocalHome.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | /** 20 | * The EJBLocalHome interface must be extended by all enterprise beans' local home interfaces. An enterprise bean's 21 | * local home interface defines the methods that allow local clients to create, find, and remove enterprise bean 22 | * objects. 23 | * 24 | *
25 | * The local home interface is defined by the enterprise bean provider and implemented by the enterprise bean container. 26 | *
27 | * Enterprise beans written to the EJB 3.0 and later APIs do not require a local home interface. 28 | * 29 | * @since EJB 2.0 30 | */ 31 | public interface EJBLocalHome { 32 | 33 | /** 34 | * Remove an enterprise bean object identified by its primary key. 35 | * 36 | *
37 | * This method can only be used by local clients of an entity bean. An attempt to call this method on a session bean 38 | * will result in a RemoveException. 39 | * 40 | *
41 | * Note: Support for entity beans is optional as of EJB 3.2. 42 | * 43 | * @param primaryKey the primary key of the enterprise bean object to be removed 44 | * @exception RemoveException Thrown if the enterprise bean or the container does not allow the client to remove the 45 | * object. 46 | * @exception EJBException Thrown when the method failed due to a system-level failure. 47 | */ 48 | void remove(Object primaryKey) throws RemoveException, EJBException; 49 | 50 | } 51 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/EJBMetaData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | /** 20 | * The EJBMetaData interface allows a client to obtain the enterprise bean's meta-data information. 21 | * 22 | *
23 | * The meta-data is intended for development tools used for building applications that use deployed enterprise beans, 24 | * and for clients using a scripting language to access the enterprise bean. 25 | * 26 | *
27 | * Note that the EJBMetaData is not a remote interface. The class that implements this interface (this class is
28 | * typically generated by container tools) must be serializable, and must be a valid RMI/IDL value type.
29 | *
30 | * @since EJB 1.0
31 | */
32 | public interface EJBMetaData {
33 | /**
34 | * Obtain the remote home interface of the enterprise bean.
35 | *
36 | * @return the remote home interface of the enterprise bean.
37 | */
38 | EJBHome getEJBHome();
39 |
40 | /**
41 | * Obtain the class object for the enterprise bean's remote home interface.
42 | *
43 | * @return the class object for the enterprise bean's remote home interface.
44 | */
45 | Class getHomeInterfaceClass();
46 |
47 | /**
48 | * Obtain the class object for the enterprise bean's remote interface.
49 | *
50 | * @return the class object for the enterprise bean's remote interface.
51 | */
52 | Class getRemoteInterfaceClass();
53 |
54 | /**
55 | * Obtain the class object for the enterprise bean's primary key class.
56 | *
57 | * @return the class object for the enterprise bean's primary key class.
58 | */
59 | Class getPrimaryKeyClass();
60 |
61 | /**
62 | * Test if the enterprise bean's type is "session".
63 | *
64 | * @return True if the type of the enterprise bean is session bean.
65 | */
66 | boolean isSession();
67 |
68 | /**
69 | * Test if the enterprise bean's type is "stateless session".
70 | *
71 | * @return True if the type of the enterprise Bean is stateless session.
72 | * @since EJB 1.1
73 | */
74 | boolean isStatelessSession();
75 | }
76 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/EJBTransactionRequiredException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | /**
20 | * This exception indicates that a request carried a null transaction context, but the target object requires an active
21 | * transaction.
22 | *
23 | * @since EJB 3.0
24 | */
25 | public class EJBTransactionRequiredException extends EJBException {
26 |
27 | private static final long serialVersionUID = 8880799605373282306L;
28 |
29 | /**
30 | * Constructs an EJBTransactionRequiredException with no detail message.
31 | */
32 | public EJBTransactionRequiredException() {
33 | }
34 |
35 | /**
36 | * Constructs an EJBTransactionRequiredException with the specified detailed message.
37 | *
38 | * @param message a {@link java.lang.String} object.
39 | */
40 | public EJBTransactionRequiredException(String message) {
41 | super(message);
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/EJBTransactionRolledbackException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | /**
20 | * This exception is thrown to a caller of bean business method to indicate that the transaction associated with processing of the
21 | * request has been rolled back, or marked to roll back. Thus the requested operation either could not be performed or
22 | * was not performed because further computation on behalf of the transaction would be fruitless.
23 | *
24 | * @since EJB 2.0
25 | */
26 | public class EJBTransactionRolledbackException extends EJBException {
27 |
28 | private static final long serialVersionUID = -8301720350425840333L;
29 |
30 | /**
31 | * Constructs an EJBTransactionRolledbackException with no detail message.
32 | */
33 | public EJBTransactionRolledbackException() {
34 | }
35 |
36 | /**
37 | * Constructs an EJBTransactionRolledbackException with the specified detailed message.
38 | *
39 | * @param message a {@link java.lang.String} object.
40 | */
41 | public EJBTransactionRolledbackException(String message) {
42 | super(message);
43 | }
44 |
45 | /**
46 | * Constructs an EJBTransactionRolledbackException with the specified detail message and a nested exception.
47 | *
48 | * @param message a {@link java.lang.String} object.
49 | * @param ex a {@link java.lang.Exception} object.
50 | */
51 | public EJBTransactionRolledbackException(String message, Exception ex) {
52 | super(message, ex);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/EJBs.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | import java.lang.annotation.Target;
20 | import static java.lang.annotation.ElementType.*;
21 | import java.lang.annotation.Retention;
22 | import static java.lang.annotation.RetentionPolicy.*;
23 |
24 | /**
25 | * Declares multiple EJB
annotations.
26 | *
27 | * @see EJB
28 | * @since EJB 3.0
29 | */
30 | @Target(TYPE)
31 | @Retention(RUNTIME)
32 | public @interface EJBs {
33 |
34 | /**
35 | *
value.
36 | * 37 | * @return an array of {@link jakarta.ejb.EJB} objects. 38 | */ 39 | EJB[] value(); 40 | } 41 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/EnterpriseBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | /** 20 | * The EnterpriseBean interface is a common superinterface for the SessionBean, EntityBean and MessageDrivenBean 21 | * interfaces. 22 | * 23 | * @see SessionBean 24 | * @see MessageDrivenBean 25 | * @see EntityBean 26 | * @since EJB 1.0 27 | */ 28 | public interface EnterpriseBean extends java.io.Serializable { 29 | } 30 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/FinderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | /** 20 | * The FinderException exception must be included in the throws clause of every finder method of an entity bean's home 21 | * or local home interface. 22 | * 23 | *24 | * The exception is used as a standard application-level exception to report a failure to find the requested enterprise 25 | * bean object(s). 26 | * 27 | *
28 | * Note: Support for entity beans is optional as of EJB 3.2.
29 | *
30 | * @since EJB 1.0
31 | */
32 | public class FinderException extends java.lang.Exception {
33 |
34 | private static final long serialVersionUID = 8785983102057433621L;
35 |
36 | /**
37 | * Constructs an FinderException with no detail message.
38 | */
39 | public FinderException() {
40 | }
41 |
42 | /**
43 | * Constructs an FinderException with the specified detail message.
44 | *
45 | * @param message a {@link java.lang.String} object.
46 | */
47 | public FinderException(String message) {
48 | super(message);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/Handle.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | import java.rmi.RemoteException;
20 |
21 | /**
22 | * The Handle interface is implemented by all enterprise bean object handles. A handle is an abstraction of a network
23 | * reference to an enterprise bean object. A handle is intended to be used as a "robust" persistent reference to an
24 | * enterprise bean object.
25 | *
26 | * @since EJB 1.0
27 | */
28 | public interface Handle extends java.io.Serializable {
29 | /**
30 | * Obtain the enterprise bean object reference represented by this handle.
31 | *
32 | * @return the enterprise bean object reference represented by this handle.
33 | * @exception RemoteException The enterprise bean object could not be obtained because of a system-level failure.
34 | */
35 | public EJBObject getEJBObject() throws RemoteException;
36 | }
37 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/HomeHandle.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | import java.rmi.RemoteException;
20 |
21 | /**
22 | * The HomeHandle interface is implemented by all home object handles. A handle is an abstraction of a network reference
23 | * to a home object. A handle is intended to be used as a "robust" persistent reference to a home object.
24 | *
25 | * @since EJB 1.1
26 | */
27 | public interface HomeHandle extends java.io.Serializable {
28 | /**
29 | * Obtain the home object represented by this handle.
30 | *
31 | * @return the home object represented by this handle.
32 | * @exception RemoteException The home object could not be obtained because of a system-level failure.
33 | */
34 | public EJBHome getEJBHome() throws RemoteException;
35 | }
36 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/IllegalLoopbackException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | /**
20 | * This exception indicates that an attempt was made to perform an illegal loopback invocation. One possible cause is a
21 | * loopback call to a singleton bean's container-managed concurrency Lock(WRITE)
method where the current
22 | * thread does not already hold a WRITE
lock.
23 | *
24 | * @since EJB 3.1
25 | */
26 | public class IllegalLoopbackException extends ConcurrentAccessException {
27 |
28 | private static final long serialVersionUID = -8854624128500916709L;
29 |
30 | /**
31 | *
Constructor for IllegalLoopbackException.
32 | */ 33 | public IllegalLoopbackException() { 34 | } 35 | 36 | /** 37 | *Constructor for IllegalLoopbackException.
38 | * 39 | * @param message a {@link java.lang.String} object. 40 | */ 41 | public IllegalLoopbackException(String message) { 42 | super(message); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/Init.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | import java.lang.annotation.RetentionPolicy; 20 | import java.lang.annotation.ElementType; 21 | 22 | import java.lang.annotation.Target; 23 | import java.lang.annotation.Retention; 24 | 25 | /** 26 | * Designates a method of a session bean that corresponds to acreate<METHOD>
method of an
27 | * adapted home or local home interface (an interface that adapts an enterprise bean 2.1 or earlier EJBHome or
28 | * EJBLocalHome client view respectively).
29 | *
30 | *
31 | * The result type of such an Init
method is required to be void
, and its parameter types must
32 | * be exactly the same as those of the referenced create<METHOD>
method(s).
33 | *
34 | *
35 | * An Init
method is only required to be specified for stateful session beans that provide a
36 | * RemoteHome
or LocalHome
interface.
37 | *
38 | *
39 | * The name of the adapted create<METHOD>
method of the home or local home interface must be
40 | * specified if the adapted interface has more than one create<METHOD>
method and the method
41 | * signatures are not the same.
42 | *
43 | * @see LocalHome
44 | * @see RemoteHome
45 | * @since EJB 3.0
46 | */
47 | @Target({ ElementType.METHOD })
48 | @Retention(RetentionPolicy.RUNTIME)
49 | public @interface Init {
50 |
51 | /**
52 | * The name of the corresponding create<METHOD>
method of the adapted home or local home
53 | * interface. This value is used to disambiguate the case where there are multiple create<METHOD>
54 | * methods on an adapted home and/or local home interface. If there are multiple create<METHOD>
55 | * methods on the adapted interface(s) and no value is specified, the create<METHOD>
matching is
56 | * based on signature only.
57 | *
58 | * Note that this value is not required to be specified if there is only a single create<METHOD>
59 | * method even if the name of the method to which the Init
annotation is applied does not match that of the
60 | * create<METHOD>
method.
61 | *
62 | * @return a {@link java.lang.String} object.
63 | */
64 | String value() default "";
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/LocalBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | import java.lang.annotation.Target;
20 | import static java.lang.annotation.ElementType.*;
21 | import java.lang.annotation.Retention;
22 | import static java.lang.annotation.RetentionPolicy.*;
23 |
24 | /**
25 | * Designates that a session bean exposes a no-interface view.
26 | *
27 | * This annotation is required if a session bean exposes any other client views (local, remote, no-interface, 2.x Remote
28 | * Home, 2.x Local Home, Web Service) in addition to the no-interface view or its implements clause contains an
29 | * interface other than java.io.Serializable
; java.io.Externalizable
; or any of the interfaces
30 | * defined by the jakarta.ejb
package.
31 | *
32 | * This annotation is optional if a session bean exposes only a no-interface view. 33 | * 34 | * @since EJB 3.1 35 | */ 36 | 37 | @Target({ TYPE }) 38 | @Retention(RUNTIME) 39 | public @interface LocalBean { 40 | } 41 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/LocalHome.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | import java.lang.annotation.RetentionPolicy; 20 | import java.lang.annotation.ElementType; 21 | 22 | import java.lang.annotation.Target; 23 | import java.lang.annotation.Retention; 24 | 25 | /** 26 | * Declares the local home or adapted local home interface for a session bean. 27 | *
28 | * Clients written to the enterprise bean 2.1 and earlier client view depend upon the existence of a home and component 29 | * interface. A session bean written to the enterprise bean 3.x API may be adapted to such earlier preexisting client 30 | * view interfaces. 31 | *
32 | * The session bean designates the local home interface to be adapted by using the LocalHome
annotation on
33 | * the bean class. The corresponding local component interface need not be explicitly specified, as it is derived from
34 | * the return type of local home interface's create method signature.
35 | *
36 | *
37 | * Session beans written to the EJB 3.0 and later APIs do not otherwise make use of local home interfaces. 38 | * 39 | * @see Init 40 | * @see RemoteHome 41 | * @since EJB 3.0 42 | */ 43 | 44 | @Target({ ElementType.TYPE }) 45 | @Retention(RetentionPolicy.RUNTIME) 46 | public @interface LocalHome { 47 | 48 | /** 49 | * The local home interface. 50 | * 51 | * @return a {@link java.lang.Class} object. 52 | */ 53 | Class value(); 54 | } 55 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/Lock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | import java.lang.annotation.Target; 20 | import static java.lang.annotation.ElementType.*; 21 | import java.lang.annotation.Retention; 22 | import static java.lang.annotation.RetentionPolicy.*; 23 | 24 | /** 25 | * Declares a concurrency lock for a singleton session bean with container managed concurrency. 26 | * 27 | *
28 | * This annotation may be specified on the bean class, the business methods of the bean class or both. Specifying the 29 | * annotation on a business method overrides the value specified at class level, if any. 30 | * 31 | *
32 | * If this annotation is not used, a value of Lock(WRITE)
is assumed.
33 | *
34 | * @since EJB 3.1
35 | */
36 |
37 | @Target({ TYPE, METHOD })
38 | @Retention(RUNTIME)
39 | public @interface Lock {
40 |
41 | /**
42 | *
value.
43 | * 44 | * @return a {@link jakarta.ejb.LockType} object. 45 | */ 46 | LockType value() default LockType.WRITE; 47 | 48 | } 49 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/LockType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | /** 20 | * Concurrency lock type for singleton beans with container-managed concurrency. 21 | * 22 | * @since EJB 3.1 23 | */ 24 | public enum LockType { 25 | 26 | /** 27 | * For read-only operations. Allows simultaneous access to methods designated asREAD
, as long as no
28 | * WRITE
lock is held.
29 | */
30 | READ,
31 |
32 | /**
33 | * For exclusive access to the bean instance. A WRITE
lock can only be acquired when no other method with
34 | * either a READ
or WRITE
lock is currently held.
35 | */
36 | WRITE
37 | }
38 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/MessageDriven.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * Component-defining annotation for a message driven bean.
26 | *
27 | * The message driven bean must implement the appropriate message listener interface for the messaging type that the
28 | * message-driven bean supports or specify the message listener interface using the
29 | * messageListenerInterface
element of this annotation.
30 | *
31 | * @see ActivationConfigProperty
32 | * @since EJB 3.0
33 | */
34 | @Target({ ElementType.TYPE })
35 | @Retention(RetentionPolicy.RUNTIME)
36 | public @interface MessageDriven {
37 |
38 | /**
39 | * The ejb-name for this bean. Defaults to the unqualified name of the message driven bean class.
40 | *
41 | * @return a {@link java.lang.String} object.
42 | */
43 | String name() default "";
44 |
45 | /**
46 | * Message-listener interface. If the message-driven bean class implements more than one interface other than
47 | * java.io.Serializable
, java.io.Externalizable
, or any of the interfaces defined by the
48 | * jakarta.ejb
package, the message listener interface must be specified.
49 | *
50 | * @return a {@link java.lang.Class} object.
51 | */
52 | Class messageListenerInterface() default Object.class;
53 |
54 | /**
55 | * Activation config properties.
56 | *
57 | * @return an array of {@link jakarta.ejb.ActivationConfigProperty} objects.
58 | */
59 | ActivationConfigProperty[] activationConfig() default {};
60 |
61 | /**
62 | * A product specific name(e.g. global JNDI name of a queue) that this message-driven bean should be mapped to.
63 | *
64 | * Application servers are not required to support any particular form or type of mapped name, nor the ability to use
65 | * mapped names. The mapped name is product-dependent and often installation-dependent. No use of a mapped name is
66 | * portable.
67 | *
68 | * @return a {@link java.lang.String} object.
69 | */
70 | String mappedName() default "";
71 |
72 | /**
73 | * A string describing the message driven bean.
74 | *
75 | * @return a {@link java.lang.String} object.
76 | */
77 | String description() default "";
78 | }
79 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/MessageDrivenBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | /**
20 | * The MessageDrivenBean interface defines methods that the enterprise bean container uses to notify a message driven
21 | * bean instance of the instance's life cycle events.
22 | *
23 | * As of EJB 3.0 it is no longer required that a message driven bean class implement this interface. 24 | * 25 | * @since EJB 2.0 26 | */ 27 | public interface MessageDrivenBean extends EnterpriseBean { 28 | /** 29 | * Set the associated message-driven context. The container calls this method after the instance creation. 30 | * 31 | *
32 | * The message driven bean instance should store the reference to the context object in an instance variable. 33 | * 34 | *
35 | * This method is called with no transaction context. 36 | * 37 | * @param ctx A MessageDrivenContext interface for the instance. 38 | * @exception EJBException Thrown by the method to indicate a failure caused by a system-level error. 39 | */ 40 | void setMessageDrivenContext(MessageDrivenContext ctx) throws EJBException; 41 | 42 | /** 43 | * A container invokes this method before it ends the life of the message-driven object. This happens when a container 44 | * decides to terminate the message-driven object. 45 | * 46 | *
47 | * This method is called with no transaction context.
48 | *
49 | * @exception EJBException Thrown by the method to indicate a failure caused by a system-level error.
50 | */
51 | void ejbRemove() throws EJBException;
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/MessageDrivenContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | /**
20 | * The MessageDrivenContext interface provides access to the runtime message-driven context that the container provides
21 | * for a message-driven bean instance. The container passes the MessageDrivenContext
interface to an
22 | * instance after the instance has been created. The message-driven context remains associated with the instance for the
23 | * lifetime of the instance.
24 | *
25 | * @since EJB 2.0
26 | */
27 | public interface MessageDrivenContext extends EJBContext {
28 | }
29 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/NoMoreTimeoutsException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | /**
20 | * This exception indicates that a calendar-based timer will not result in any more timeouts.
21 | *
22 | * @since EJB 3.1
23 | */
24 | public class NoMoreTimeoutsException extends EJBException {
25 |
26 | private static final long serialVersionUID = 1373788283844991998L;
27 |
28 | /**
29 | *
Constructor for NoMoreTimeoutsException.
30 | */ 31 | public NoMoreTimeoutsException() { 32 | } 33 | 34 | /** 35 | *Constructor for NoMoreTimeoutsException.
36 | * 37 | * @param message a {@link java.lang.String} object. 38 | */ 39 | public NoMoreTimeoutsException(String message) { 40 | super(message); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/NoSuchEJBException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | /** 20 | * A NoSuchEJBException is thrown if an attempt is made to invoke a business method on a stateful session or singleton 21 | * object that no longer exists. 22 | * 23 | * @since EJB 3.0 24 | */ 25 | public class NoSuchEJBException extends EJBException { 26 | 27 | private static final long serialVersionUID = -4861625171310593950L; 28 | 29 | /** 30 | * Constructs a NoSuchEJBException with no detail message. 31 | */ 32 | public NoSuchEJBException() { 33 | } 34 | 35 | /** 36 | * Constructs a NoSuchEJBException with the specified detail message. 37 | * 38 | * @param message a {@link java.lang.String} object. 39 | */ 40 | public NoSuchEJBException(String message) { 41 | super(message); 42 | } 43 | 44 | /** 45 | * Constructs a NoSuchEJBException with the specified detail message and a nested exception. 46 | * 47 | * @param message a {@link java.lang.String} object. 48 | * @param ex a {@link java.lang.Exception} object. 49 | */ 50 | public NoSuchEJBException(String message, Exception ex) { 51 | super(message, ex); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/NoSuchEntityException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | /** 20 | * The NoSuchEntityException exception is thrown by an entity bean instance to its container to report that the invoked 21 | * business method or callback method could not be completed because of the underlying entity was removed from the 22 | * database. 23 | * 24 | *
25 | * This exception may be thrown by the bean class methods that implement the business methods defined in the bean's
26 | * component interface and by the ejbLoad
and ejbStore
methods.
27 | *
28 | *
29 | * Note: Support for entity beans is optional as of EJB 3.2. 30 | * 31 | * @since EJB 1.1 32 | */ 33 | public class NoSuchEntityException extends EJBException { 34 | 35 | private static final long serialVersionUID = -4815730078295420703L; 36 | 37 | /** 38 | * @serial 39 | */ 40 | 41 | /** 42 | * Constructs a NoSuchEntityException with no detail message. 43 | */ 44 | public NoSuchEntityException() { 45 | } 46 | 47 | /** 48 | * Constructs a NoSuchEntityException with the specified detailed message. 49 | * 50 | * @param message a {@link java.lang.String} object. 51 | */ 52 | public NoSuchEntityException(String message) { 53 | super(message); 54 | } 55 | 56 | /** 57 | * Constructs a NoSuchEntityException that embeds the originally thrown exception. 58 | * 59 | * @param ex a {@link java.lang.Exception} object. 60 | */ 61 | public NoSuchEntityException(Exception ex) { 62 | super(ex); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/NoSuchObjectLocalException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | /** 20 | * A NoSuchObjectLocalException is thrown if an attempt is made to invoke a method on a local object (local enterprise 21 | * bean object or timer) that no longer exists. 22 | * 23 | * @since EJB 2.0 24 | */ 25 | public class NoSuchObjectLocalException extends EJBException { 26 | 27 | private static final long serialVersionUID = 9151491108833037318L; 28 | 29 | /** 30 | * Constructs a NoSuchObjectLocalException with no detail message. 31 | */ 32 | public NoSuchObjectLocalException() { 33 | } 34 | 35 | /** 36 | * Constructs a NoSuchObjectLocalException with the specified detail message. 37 | * 38 | * @param message a {@link java.lang.String} object. 39 | */ 40 | public NoSuchObjectLocalException(String message) { 41 | super(message); 42 | } 43 | 44 | /** 45 | * Constructs a NoSuchObjectLocalException with the specified detail message and a nested exception. 46 | * 47 | * @param message a {@link java.lang.String} object. 48 | * @param ex a {@link java.lang.Exception} object. 49 | */ 50 | public NoSuchObjectLocalException(String message, Exception ex) { 51 | super(message, ex); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/ObjectNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | /** 20 | * The ObjectNotFoundException exception is thrown by a finder or select method to indicate that the specified 21 | * enterprise bean object or local object does not exist. 22 | * 23 | *
24 | * Only the finder and select methods that are declared to return a single object use this exception. This exception 25 | * should not be thrown by finder or select methods that return a collection of objects (they should return an empty 26 | * collection instead). 27 | * 28 | * @since EJB 1.0 29 | */ 30 | public class ObjectNotFoundException extends FinderException { 31 | 32 | private static final long serialVersionUID = 4624364141026778L; 33 | 34 | /** 35 | * Constructs an ObjectNotFoundException with no detail message. 36 | */ 37 | public ObjectNotFoundException() { 38 | } 39 | 40 | /** 41 | * Constructs an ObjectNotFoundException with the specified detail message. 42 | * 43 | * @param message a {@link java.lang.String} object. 44 | */ 45 | public ObjectNotFoundException(String message) { 46 | super(message); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/PostActivate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | import java.lang.annotation.RetentionPolicy; 20 | import java.lang.annotation.ElementType; 21 | 22 | import java.lang.annotation.Target; 23 | import java.lang.annotation.Retention; 24 | 25 | /** 26 | * Designates a method to receive a callback after a stateful session bean has been activated. 27 | *
28 | * If the method to which this annotation is applied is defined on an interceptor class, it must have one of the 29 | * following signatures: 30 | * 31 | *
32 | * void <METHOD>(InvocationContext) 33 | * 34 | * Object <METHOD>(InvocationContext) throws Exception 35 | *36 | *
37 | * If the method to which this annotation is applied is defined on a target class, it must have the following signature: 38 | * 39 | *
40 | * void <METHOD>() 41 | *42 | * 43 | * The method can have public, private, protected, or package level access. It must not be declared as final or static. 44 | * 45 | * @since EJB 3.0 46 | */ 47 | 48 | @Target({ ElementType.METHOD }) 49 | @Retention(RetentionPolicy.RUNTIME) 50 | public @interface PostActivate { 51 | } 52 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/PrePassivate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | import java.lang.annotation.RetentionPolicy; 20 | import java.lang.annotation.ElementType; 21 | 22 | import java.lang.annotation.Target; 23 | import java.lang.annotation.Retention; 24 | 25 | /** 26 | * Designates a method to receive a callback before a stateful session bean is passivated. 27 | *
28 | * If the method to which this annotation is applied is defined on an interceptor class, it must have one of the 29 | * following signatures: 30 | * 31 | *
32 | * void <METHOD>(InvocationContext) 33 | * 34 | * Object <METHOD>(InvocationContext) throws Exception 35 | *36 | *
37 | * If the method to which this annotation is applied is defined on a target class, it must have the following signature: 38 | * 39 | *
40 | * void <METHOD>() 41 | *42 | * 43 | * The method can have public, private, protected, or package level access. It must not be declared as final or static. 44 | * 45 | * @since EJB 3.0 46 | */ 47 | 48 | @Target({ ElementType.METHOD }) 49 | @Retention(RetentionPolicy.RUNTIME) 50 | public @interface PrePassivate { 51 | } 52 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/Remote.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | import java.lang.annotation.RetentionPolicy; 20 | import java.lang.annotation.ElementType; 21 | 22 | import java.lang.annotation.Target; 23 | import java.lang.annotation.Retention; 24 | 25 | /** 26 | * Declares the remote business interface(s) for a session bean. 27 | *
28 | * The Remote
annotation is applied to the session bean class or remote business interface to designate a
29 | * remote business interface of the bean.
30 | *
31 | * When used on an interface, designates that interface as a remote business interface. In this case, no
32 | * value
element should be provided.
33 | *
34 | * The Remote
annotation applies only to session beans and their interfaces.
35 | *
36 | * @since EJB 3.0
37 | */
38 |
39 | @Target({ ElementType.TYPE })
40 | @Retention(RetentionPolicy.RUNTIME)
41 | public @interface Remote {
42 |
43 | /**
44 | * Specifies the remote business interface(s) of the bean. The value
element is specified only when the
45 | * annotation is applied to the bean class. It is only required to be specified if any of the following is true:
46 | *
Remote
annotation on the interface, and at least one other interface
51 | * (excluding java.io.Serializable
, java.io.Externalizable
, and any of the interfaces defined
52 | * by the jakarta.ejb
package) has no designation.
53 | * 29 | * Clients written to the enterprise bean 2.1 and earlier client view depend upon the existence of a home and component 30 | * interface. A session bean written to the enterprise bean 3.x API may be adapted to such earlier preexisting client 31 | * view interfaces. 32 | *
33 | * The session bean designates the home interface to be adapted by using the RemoteHome
annotation on the
34 | * bean class. The corresponding remote component interface need not be explicitly specified, as it is derived from the
35 | * return type of remote home interface's create method signature.
36 | *
37 | * Session beans written to the EJB 3.0 and later APIs do not otherwise make use of remote home interfaces.
38 | *
39 | * @see Init
40 | * @see LocalHome
41 | * @since EJB 3.0
42 | */
43 | @Target({ ElementType.TYPE })
44 | @Retention(RetentionPolicy.RUNTIME)
45 | public @interface RemoteHome {
46 |
47 | /**
48 | * The remote home interface
49 | *
50 | * @return a {@link java.lang.Class} object.
51 | */
52 | Class value();
53 | }
54 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/Remove.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | import java.lang.annotation.RetentionPolicy;
20 | import java.lang.annotation.ElementType;
21 |
22 | import java.lang.annotation.Target;
23 | import java.lang.annotation.Retention;
24 |
25 | /**
26 | * Applied to a business method of a stateful session bean class to indicate to the container that the stateful session
27 | * bean is to be removed by the container after completion of the method.
28 | *
29 | * @since EJB 3.0
30 | */
31 |
32 | @Target({ ElementType.METHOD })
33 | @Retention(RetentionPolicy.RUNTIME)
34 | public @interface Remove {
35 |
36 | /**
37 | * If true, the stateful session bean will not be removed if an exception is thrown from the designated method.
38 | *
39 | * @return a boolean.
40 | */
41 | boolean retainIfException() default false;
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/RemoveException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | /**
20 | * The RemoveException is thrown at an attempt to remove an enterprise bean object or local enterprise bean object when
21 | * the enterprise bean or the container does not allow the enterprise bean object to be removed.
22 | *
23 | * @since EJB 1.0
24 | */
25 | public class RemoveException extends java.lang.Exception {
26 |
27 | private static final long serialVersionUID = -4581849053220157910L;
28 |
29 | /**
30 | * Constructs an RemoveException with no detail message.
31 | */
32 | public RemoveException() {
33 | }
34 |
35 | /**
36 | * Constructs an RemoveException with the specified detail message.
37 | *
38 | * @param message a {@link java.lang.String} object.
39 | */
40 | public RemoveException(String message) {
41 | super(message);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/Schedules.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | import java.lang.annotation.Target;
20 | import static java.lang.annotation.ElementType.*;
21 | import java.lang.annotation.Retention;
22 | import static java.lang.annotation.RetentionPolicy.*;
23 |
24 | /**
25 | * Applied to a timer callback method to schedule multiple calendar-based timers for the method.
26 | *
27 | * The method to which the Schedules
annotation is applied must have one of the following signatures, where
28 | * <METHOD>
designates the method name:
29 | *
30 | *
31 | *
32 | * void <METHOD>() 33 | * void <METHOD>(Timer timer) 34 | *35 | * 36 | * @see Schedule 37 | * @since EJB 3.1 38 | */ 39 | @Target(METHOD) 40 | @Retention(RUNTIME) 41 | public @interface Schedules { 42 | 43 | /** 44 | * One or more calendar-based timer specifications. 45 | * 46 | * @return an array of {@link jakarta.ejb.Schedule} objects. 47 | */ 48 | Schedule[] value(); 49 | } 50 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/Singleton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | import java.lang.annotation.Target; 20 | import static java.lang.annotation.ElementType.*; 21 | import java.lang.annotation.Retention; 22 | import static java.lang.annotation.RetentionPolicy.*; 23 | 24 | /** 25 | * Component-defining annotation for a singleton session bean. 26 | * 27 | * @since EJB 3.1 28 | */ 29 | 30 | @Target(TYPE) 31 | @Retention(RUNTIME) 32 | public @interface Singleton { 33 | 34 | /** 35 | * The ejb-name for this bean. Defaults to the unqualified name of the singleton session bean class. 36 | * 37 | * @return a {@link java.lang.String} object. 38 | */ 39 | String name() default ""; 40 | 41 | /** 42 | * A product specific name(for example, global JNDI name) that this session bean should be mapped to. 43 | * 44 | * Application servers are not required to support any particular form or type of mapped name, nor the ability to use 45 | * mapped names. The mapped name is product-dependent and often installation-dependent. No use of a mapped name is 46 | * portable. 47 | * 48 | * @return a {@link java.lang.String} object. 49 | */ 50 | String mappedName() default ""; 51 | 52 | /** 53 | * A string describing the singleton session bean. 54 | * 55 | * @return a {@link java.lang.String} object. 56 | */ 57 | String description() default ""; 58 | } 59 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/Startup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | import java.lang.annotation.Target; 20 | import static java.lang.annotation.ElementType.*; 21 | import java.lang.annotation.Retention; 22 | import static java.lang.annotation.RetentionPolicy.*; 23 | 24 | /** 25 | * Mark a singleton bean for eager initialization during the application startup sequence. 26 | * 27 | * @since EJB 3.1 28 | */ 29 | 30 | @Target(TYPE) 31 | @Retention(RUNTIME) 32 | public @interface Startup { 33 | } 34 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/Stateful.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | import java.lang.annotation.Target; 20 | import static java.lang.annotation.ElementType.*; 21 | import java.lang.annotation.Retention; 22 | import static java.lang.annotation.RetentionPolicy.*; 23 | 24 | /** 25 | * Component-defining annotation for a stateful session bean. 26 | * 27 | * @since EJB 3.0 28 | */ 29 | 30 | @Target(TYPE) 31 | @Retention(RUNTIME) 32 | public @interface Stateful { 33 | 34 | /** 35 | * The ejb-name for this bean. Defaults to the unqualified name of the stateful session bean class. 36 | * 37 | * @return a {@link java.lang.String} object. 38 | */ 39 | String name() default ""; 40 | 41 | /** 42 | * A product specific name(e.g. global JNDI name) that this session bean should be mapped to. 43 | * 44 | * Application servers are not required to support any particular form or type of mapped name, nor the ability to use 45 | * mapped names. The mapped name is product-dependent and often installation-dependent. No use of a mapped name is 46 | * portable. 47 | * 48 | * @return a {@link java.lang.String} object. 49 | */ 50 | String mappedName() default ""; 51 | 52 | /** 53 | * A string describing the stateful session bean. 54 | * 55 | * @return a {@link java.lang.String} object. 56 | */ 57 | String description() default ""; 58 | 59 | /** 60 | * Specifies whether this stateful session bean is passivation capable 61 | * 62 | * @since EJB 3.2 63 | * @return a boolean. 64 | */ 65 | boolean passivationCapable() default true; 66 | 67 | } 68 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/StatefulTimeout.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | import java.lang.annotation.Target; 20 | import static java.lang.annotation.ElementType.*; 21 | import java.lang.annotation.Retention; 22 | import static java.lang.annotation.RetentionPolicy.*; 23 | 24 | import java.util.concurrent.TimeUnit; 25 | 26 | /** 27 | * Specifies the amount of time a stateful session bean can be idle (not receive any client invocations) before it is 28 | * eligible for removal by the container. 29 | *
30 | *
31 | * The semantics of the value
element are as follows:
32 | *
>
0 indicates a timeout value in the units specified by the unit
element.
34 | * >
0 indicates a timeout value in the units specified by the unit
element.
52 | * TimedObject
interface contains a callback method that is used to deliver timer expiration
21 | * notifications. It can be implemented by a stateless session bean class, a singleton session bean class, a
22 | * message-driven bean class, or an enterprise bean 2.x entity bean class.
23 | *
24 | * If the bean implements the TimedObject
interface, the Timeout
annotation, if used, can only
25 | * be applied to the ejbTimeout
method.
26 | *
27 | * @see Timeout
28 | * @since EJB 2.1
29 | */
30 | public interface TimedObject {
31 |
32 | /**
33 | * Invoked by the enterprise bean container upon timer expiration.
34 | *
35 | * @param timer timer whose expiration caused this notification.
36 | */
37 | public void ejbTimeout(Timer timer);
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/Timeout.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | import java.lang.annotation.Target;
20 | import static java.lang.annotation.ElementType.*;
21 | import java.lang.annotation.Retention;
22 | import static java.lang.annotation.RetentionPolicy.*;
23 |
24 | /**
25 | * Designates a method on a stateless session bean class, a singleton session bean class, a message driven bean class,
26 | * or an enterprise bean 2.x entity bean class that should receive enterprise bean timer expirations for that bean.
27 | *
28 | * The method to which the Timeout
annotation is applied must have one of the following signatures, where
29 | * <METHOD>
designates the method name:
30 | *
31 | *
32 | *
33 | * void <METHOD>() 34 | * void <METHOD>(Timer timer) 35 | *36 | * 37 | * A timeout callback method can have public, private, protected, or package level access. A timeout callback method 38 | * must not be declared as final or static. Timeout callback methods must not throw application exceptions. 39 | *
40 | * If the bean implements the TimedObject
interface, the Timeout
annotation can only be
41 | * applied to the ejbTimeout
method.
42 | *
43 | * @since EJB 3.0
44 | */
45 |
46 | @Target(METHOD)
47 | @Retention(RUNTIME)
48 | public @interface Timeout {
49 | }
50 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/TimerConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | import java.io.Serializable;
20 |
21 | /**
22 | *
23 | * TimerConfig is used to specify additional timer configuration settings during timer creation. 24 | *
25 | * 26 | *
27 | * The info
object represents a serializable object made available to corresponding timer callbacks. It is
28 | * optional and defaults to null
.
29 | *
32 | * The persistent
property determines whether the corresponding timer has a lifetime that spans the JVM in
33 | * which it was created. It is optional and defaults to true
.
34 | *
Constructor for TimerConfig.
42 | */ 43 | public TimerConfig() { 44 | } 45 | 46 | /** 47 | *Constructor for TimerConfig.
48 | * 49 | * @param info a {@link java.io.Serializable} object. 50 | * @param persistent a boolean. 51 | */ 52 | public TimerConfig(Serializable info, boolean persistent) { 53 | info_ = info; 54 | persistent_ = persistent; 55 | } 56 | 57 | /** 58 | * Set theinfo
object made available to timer callbacks.
59 | *
60 | * @param i the info object
61 | */
62 | public void setInfo(Serializable i) {
63 | info_ = i;
64 | }
65 |
66 | /**
67 | * Return the info
object made available to timer callbacks.
68 | *
69 | * @return info object
70 | */
71 | public Serializable getInfo() {
72 | return info_;
73 | }
74 |
75 | /**
76 | * Specify whether the timer is persistent.
77 | *
78 | * @param p boolean indicating whether the timer is to be persistent.
79 | */
80 | public void setPersistent(boolean p) {
81 | persistent_ = p;
82 | }
83 |
84 | /**
85 | * Return whether the timer is persistent.
86 | *
87 | * @return boolean indicating whether the timer is persistent
88 | */
89 | public boolean isPersistent() {
90 | return persistent_;
91 | }
92 |
93 | /** {@inheritDoc} */
94 | @Override
95 | public String toString() {
96 | return "TimerConfig [persistent=" + persistent_ + ";info=" + info_ + "]";
97 | }
98 |
99 | private Serializable info_ = null;
100 |
101 | private boolean persistent_ = true;
102 |
103 | }
104 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/TimerHandle.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | import java.io.Serializable;
20 |
21 | /**
22 | *
23 | * The TimerHandle interface allows the bean provider to obtain a serializable timer handle that may be persisted.
24 | *
25 | * Since timers are local objects, a timer handle must not be passed through a bean's remote business interface, remote
26 | * interface or web service interface.
27 | *
28 | * @since EJB 2.1
29 | */
30 | public interface TimerHandle extends Serializable {
31 |
32 | /**
33 | * Obtain a reference to the timer represented by this handle.
34 | *
35 | * @return a reference to the timer represented by this handle.
36 | * @exception java.lang.IllegalStateException If this method is invoked while the instance is in a state that does not
37 | * allow access to this method.
38 | * @throws jakarta.ejb.NoSuchObjectLocalException If invoked on a handle whose associated timer has expired or has been
39 | * cancelled.
40 | * @throws jakarta.ejb.EJBException If this method could not complete due to a system-level failure.
41 | */
42 | public Timer getTimer() throws java.lang.IllegalStateException,
43 | jakarta.ejb.NoSuchObjectLocalException, jakarta.ejb.EJBException;
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/TransactionAttribute.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | import java.lang.annotation.Target;
20 | import static java.lang.annotation.ElementType.*;
21 | import java.lang.annotation.Retention;
22 | import static java.lang.annotation.RetentionPolicy.*;
23 |
24 | /**
25 | * The TransactionAttribute
annotation specifies whether the container is to invoke a business method
26 | * within a transaction context.
27 | *
28 | * The TransactionAttribute
annotation can be used for session beans and message driven beans. It can only
29 | * be specified if container managed transaction demarcation is used.
30 | *
31 | * 32 | * The annotation can be specified on the bean class and/or it can be specified on methods of the class that are methods 33 | * of the business interface or no-interface view. 34 | *
35 | * Specifying the TransactionAttribute
annotation on the bean class means that it applies to all applicable
36 | * business methods of the class. Specifying the annotation on a method applies it to that method only. If the
37 | * annotation is applied at both the class and the method level, the method value overrides if the two disagree.
38 | *
39 | *
40 | * The values of the TransactionAttribute
annotation are defined by the enum
41 | * TransactionAttributeType
. If the TransactionAttribute
annotation is not specified, and the
42 | * bean uses container managed transaction demarcation, the semantics of the REQUIRED
transaction attribute
43 | * are assumed.
44 | *
45 | * @see TransactionAttributeType
46 | * @since EJB 3.0
47 | */
48 |
49 | @Target({ METHOD, TYPE })
50 | @Retention(RUNTIME)
51 | public @interface TransactionAttribute {
52 | /**
53 | *
value.
54 | * 55 | * @return a {@link jakarta.ejb.TransactionAttributeType} object. 56 | */ 57 | TransactionAttributeType value() default TransactionAttributeType.REQUIRED; 58 | } 59 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/TransactionManagement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | import java.lang.annotation.Target; 20 | import static java.lang.annotation.ElementType.*; 21 | import java.lang.annotation.Retention; 22 | import static java.lang.annotation.RetentionPolicy.*; 23 | 24 | /** 25 | * Specifies whether a session bean or message driven bean has container managed transactions or bean managed 26 | * transactions. 27 | * 28 | * If this annotation is not used, the bean is assumed to have container-managed transaction management. 29 | * 30 | * @see TransactionManagementType 31 | * @since EJB 3.0 32 | */ 33 | @Target(TYPE) 34 | @Retention(RUNTIME) 35 | public @interface TransactionManagement { 36 | /** 37 | *value.
38 | * 39 | * @return a {@link jakarta.ejb.TransactionManagementType} object. 40 | */ 41 | TransactionManagementType value() default TransactionManagementType.CONTAINER; 42 | } 43 | -------------------------------------------------------------------------------- /api/src/main/java/jakarta/ejb/TransactionManagementType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * This program and the accompanying materials are made available under the 5 | * terms of the Eclipse Public License v. 2.0, which is available at 6 | * http://www.eclipse.org/legal/epl-2.0. 7 | * 8 | * This Source Code may also be made available under the following Secondary 9 | * Licenses when the conditions for such availability set forth in the 10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License, 11 | * version 2 with the GNU Classpath Exception, which is available at 12 | * https://www.gnu.org/software/classpath/license.html. 13 | * 14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 15 | */ 16 | 17 | package jakarta.ejb; 18 | 19 | /** 20 | * The enumTransactionManagementType
is used with the TransactionManagement
annotation to
21 | * specify whether container-managed or bean-managed transaction management is used.
22 | *
23 | * @see TransactionManagement
24 | * @since EJB 3.0
25 | */
26 | public enum TransactionManagementType {
27 |
28 | /**
29 | * Container-managed transaction management is used.
30 | */
31 | CONTAINER,
32 |
33 | /**
34 | * Bean-managed transaction management is used.
35 | */
36 | BEAN
37 | }
38 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/TransactionRequiredLocalException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | /**
20 | * This exception is thrown to a local client to indicate that a request carried a null transaction context, but the
21 | * target object requires an active transaction.
22 | *
23 | * @since EJB 2.0
24 | */
25 | public class TransactionRequiredLocalException extends EJBException {
26 |
27 | private static final long serialVersionUID = -3884174204131319153L;
28 |
29 | /**
30 | * Constructs a TransactionRequiredLocalException with no detail message.
31 | */
32 | public TransactionRequiredLocalException() {
33 | }
34 |
35 | /**
36 | * Constructs an TransactionRequiredLocalException with the specified detailed message.
37 | *
38 | * @param message a {@link java.lang.String} object.
39 | */
40 | public TransactionRequiredLocalException(String message) {
41 | super(message);
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/TransactionRolledbackLocalException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb;
18 |
19 | /**
20 | * This exception is thrown to a local client to indicate that the transaction associated with processing of the request
21 | * has been rolled back, or marked to roll back. Thus the requested operation either could not be performed or was not
22 | * performed because further computation on behalf of the transaction would be fruitless.
23 | *
24 | * @since EJB 2.0
25 | */
26 | public class TransactionRolledbackLocalException extends EJBException {
27 |
28 | private static final long serialVersionUID = 2897658132751784821L;
29 |
30 | /**
31 | * Constructs a TransactionRolledbackLocalException with no detail message.
32 | */
33 | public TransactionRolledbackLocalException() {
34 | }
35 |
36 | /**
37 | * Constructs a TransactionRolledbackLocalException with the specified detailed message.
38 | *
39 | * @param message a {@link java.lang.String} object.
40 | */
41 | public TransactionRolledbackLocalException(String message) {
42 | super(message);
43 | }
44 |
45 | /**
46 | * Constructs a TransactionRolledbackLocalException with the specified detail message and a nested exception.
47 | *
48 | * @param message a {@link java.lang.String} object.
49 | * @param ex a {@link java.lang.Exception} object.
50 | */
51 | public TransactionRolledbackLocalException(String message, Exception ex) {
52 | super(message, ex);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/embeddable/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
21 |
22 |
23 |
24 |
25 | Defines the classes for the enterprise bean Embeddable API.
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
21 |
22 |
23 |
24 |
25 | Contains the Enterprise Bean classes
26 | and interfaces that define the contracts between the enterprise bean
27 | and its clients and between the enterprise bean and the enterprise bean container.
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/spi/EJBContainerProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2006, 2020 Oracle and/or its affiliates. All rights reserved.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 |
17 | package jakarta.ejb.spi;
18 |
19 | import java.util.Map;
20 | import jakarta.ejb.embeddable.EJBContainer;
21 | import jakarta.ejb.EJBException;
22 |
23 | /**
24 | * The EJBContainerProvider SPI is used by the embeddable container bootstrap class to initialize a suitable embeddable
25 | * container.
26 | *
27 | * @since EJB 3.1
28 | */
29 | public interface EJBContainerProvider {
30 |
31 | /**
32 | * Called by the embeddable container bootstrap process to find a suitable embeddable container implementation. An
33 | * embeddable container provider may deem itself as appropriate for the embeddable application if any of the following
34 | * are true :
35 | *
36 | * jakarta.ejb.embeddable.provider
property was included in the Map passed to
38 | * createEJBContainer
and the value of the property is the provider's implementation class.
39 | *
40 | * jakarta.ejb.embeddable.provider
property was specified.
41 | * jakarta.ejb.embeddable.EJBContainer#createEJBContainer(Map<?,?>)
call
47 | * @return EJBContainer instance or null
48 | * @throws EJBException if the container could not be successfully initialized.
49 | */
50 | public EJBContainer createEJBContainer(Map, ?> properties) throws EJBException;
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/api/src/main/java/jakarta/ejb/spi/package.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
21 |
22 |
23 |
24 |
25 | Defines interfaces that are implemented by
26 | the enterprise bean container. These interfaces are not used by application components.
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/api/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2021 Contributors to the Eclipse Foundation
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0, which is available at
6 | * http://www.eclipse.org/legal/epl-2.0.
7 | *
8 | * This Source Code may also be made available under the following Secondary
9 | * Licenses when the conditions for such availability set forth in the
10 | * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11 | * version 2 with the GNU Classpath Exception, which is available at
12 | * https://www.gnu.org/software/classpath/license.html.
13 | *
14 | * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15 | */
16 | /**
17 | * Defines the modules for jakarta.ejb
18 | */
19 | module jakarta.ejb {
20 | requires java.rmi;
21 | requires java.naming;
22 | requires transitive jakarta.transaction;
23 |
24 | exports jakarta.ejb;
25 | exports jakarta.ejb.embeddable;
26 | exports jakarta.ejb.spi;
27 | }
--------------------------------------------------------------------------------
/assembly.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |