In this detailed Resource page, we feature an abundance of EJB Tutorials!
Enterprise JavaBeans (EJB) is one of several Java APIs for modular construction of enterprise software. EJB is a server-side software component that encapsulates business logic of an application. An EJB web container provides a runtime environment for web related software components, including computer security, Java servlet lifecycle management, transaction processing, and other web services. The EJB specification is a subset of the Java EE specification.
The EJB specification intends to provide a standard way to implement the server-side (also called “back-end”) ‘business’ software typically found in enterprise applications (as opposed to ‘front-end’ user interface software). Such machine code addresses the same types of problems, and solutions to these problems are often repeatedly re-implemented by programmers. Enterprise JavaBeans is intended to handle such common concerns as persistence, transactional integrity, and security in a standard way, leaving programmers free to concentrate on the particular parts of the enterprise software at hand.
The EJB specification details how an application server provides the following responsibilities:
- Transaction processing
- Integration with the persistence services offered by the Java Persistence API (JPA)
- Concurrency control
- Event-driven programming using Java Message Service and Java EE Connector Architecture
- Asynchronous method invocation
- Job scheduling
- Naming and directory services (JNDI)
- Interprocess Communication using RMI-IIOP and Web services
- Security (Java Cryptography Extension and Java Authentication and Authorization Service)
- Deployment of software components in an application server
Additionally, the Enterprise JavaBean specification defines the roles played by the EJB container and the EJBs as well as how to deploy the EJBs in a container. Note that the current EJB 3.2 specification does not detail how an application server provides persistence (a task delegated to the JPA specification), but instead details how business logic can easily integrate with the persistence services offered by the application server.
If you wish to build up your EJB knowledge first, check out our EJB Timer Service Example.
Java EJB Tutorials – Getting Started
Simple examples based on the JavaBeans
- Expose EJB as a Web Service
With this example we are going to demonstrate how to expose an EJB as a web service.
- Reference EJB in another EJB of different applications
This is an example of how to create a reference of an EJB in another EJB of different applications.
- Reference EJB in another EJB of the same application
In this example we shall show you how to get a reference of an EJB in another EJB of the same application.
- Bean managed Transactions
With this example we are going to demonstrate how to handle bean managed transactions using EJBs.
- Use Timer service example
This is an example of how to use the
javax.ejb.TimerServicein an EJB
- Stateful Session Bean to persist Entity
In this example we shall show you how to use a Stateful Session Bean to persist an Entity.
- Simple Stateless Session Bean example
With this example we are going to demonstrate how to create a simple Stateless Session Bean.
- Java EE Stateful Session Bean (EJB) example
In this article we are going to see how you can use Stateful Session Beans to keep track of state across a client Session in a simple Web Application.
- Java EE EJB Interceptors tutorial and example
In this example we are going to see how to use Interceptors in an EJB and test it using a simple Web Application.
- EJB passivation and activation example
In this tutorial we are going to see how activation and passivation works in a Stateful Java Enterprise Session Bean.
EJB Tutorials – Integrations
Learn how to use JavaBeans with other technologies
- GWT EJB3 Maven JBoss 5.1 integration tutorial
In this article we are going to demonstrate how to properly integrate GWT and EJB3 in order to implement an example project, build it using maven and deploy it on JBoss 5.1 application server.