Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Enterprise JavaBeans™ Specification, v1.1 - Sun Microsystems.pdf
Скачиваний:
11
Добавлен:
24.05.2014
Размер:
1.62 Mб
Скачать

Sun Microsystems Inc.

Enterprise bean environment

Enterprise JavaBeans v1.1, Final Release

EJB references

14.3.2 Application Assembler’s responsibilities

The Application Assembler can use the ejb-link element in the deployment descriptor to link an EJB reference to a target enterprise bean. The link will be observed by the deployment tools.

The Application Assembler specifies the link between two enterprise beans as follows:

The Application Assembler uses the optional ejb-link element of the ejb-ref element of the referencing enterprise bean. The value of the ejb-link element is the name of the target enterprise bean. (It is the name defined in the ejb-name element of the target enterprise bean.) The target enterprise bean can be in the same ejb-jar file, or in another ejb-jar in the same J2EE application unit as the referencing enterprise bean.

The Application Assembler must ensure that the target enterprise bean is type-compatible with the declared EJB reference. This means that the target enterprise bean must be of the type indicated in the ejb-ref-type element, and that the home and remote interfaces of the target enterprise bean must be Java type-compatible with the interfaces declared in the EJB reference.

The following illustrates an ejb-link in the deployment descriptor.

...

<enterprise-beans> <session>

...

<ejb-name>EmployeeService</ejb-name> <ejb-class>

com.wombat.empl.EmployeeServiceBean </ejb-class>

...

<ejb-ref> <ejb-ref-name>ejb/EmplRecord</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <home>com.wombat.empl.EmployeeRecordHome</home> <remote>com.wombat.empl.EmployeeRecord</remote> <ejb-link>EmployeeRecord</ejb-link>

</ejb-ref>

...

</session>

...

<entity> <ejb-name>EmployeeRecord</ejb-name>

<home>com.wombat.empl.EmployeeRecordHome</home>

<remote>com.wombat.empl.EmployeeRecord</remote>

...

</entity>

...

</enterprise-beans>

...

The Application Assembler uses the ejb-link element to indicate that the EJB reference “EmplRecord” declared in the EmployeeService enterprise bean has been linked to the EmployeeRecord enterprise bean.

11/24/99

210