Configuring Enterprise Java Beans - JBoss

The Enterprise Java Bean (EJB) container is a fundamental part of the Java Enterprise architecture. In a nutshell, the EJB container provides the environment used to host and manage the EJB components deployed in the container. The container is responsible for providing a standard set of services, including caching, concurrency, persistence, security, transaction management, and locking services.

The container also provides distributed access and lookup functions for hosted components, and it intercepts all method invocations on hosted components to enforce declarative security and transaction contexts.

Learn how to use JBOSS, from beginner basics to advanced techniques, with online video tutorials taught by industry experts. Enroll in the Free JBOSS Training Demo!

Learn Configuring Enterprise Java Beans - JBoss

EJB components

As depicted in this image, with JBoss AS 7, you will be able to deploy a rich set of EJB components:

Stateless session beans (SLSB): SLSB is an object whose instances have no conversational state. This means that all bean instances are equivalent when they are not servicing a client.

Stateful session beans (SFSB): SFSB supports conversational services with tightly coupled clients. A stateful session bean accomplishes a task for a particular client. It maintains a state for the duration of a client session. After session completion, the state is not retained.

 MindMajix YouTube Channel

Message-driven beans (MDB): MDB is a kind of Enterprise Beans that are able to asynchronously process messages sent by any JMS producer.

[Related Article: JBoss Interview Questions for Experienced]

Note

EJB components, which don’t keep conversational states (SLSB, MDB), can be optionally configured to emit timed notifications. See the section named Configuring the timer service for more information about it.

Besides the standard EJB components, the application server also supports the new EJB 3.1 variants introduced by Java EE 6, which are:

Singleton EJB: This is essentially similar to a stateless session bean, however, it uses a single instance to serve the client requests. Thus, you are guaranteed to use the same instance across invocations. Singletons can use a richer life-cycle set of events and a stricter locking policy to control concurrent access to the instance. In the next chapter, which is about Web applications, we will illustrate a Java EE 6 application that makes use of a Singleton to hold some cached data.

No-interface EJB: This is just another view of the standard session bean except that local clients do not require a separate interface, that is, all public methods of the bean class are automatically exposed to the caller.

Asynchronous EJB: These are able to process client requests asynchronously just like MDBs, except that they expose a typed interface and follow a more complex approach for processing client requests, which is composed of:

  • fire-and-forget asynchronous void methods, which are invoked by the client
  • retrieve-result-later asynchronous methods having FutureReturn

In the next chapter, which is about Web applications, we will illustrate a Java EE 6 application, which makes use of a Singleton to hold some cached data.

 

Job Support Program

Online Work Support for your on-job roles.

jobservice

Our work-support plans provide precise options as per your project tasks. Whether you are a newbie or an experienced professional seeking assistance in completing project tasks, we are here with the following plans to meet your custom needs:

  • Pay Per Hour
  • Pay Per Week
  • Monthly
Learn MoreGet Job Support
Course Schedule
NameDates
JBoss TrainingNov 19 to Dec 04View Details
JBoss TrainingNov 23 to Dec 08View Details
JBoss TrainingNov 26 to Dec 11View Details
JBoss TrainingNov 30 to Dec 15View Details
Last updated: 29 Apr 2023
About Author

As a content writer and storyteller, Raunaak Mitra regards himself to be a prodigy in writing. He firmly believes that language is borderless, and anyone can write as long as they have a strong narrative capability and the ability to emote feelings into words. Authors like F. Scott Fitzgerald and R. K. Narayan have influenced him to keep the writing as simple as possible for anyone to understand. Other than being well-versed about technological trends like AI, Machine Learning, AR, VR, Gaming, Microprocessors, Cloud Computing, Industry 4.0, literally any technological advancement (old or new), he also shares a knack to curate fiction on sci-fi, satire, and thriller genres.

read less