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的 < ...
随机推荐
- SGU 146.The Runner
时间限制:0.25s 空间限制:4M 题意: 一个人在一个周长为L的圆上跑,每个时间段(Ti)的速度(Vi)不一样,问最后他离起点的圆弧距离,周长是个有四位小数的浮点数,其它全是整数. Solutio ...
- 在CentOS 6.3中安装与配置JDK-7
在CentOS 6.3中安装与配置JDK-7 来源:互联网 作者:佚名 时间:02-07 16:28:33 [大 中 小] 在CentOS-6.3中安装与配置JDK-7,有需要的朋友可以参考下 安装说 ...
- Fedora 21 安装Infinality
原文地址: Fedora 21 用infinality美化你的字体 http://blog.csdn.net/element207/article/details/41746683 安装infinal ...
- 下拉框——把一个select框中选中内容移到另一个select框中遇到的问题
在使用jQuery实现把一个select框中选中内容移到另一个select框中功能时遇到了一个问题,就是点击按钮时内容可以到另一个select框中,但是到了另一个select框中的内容却很快闪退回原来 ...
- C#快速导入海量XML数据至SQL Server数据库
#region 将Xml中的数据读到Dataset中,然后用SqlBulkCopy类把数据copy到目的表中using (XmlTextReader xmlReader = new XmlTextRe ...
- javascript原型模式理解
传统的面向对象语言中,创建一个对象是通过使用类来创建一个对象的,比如通过类飞行器来创建一个对象,飞机. 而js这种没有类概念的动态设计语言中,创建对象是通过函数来创建的,所以通常也把js称为函数式语言 ...
- JS生成二维码,支持中文字符
一.使用jquery-qrcode生成二维码 先简单说一下jquery-qrcode,这个开源的三方库(可以从https://github.com/jeromeetienne/jquery-qrcod ...
- const关键字与指针
const与指针在一起的几种情况. const int *p1; //表示p1本身不是const,指向的变量是const. const *int p2; //语法错误 int const *p3; / ...
- java单点登录系统CAS的简单使用
转:http://blog.csdn.net/yunye114105/article/details/7997041 背景 有几个相对独立的java的web应用系统, 各自有自己的登陆验证功能,用户在 ...
- cadence遇到的问题(持续更新)
1.画了DB9的封装,共十一个焊盘,其中两个是机械焊盘,在绘制PCB板时,想要将其接地,但无法连接,如图所示 因为是机械焊盘,所以无法用更改logic的方法进行网络更改,现在只发现一个办法,就是更改封 ...