What is therelationship between @EJB and ejb-ref/ejb-local-ref?
来源:互联网 发布:js window.load 编辑:程序博客网 时间:2024/06/06 07:36
http://glassfish.java.net/javaee5/ejb/EJB_FAQ.html
What is therelationship between
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 :
@EJBattribute
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 portableJNDI 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-namemappedName
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 interfacesbecausebeanName 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 globalJNDI namewill be set to the value of beanInterface
mapped-name
n/a
What is therelationship between @EJB and ejb-ref/ejb-local-ref?
The
@EJB
Description
Default value
ejb-refequivalent
ejb-local-refequivalent
name
Unique location within the private component namespace(java:comp/env).
field-level :
method-level :
class level :
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 :
For EJB 3.x :<remote>
For EJB 2.x :
<home>
For EJB 3.x :
<local>
For EJB 2.x :
<local-home>
beanName
ejb-name
Automatically resolved if there is only one EJB component withinthe application that exposes
ejb-link
ejb-link
lookup
*(Added in EJB 3.1)
Specifies the portable
n/a
lookup-name
lookup-namemappedName
Specifies the product-specific name of the target Remote EJBcomponent.
Not applicable for local interfacesbecause
*(Should not be used in EJB 3.1.
Otherwise, the target global
mapped-name
n/a
0 0
- What is therelationship between @EJB and ejb-ref/ejb-local-ref?
- What is EJB?
- What is EJB
- What is EJB
- Local EJB
- EJB
- ejb
- EJB
- EJB
- EJB
- EJB
- EJB
- EJB
- EJB
- ejb
- EJB
- EJB?
- EJB
- centos启动自动进入纯命令行模式3
- postgreSQL分页
- mysql中limit的用法详解 [数据分页]
- 在Linux上应用PostgreSQL
- 在Linux下安装和使用MySQL
- What is therelationship between @EJB and ejb-ref/ejb-local-ref?
- 详解 Windows下apache 实现 SSL
- jdk+apache+jboss+mod_jk+openssl--从零开始搭建Linux测试环境
- RESTService 的最佳实践,第 1 部分: 重新解析 RESTService
- ORACLE与PostgreSql的区别
- 理解ThreadLocal
- 蔡英文败选感言全文
- [原创]新建对象:反射会调用构造函…
- [原创]Java 的传值小例子