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的 < ...
随机推荐
- 明解C语言,练习13-3,从文件中读入个人信息,按身高排序后显示
#include <stdio.h> #define NUMBER 6 #define F_PATH "D:\\C_C++\\ec13-3\\hw.dat" typed ...
- CentOS6.5升级为CentOS7.0
CentOS6.5升级为CentOS7.0 CentOS6.5升级为CentOS7 升级前: [root@localhost ~]# cat /proc/version Linux version ...
- Skinned Mesh原理解析和一个最简单的实现示例
Skinned Mesh 原理解析和一个最简单的实现示例 作者:n5 Email: happyfirecn##yahoo.com.cn Blog: http://blog.csdn.net/n5 ...
- POJ1007-DNA Sorting-ACM
DNA Sorting Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 83442 Accepted: 33584 Des ...
- YII 小部件 解决多选按钮和单选按钮不在同一水平上 'separator'=>' '
主要是添加separator属性(这里)$hoddy,$sex在控制器里面定义的数组,然后render传过来的 <td> <?php echo $form-> ...
- C# asp:Repeater DataSource List<T>
1. asp:Repeater 数据源为List<T> 2.页面显示 3.行绑定取值
- loadView与viewDidLoad不同 && loadView学习总结
loadView学习总结 UIViewController类或其子类会在初始化时创建一个UIView对象,会作为控制器的默认视图显示出来,可以通过self.view寻址访问.但没有调用loadView ...
- Solr4.8.0源码分析(22)之SolrCloud的Recovery策略(三)
Solr4.8.0源码分析(22)之SolrCloud的Recovery策略(三) 本文是SolrCloud的Recovery策略系列的第三篇文章,前面两篇主要介绍了Recovery的总体流程,以及P ...
- C语言连接数据库
举个例子,连接SQL: // 打开数据库 strDBClass.Format(_T("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=%s;Jet ...
- 初始化rails上的compass项目
compass以外还有一个很实用的scss模块, _media-queries.scss 通过终端下载 curl -O https://raw.github.com/paranoida/sass-me ...