Generated by GPT-5-mini| Jakarta Enterprise Beans | |
|---|---|
| Name | Jakarta Enterprise Beans |
| Other names | EJB |
| Developer | Jakarta EE Working Group |
| Initial release | 1999 |
| Latest release | Jakarta EE 10 |
| Programming language | Java |
| Platform | Jakarta EE |
| License | Various |
Jakarta Enterprise Beans Jakarta Enterprise Beans provide a server-side component architecture for building scalable, transactional, and secure multi-tier applications. Originally standardized for the Java 2 Platform, Enterprise Edition era, they integrate with numerous Jakarta EE technologies to offer reusable business logic deployed to application servers and run in managed environments.
Jakarta Enterprise Beans operate within application servers such as Apache Tomcat-integrated containers, WildFly, GlassFish, Payara Server, IBM WebSphere Application Server, Oracle WebLogic Server, JBoss EAP, and Apache Geronimo. They coordinate with specifications like Jakarta Persistence, Jakarta Contexts and Dependency Injection, Jakarta RESTful Web Services, Jakarta Transactions, Jakarta Security, and Jakarta Messaging. EJBs evolved alongside platforms such as Java EE and the Jakarta EE migration, influencing frameworks like Spring Framework, Hibernate, Apache Camel, and Quarkus. Standards bodies and organizations involved include the Eclipse Foundation, the Java Community Process, and vendors such as Oracle Corporation and Red Hat.
The EJB architecture relies on containers hosted by application servers such as WildFly and GlassFish which mediate services including lifecycle management, pooling, activation, passivation, and interceptors used by OpenEJB and MicroProfile implementations. Key components interact with Jakarta Naming and Directory Interface providers, LDAP directories, and resource connectors like Java Message Service providers and JDBC data sources from vendors including Oracle Corporation and Microsoft. Integration points include protocols and APIs such as RMI-IIOP, CORBA, JMS, and security realms tied to OAuth 2.0, SAML, and OpenID Connect providers like Keycloak.
Classic bean types include session beans (stateless and stateful), singleton beans, and message-driven beans. Stateless session beans compare to patterns used in EJB 2.0 and were contrasted with alternatives in Spring Framework and EJB 3.0 modernization efforts led by contributors from Sun Microsystems and BEA Systems. Stateful session beans support conversational state and checkpointing used in clusters like those managed by Red Hat clustering solutions and Oracle Coherence. Singleton beans serve as application-scoped components akin to constructs in OSGi and Akka. Message-driven beans integrate with Java Message Service providers and broker technologies such as Apache ActiveMQ, RabbitMQ, and Apache Kafka via adapters.
EJB programming uses annotations introduced in Java SE 5, including javax.ejb.Stateless, javax.ejb.Stateful, and javax.ejb.Singleton earlier standardized by groups from Sun Microsystems; in the Jakarta space these map to Jakarta Annotations and coordinator APIs. Developers combine EJBs with Jakarta Persistence entities managed by Hibernate or EclipseLink, and transaction contexts provided by Jakarta Transactions (JTA). Interceptors and lifecycle callbacks relate to concepts in AspectJ and inversion of control seen in Spring Framework. Remote interfaces historically used RMI-IIOP and CORBA stacks maintained by projects like IIOP implementers; modern approaches favor RESTful endpoints via Jakarta RESTful Web Services and microservices frameworks such as Quarkus and Micronaut.
Container-managed transactions use semantics defined by Jakarta Transactions with attributes such as REQUIRED and REQUIRES_NEW analogous to standards from JTA and coordinated by transaction managers found in JBoss Transaction Manager and Atomikos. Security integrates with Jakarta Security, declarative role-based constraints, and identity providers like Keycloak, Okta, and Ping Identity. Concurrency utilities rely on container services and patterns from java.util.concurrent and integrate with managed executor services influenced by JSR 236 and features standardized in later Jakarta EE releases. Clustering, failover, and load balancing are supported through application server features in Enterprise Linux deployments and orchestration platforms like Kubernetes and OpenShift.
EJB modules are packaged in archives such as .jar and bundled into .ear files alongside WAR modules, deployed to servers like GlassFish and WebLogic. Deployment descriptors and annotations use formats influenced by XML schema definitions and are processed by tools from Maven, Gradle, and build systems maintained by organizations like Apache Software Foundation. Configuration ties into resource adapters defined by Jakarta Connector (JCA) and external services including Oracle Database, PostgreSQL, MySQL, and cloud platforms from Amazon Web Services, Microsoft Azure, and Google Cloud Platform.
EJB originated in the late 1990s with contributions from vendors including IBM, BEA Systems, and Sun Microsystems as part of the Java Community Process under the JCP. Major revisions such as EJB 2.0 and EJB 3.0 redefined programming models, influenced by open-source projects like Hibernate, Apache Tomcat, and Spring Framework, and driven by standardization efforts that migrated APIs from the javax.* namespace to the jakarta.* namespace under stewardship of the Eclipse Foundation. The evolution reflects shifts toward lightweight containers, microservices architectures adopted by Netflix and Amazon.com, and cloud-native platforms like Kubernetes and OpenShift.