Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
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 Enterprise bean’s environment as a JNDI API

This chapter is organized as follows.

Section 14.2 defines the interfaces that specify and access the enterprise bean’s environment. The section illustrates the use of the enterprise bean’s environment for generic customization of the enterprise bean’s business logic.

Section 14.3 defines the interfaces for obtaining the home interface of another enterprise bean using an EJB specification reference . An EJB specification reference is a special entry in the enterprise bean’s environment.

Section 14.4 defines the interfaces for obtaining a resource manager connection factory using a resource manager connection factory reference. A resource manager connection factory reference is a special entry in the enterprise bean’s environment.

14.2Enterprise bean’s environment as a JNDI API naming context

The enterprise bean’s environment is a mechanism that allows customization of the enterprise bean’s business logic during deployment or assembly. The enterprise bean’s environment allows the enterprise bean to be customized without the need to access or change the enterprise bean’s source code.

The Container implements the enterprise bean’s environment, and provides it to the enterprise bean instance through the JNDI interfaces. The enterprise bean’s environment is used as follows:

1.The enterprise bean’s business methods access the environment using the JNDI interfaces. The Bean Provider declares in the deployment descriptor all the environment entries that the enterprise bean expects to be provided in its environment at runtime.

2.The Container provides an implementation of the JNDI API naming context that stores the enterprise bean environment. The Container also provides the tools that allow the Deployer to create and manage the environment of each enterprise bean.

3.The Deployer uses the tools provided by the Container to create the environment entries that are declared in the enterprise bean’s deployment descriptor. The Deployer can set and modify the values of the environment entries.

4.The Container makes the environment naming context available to the enterprise bean instances at runtime. The enterprise bean’s instances use the JNDI interfaces to obtain the values of the environment entries.

Each enterprise bean defines its own set of environment entries. All instances of an enterprise bean within the same home share the same environment entries; the environment entries are not shared with other enterprise beans. Enterprise bean instances are not allowed to modify the bean’s environment at runtime.

11/24/99

202