EE6 web profile ...没有EJB容器? [英] EE6 web profile ... no EJB container?

查看:112
本文介绍了EE6 web profile ...没有EJB容器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习Java EE(EE 6),并发现EJB和EJB Lite之间的差异有点混乱。



Java EE6 Web配置文件仅支持EJB Lite。



我对EJB Lite的理解是,它是EJB的一个更简单的子集(我可以很容易地找到这些差异),并将您的EJB类打包一个战争



所以我只能从同一个WAR中包含的webapp(或另一个webapp,如果我们把它们放在同一个EAR中)访问那些EJB类? / p>

我认为这意味着EJB Lite类被部署到Web容器。这是否意味着EE6 Web配置文件中没有EJB容器?



(我们还需要一个web-profile标签?)

解决方案

请注意,EJB lite由Web配置文件和EJB可嵌入容器共享。



1 。


所以我只能从同一个WAR中包含
的webapp访问
EJB类或另一个webapp如果
我把它们都放在同一个EAR中)?


EJB 3.1的第​​20.4.3节规范:


企业
bean组件的本地客户端视图(包括
无界面视图)已定义在.war
文件中,只需要在同一个.war
文件中的组件访问
。应用程序需要访问
企业的本地客户端视图
bean从
相同的应用程序中的另一个模块应该使用ejb-jar
文件来定义企业bean
显示本地客户端视图。


注意,规范允许供应商扩展,以便其他模块可以使用EJB,但依赖



2。


假设这个意味着EJB
Lite类被部署到web
容器。这是否意味着
在EE6 web
配置文件中没有EJB容器?


这是具体的实现,但是由于存在可嵌入的EJB容器,我怀疑大多数实现将运送完整的EJB容器或子集。



3。


(我们还需要一个web-profile标签?)


否。


I'm learning about Java EE (EE 6 specifically) and find the differences between EJB and EJB Lite a little confusing.

Java EE6 web profile only supports EJB Lite.

My understanding of "EJB Lite" is that it is a simpler subset of EJB (I can find those differences documented easily enough) and you package your EJB classes in a WAR.

So will I only able to access those EJB classes from the webapp contained in the same WAR (or another webapp if I put both of them in the same EAR) ?

I assume that this means that the EJB Lite classes are deployed to the web container. Does this mean that there is no EJB container in the EE6 web profile ?

(also do we need a web-profile tag?)

解决方案

Note that EJB lite is shared by both the web profile and the EJB embeddable container.

1.

So will I only able to access those EJB classes from the webapp contained in the same WAR (or another webapp if I put both of them in the same EAR) ?

Section 20.4.3 of the EJB 3.1 spec:

The local client view(including the no-interface view) of an enterprise bean component defined within a .war file is only required to be accessible to components within the same .war file. Applications needing access to the local client view of an enterprise bean from a different module in the same application should use an ejb-jar file to define the enterprise bean that exposes the local client view.

Note, the spec allows vendor extensions so that other modules can use the EJBs, but relying on that won't be portable.

2.

assume that this means that the EJB Lite classes are deployed to the web container. Does this mean that there is no EJB container in the EE6 web profile ?

This is implementation specific, but given the existence of an embeddable EJB container, I suspect most implementations will ship either the full EJB container or a subset.

3.

(also do we need a web-profile tag?)

No.

这篇关于EE6 web profile ...没有EJB容器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆