What is therelationship between @EJB and ejb-ref/ejb-local-ref?
What is therelationship between @EJB and ejb-ref/ejb-local-ref?
The @EJB annotationand the ejb-ref/ejb-local-ref .xmlelements
are used to specify the same semantic information. Specifically, that a Java EE component has adependency on a local or remote EJB component. Every @EJB canbe
translated into an equivalent ejb-ref/ejb-local-ref. @EJB iseasier
to use but it serves the same purposeas ejb-ref/ejb-local-ref.
Here's a table with more details :
|
@EJB attribute |
Description |
Default value |
ejb-refequivalent |
ejb-local-refequivalent |
|
name |
Unique location within the private component namespace(java:comp/env). |
field-level : <fully-qualifiedname of declaringclass>/<field-name> method-level : <fully-qualifiedname of declaring class>/<propertyname> class level : name isrequired. |
ejb-ref-name |
ejb-ref-name |
|
beanInterface |
For EJB 3.x business interfaces, the Local or Remote businessinterface of the session bean. For EJB 2.x, the Home/LocalHome interface of the session/entitybean. |
field-level : the type of the declared field. method-level : the type of the single setter parameter class level : beanInterface isrequired. |
For EJB 3.x :<remote> For EJB 2.x : <home> |
For EJB 3.x : <local> For EJB 2.x : <local-home> |
|
beanName |
ejb-name (not global JNDI name)of the target ejb component within the application. This can be used whenever the target ejbcomponent is defined within the same application as the referencingcomponent, regardless of local vs. remote. Theonly time it can't be used is if the @EJB refersto a Remote interface (3.x or 2.x) that is defined outside theapplication. |
Automatically resolved if there is only one EJB component withinthe application that exposes the valueof beanInterface |
ejb-link |
ejb-link |
|
lookup *(Added in EJB 3.1) |
Specifies the portable JNDI nameof the target EJB component to whichthis @EJB dependencyrefers. This should be usedinstead of mappedName incases where an @EJB dependencyneeds to be resolved to a Remote EJB component defined in adifferent application. It can also be used tochain one @EJB dependencyto another @EJB dependency. |
n/a |
lookup-name |
lookup-name |
|
mappedName |
Specifies the product-specific name of the target Remote EJBcomponent. For GlassFish, this refers to theglobal JNDInameof the target Remote EJB component. Not applicable for local interfacesbecause beanName canalways be used instead. *(Should not be used in EJB 3.1. See lookup instead) |
If the target EJB component is defined within the same applicationand the beanNamedefaultapplies, no additional mapping is required. Otherwise, the target global JNDI namewill be set to the value of beanInterface |
mapped-name |
n/a |
What is therelationship between @EJB and ejb-ref/ejb-local-ref?的更多相关文章
- 关于EJB,为什么用EJB?为什么不用EJB?
http://blog.csdn.net/linxi1209163com/article/details/51029890 一:什么是EJB 官方说法,就是企业级是基于语言的服务器框架技术,通过我们可 ...
- EJB是什么?EJB的概念分析与理解(copy)
[说明:转载于http://blog.csdn.net/jojo52013145/article/details/5783677] 1. 我们不禁要问,什么是"服务集群"?什么是& ...
- git pull报“unable to update local ref”解决方案
使用git pull拉取代码的时候,无法拉取最新代码,报"unable to update local ref"错误. 除了重新clone一份代码外,还可以使用如下解决方案: 1. ...
- git pull fails “unable to resolve reference” “unable to update local ref”
问题 由于有人rebase了分支,或者不知道怎么搞的.其他人拉取代码的时候,发现拉不下来. >git fetch error: cannot lock ref 'refs/remotes/ori ...
- spring property标签中的 ref属性和ref 标签有什么不同? 如下:<property name="a" ref="b" />
spring property标签中的 ref属性和ref 标签有什么不同? 如下:<property name="a" ref="b" /> sp ...
- [转]spring property标签中的 ref属性和ref 标签有什么不同
spring property标签中的 ref属性和ref 标签有什么不同? 如下:<property name="a" ref="b" /> sp ...
- git pull时 git cannot lock ref XXXXXX (unable to update local ref)错误解决方案
git pull : git cannot lock ref XXXXXX (unable to update local ref) pull代码的时候出现的错误,导致代码拉不下来. 看了一下 ...
- 使用git pull拉取代码的时候,无法拉取最新代码,报"unable to update local ref"错误。
使用git pull拉取代码的时候,无法拉取最新代码,报"unable to update local ref"错误. 除了重新clone一份代码外,还可以使用如下解决方案: .切 ...
- spring property标签中的 ref属性和ref 标签有什么不同
spring的配置文件可能会有多个<property name="a" ref="b" />就是找当前配置文件里的bean 也就是b <ref ...
- spring 中<ref parent="">标签是什么意思;ref标签与ref属性有什么不同;子容器如何引用父容器的bean
spring的配置文件可能会有多个<property name="a" ref="b" />就是找当前配置文件里的bean 也就是id为b的 < ...
随机推荐
- 基于GBT28181:SIP协议组件开发-----------第三篇SIP注册流程分析实现
原创文章,引用请保证原文完整性,尊重作者劳动,原文地址http://www.cnblogs.com/qq1269122125/p/3941172.html,qq:1269122125. 上两章节简要的 ...
- pthread_setcanceltype 线程取消
取消线程: (1)一个线程可以调用pthread_cancel来取消另一个线程. (2)被取消的线程需要被join来释放资源. (3)被取消的线程的返回值为PTHREAD_CANCELED ...
- Jquery实现图片左右滚动(自动)
<!DOCTYPE HTML><html><head><title>基于jQuery的控制左右滚动效果_自动滚动版本</title>< ...
- SQL2012之FileTable与C#的联合应用
关于FileTable是什么,请猛击如下链接:http://technet.microsoft.com/zh-cn/library/ff929144(v=SQL.110).aspx:如您已知道,请跳过 ...
- 自动化工具word文档批量转html
企业有很多的科室,科室的每个人或多或少都会写一些文档,有些文档领导需要浏览,解决的办法是将编辑的文档打印出来,供领导浏览,或是为了节约企业成本,文档就在人与人这间或部门之间copy过来,copy过去. ...
- J - 计算两点间的距离
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Description 输入两 ...
- Scut DirCenter 网站编辑、搭建与调试
直接利用 Scut 提供的服务器管理工具进行服务器管理. 教程:https://github.com/ScutGame/Scut/wiki/DirServer. 几个注意点: 下载的数据库导入bat是 ...
- Unity3D Quaternion各属性和函数测试
Quaternion属性与方法 一,属性: x.y.z就不说了,只看一个eulerAngles,代码如下: public Quaternion rotation = Quaternion.identi ...
- Lesson 6: CronTrigger
CronTrigger is often more useful than SimpleTrigger, if you need a job-firing schedule that recurs b ...
- 【Mongous】
amark/mongous Mongous - 一个轻量级的nodejs mongodb驱动 mongous,是我不够懂你吗?关于mongous不支持objectId查询 mongous 不需要 _i ...