Java series ejbs and Java ejbs

Source: Internet
Author: User

Java series ejbs and Java ejbs
IntroductionEJB is sun's JavaEE server component model. The design goal and core application are to deploy distributed applications. With the advantages of cross-platform java, distributed systems deployed with EJB technology can be not limited to specific platforms. As part of J2EE (javaEE), EJB defines a standard for developing multiple Enterprise applications based on components. It features network service support and core development tools (sdks ). In J2EE, Enterprise Java Beans (ejbs) are called Java Enterprise Beans and are the core code of Java, namely Session Bean and Entity Bean) and MessageDriven Bean ).Session Bean

SessionBean is used to implement business logic. It can be stateful or stateless. Each time a client requests, the container selects a SessionBean to serve the client. Session Bean can directly access the database, but in more cases, it will implement data access through Entity Bean.

Entity Bean

Entity Bean is a domain model object used for O/R ing. It maps table records in the database to Entity objects in the memory. In fact, creating an Entity Bean object is equivalent to creating a new record, deleting an Entity Bean deletes corresponding records from the database at the same time. When an Entity Bean is modified, the container automatically synchronizes the status of the Entity Bean with the database.

Message-driven Bean

Is a new enterprise Bean introduced in EJB2.0. Based on JMS messages, it can only receive and process JMS messages sent by the client. MDB is actually an asynchronous stateless SessionBean. After the client calls MDB, it does not need to wait and returns immediately. MDB processes client requests asynchronously. This is suitable for scenarios where requests need to be processed asynchronously, such as order processing. This avoids the client from waiting for a method call for a long time until the returned result is returned.

EJB is actually a set of specifications in SUN's J2EE and defines a series of APIs to convert the EJB concept into an EJB product. What is EJB and BEANS? That is, there must be a place that can hold her and let her make great strides, that is, there must be a container. EJB must exist in the EJB container. This container is very powerful! She needs to package your BEAN first ,. In fact, the client program of EJB never directly deals with the ejbs you write. they communicate with each other through the HOME/REMOTE interface. It is responsible for all the eating, drinking, and sleep of your BEAN, such as BEAN persistence, security, and transaction management.

I am not very familiar with EJB either. I just want to sort out some knowledge points and share my experience with you later ......

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.