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的 < ...
随机推荐
- Java jdk环境搭建
java JDK的配置在我的电脑环境变量中配置: 主要的配置参数path 例:path = C:\jdk1.7.0_13\bin ; 另外一个JAVA_HOME 例:JAVA_HOME = C:\j ...
- illegal mix of collcations表连接时非法的校对
背景:旧表导入新表,新表里的字段是字符串类型 新表是int类型 两个字段通过字符串处理后相等 (准备left join 关联起来)报错 把int类型字段更改成varchar字符串类型后成功
- jquery html 动态添加元素绑定事件
由于实际的需要,有时需要往网页中动态的插入HTML内容,并在插入的节点中绑定事件处理函数.我们知道,用Javascript向HTML文档中 插入内容,有两种方法, 一种是在写HTML代码写入JS,然后 ...
- smali文件语法参考
Dalvik opcodes Author: Gabor Paller Vx values in the table denote a Dalvik register. Depending on th ...
- CodeFirst中DB保存时报错:对一个或多个实体的验证失败。
错误提示如下: 开始以为有字段可能没有添加数据,可是检查了很久,仍然没有任何头绪. 后使用DbEntityValidationException进行调试,问题才得以解决
- objective-c(初始化)
objective-c(初始化) 创建对象 (编程语言 Objective-C 2.0) 1.类对象与实例化 类的定义完成后,编译器在内存中自动生成唯一的类对象,实例对象都是通过调用类对象的类方法生成 ...
- javascript下用ActiveXObject控件替换word书签,将内容导出到word后打印第1/2页
由于时间比较紧,没多的时候去学习研究上述工具包,现在用javascript操作ActiveXObject控件,用替换word模板中的书签方式解决. 最近有需求将数据导出到word里,然后编辑打印. 想 ...
- java 内存 垃圾回收调优
要了解Java垃圾收集机制,先理解JVM内存模式是非常重要的.今天我们将会了解JVM内存的各个部分.如何监控以及垃圾收集调优. Java(JVM)内存模型 正如你从上面的图片看到的,JVM内存被分成多 ...
- Catenyms
poj2337:http://poj.org/problem?id=2337 题意:给定一些单词,如果一个单词的尾字母与另一个的首字母相同则可以连接.问是否可以每个单词用一次,将所有单词连接,可以则输 ...
- jQuery Validate 验证,校验规则写在控件中的具体例子
将校验规则写到控件中 <script src="../js/jquery.js" type="text/javascript"></scrip ...