Explanation of EJB

zhaozj2021-02-16  87

Bean bean is an abbreviation of Enterprise Java Bean, a bean playing the role of an application material. She contains a category of Functional Interface, a Life-Cycle Interface, and a class that implements it. Bean Instance (Bean Instance) A bean instance is instantiation in a container. If you use the bean as a Class, then Bean Instance is Java Object. Bean-managed persistence (BEAN's own sustainable)

This term is used to describe how Enterprise Java Bean stores their State to the database or other storage mechanisms. The container will prompt the bean to call the bean's EjbLoad () and EJBSAVE () methods. Container's container of a bean will do Bean's Home Interfaces with Remote Interfaces. It should provide a set of common procedures categories to hide bean instances, intervention method calls, maintain transaction integrity and general management of the Bean Instances pool. Although a container must manage more than one kind of bean in the EJB rules, only one bean is usually only one BEAN. Container-Managed Demarcation For an Enterprise Bean, whenever one of the business methods are called, the container automatically launches a new transaction. After the business method is completed, the transaction is over. The form of the container starts the transaction is determined by the transaction attribute of the bean, or by the business method itself (if there is indicated). Container-Managed Persistence (sustainability of the derivation of container) Bean developers can entrust containers to record the latest state of beans. The state of the bean must be obtained from many public fields in the bean. The container ensures that these Public Fields are correct before any bean approach. Public Fields must be defined in Deployment Descriptor and then generate Container Classes. Entity Beans Entity Beans Represents Sustainable Items. A typical example is: it can represent individual Rows in relational databases. Of course, it is also possible to be files in the archive system, or any other unique recognizable information. Every Enterprise Bean, whether it is session or Entity Beans, there is an interface to allow the client to build and remove a bean instance. Take Entity as an example, Home Interface provides some ways to allow clients to be used for a bean instance. This Interface follows Java RMI Interface regulations. Each home interface inherits from a remote interface, ie EJBHOME. Remote A bean Remote Interface Description Collection of methods for client calls in a bean instance. This Interface follows Java RMI Interface regulations. Each Remote Interface inherits from a remote interface, ie EJBOBJECT. Session Beans Session Beans is established for Particular Client. If after a specified idle time known as Timeout, it will no longer exist. Session Synchronization Session Beans selectively achieve session synchronization interface. This allows the session beans to be notified before the transaction will be completed. The Session Bean can use the BeforeCompletion () method to veto the success of the transaction, and can use afterCompletion () to determine whether the transaction is successful or not. Transaction Attribute (transaction attribute) A Transaction Attribute can be used in Bean with its special business approach. Its possible value has six, respectively, TX_NOT_SUPPORTED, TX_REQUIRED, TX_SUPPPPPPPPports,

转载请注明原文地址:https://www.9cbs.com/read-13346.html

New Post(0)