EJB of the Java series

Source: Internet
Author: User

Introduction EJB is the Sun's Java EE server-side component model, and the design goal and core application is to deploy distributed applications. With the advantages of Java cross-platform, distributed systems deployed with EJB technology can be limited to specific platforms. EJB (Enterprise JavaBean) is part of the Java EE, which defines a standard for developing component-based enterprise multi-application applications. Features include network service support and core development tools (SDKs). In Java EE, Enterprise Java Beans (EJB) is called Java Business Bean, which is the core code of the kernel, namely the session bean, the entity bean Bean) and the message-driven bean (Messagedriven bean). Session Bean

Sessionbean is used to implement business logic, it can be stateful, or it can be stateless. Each time the client requests, the container chooses a Sessionbean to service the client. The Session bean can access the database directly, but more often, it implements data access through the entity bean.

Entity Bean

The entity bean is a domain model object that implements the O/R mapping and is responsible for mapping table records in the database to an in-memory entity object, in fact creating an entity bean object that is equivalent to a new record, deleting an entity The bean will delete the corresponding record from the database at the same time, and when modifying an entity bean, the container will automatically synchronize the state of the entity bean with the database.

message-Driven beans

Is the new enterprise Bean introduced in EJB2.0, which is based on a JMS message and can only receive JMS messages sent by the client and then processed. The MDB is actually an asynchronous stateless Sessionbean, and the client calls the MDB without waiting, immediately returning, and the MDB will process the client request asynchronously. This is suitable for situations where requests need to be processed asynchronously, such as order processing, so that the client can be prevented from waiting for a method call for a long time until the result is returned.

EJB is actually a set of specifications in Sun's Java EE, and specifies a series of APIs to enable the conversion of EJB concepts into EJB products. What is EJB's concept of Beans,beans? That is to have a place to hold her, so that she can make it, is to have a container. EJB must exist in the EJB container, but the container is very powerful! She will first wrap your beans. EJB's client program actually never deals directly with the EJB you write, and they are related through the Home/remote interface. It is responsible for all of your bean's eating and drinking, such as the persistence of beans, security, and transaction management.

The individual for EJB also is not very understanding, just do some knowledge point of carding, behind deepen understanding and then share experience with you ...

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

EJB of the Java series

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.