Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the new features of EJB3.1

2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

The content of this article mainly focuses on what are the new features of EJB3.1. The content of the article is clear and well-organized. It is very suitable for beginners to learn and is worth reading. Interested friends can follow the editor to read together. I hope you can get something through this article!

1. Cancel the interface

EJBContainer directly publishes the Public method of javaBean, which is used by the client through @ EJB injection.

two。 The introduction of Singletonsinessionbean.

The SessionBean is marked as Singleton through @ Singleton. There is only one case in this Container.

For parallel access to SingletonSessionBean, there are two control mechanisms, CMC (Container-managedconcurrency), container-managed parallel mechanism and

BMC (Bean-managedconcurrency), a parallel mechanism for Bean management. The default container management parallel mechanism.

In the control of parallel access, the Readandwrite mechanism is used through @ Lock (READ) @ Lock (WRITE). The default is WRITE mechanism, and only one method can be used.

Client access.

3.Asynchronous call

EJB3.1 exciting Feature. This method can be called asynchronously through @ Asynchronous. On the client side, through the Future mode of the JDKConcurrency package

(Future) to call EJB3.1 container asynchronous methods asynchronously.

4. Standardize JNDInames

In the past, different Vendor have different definitions, but now they are unified. The format is as follows:

Java:global [/] / / [!]

Packagenet.blogjava.vincent

@ Singleton

PublicclassBeanA {(...)}

The following JDNI are all reasonable.

-java:global/myapp/mybeans/BeanA

-javaGLOLOGRAPHUMYAUBANG MYBANGUBANG

-java:app/mybeans/BeanA

-javaVasApplink mybeansAccording to BeanAggnet.blogjava.vincent.BeanA

-java:module/BeanA

-javaRangmodulePlus BeanAggnet.blogjava.vincent.BeanA

5. Provides more powerful Time services.

This area has always been a weakness of EJB, making Quartz mainstream. Relative to EJB3, EJB3.1 provides programming and annotation mechanisms to provide similar LinuxCron services.

For example, the following definition:

@ Stateless

PublicclassMyTimeEJB {

@ Schedules (

{@ Schedule (hour= "13")

@ Schedule (hour= "20")

}

PublicvoidMyTimeEJB (Timertimer) {(...)}

}

6. Launch a simplified version of EJBLiteEJB container

The simplified version of EJB3.1 includes features:

* Stateless,stateful,singletonsessionbeans. Only asynchronous calls to Local are supported.

* Container-ManagedTransactionsandBean-ManagedTransactions.

* Declarative and programmaticsecurity.

* Interceptors.

* Deploymentdescriptors.

7. Simplified EJBPackaging

It is possible to include EJB modules in the ear package without the war package. As shown below:

8. Embedded EmbeddableEJBContainers

AJavaSE uses launching an embedded EJBContainr to develop and test EJB.

Thank you for your reading. I believe you have some understanding of "what are the new features of EJB3.1?" go ahead and practice it. If you want to know more about it, you can follow the website! The editor will continue to bring you better articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report