Home  >  Blog  >   JBoss

Configuring Enterprise Java Beans - JBoss

Rating: 5
  
 
2921

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.

 

Join our newsletter
inbox

Stay updated with our newsletter, packed with Tutorials, Interview Questions, How-to's, Tips & Tricks, Latest Trends & Updates, and more ➤ Straight to your inbox!

Course Schedule
NameDates
JBoss TrainingMar 23 to Apr 07View Details
JBoss TrainingMar 26 to Apr 10View Details
JBoss TrainingMar 30 to Apr 14View Details
JBoss TrainingApr 02 to Apr 17View 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 more