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

Sun Microsystems Inc.

Enterprise bean environment

Enterprise JavaBeans 2.0, Public Draft

Resource manager connection factory refer-

The following example illustrates the declaration of the JMS resource manager connection factory references used by the example on page 312.

...

<enterprise-beans> <session>

...

...

<resource-ref> <description>

A queue connection factory used by the MySession enterprise bean to send notifications.

</description> <res-ref-name>jms/qConnFactory</res-ref-name> <res-type>javax.jms.QueueConnectionFactory

</res-type> <res-auth>Container</res-auth>

</resource-ref>

...

</session> </enterprise-beans>

...

19.4.1.3 Standard resource manager connection factory types

The Bean Provider must use the javax.sql.DataSource resource manager connection factory type for obtaining JDBC connections, and the javax.jms.QueueConnectionFactory or the javax.jms.TopicConnectionFactory for obtaining JMS connections.

The Bean Provider must use the javax.mail.Session resource manager connection factory type for obtaining JavaMail connections, and the java.net.URL resource manager connection factory type for obtaining URL connections.

It is recommended that the Bean Provider names JDBC data sources in the java:comp/env/jdbc subcontext, and JMS connection factories in the java:comp/env/jms subcontext. It is also recommended that the Bean Provider names all JavaMail connection factories in the java:comp/env/mail subcontext, and all URL connection factories in the java:comp/env/url subcontext.

The Connector mechanism allows an enterprise bean to use the API described in this section to obtain resource objects that provide access to additional back-end systems. See [11].

19.4.2 Deployer’s responsibility

The Deployer uses deployment tools to bind the resource manager connection factory references to the actual resource factories configured in the target operational environment.

The Deployer must perform the following tasks for each resource manager connection factory reference declared in the deployment descriptor:

5/31/00

394

Sun Microsystems Inc

Resource manager connection factory referencesEnterprise JavaBeans 2.0, Public Draft

Enterprise bean environment

Bind the resource manager connection factory reference to a resource manager connection factory that exists in the operational environment. The Deployer may use, for example, the JNDI LinkRef mechanism to create a symbolic link to the actual JNDI name of the resource manager connection factory. The resource manager connection factory type must be compatible with the type declared in the res-type element.

Provide any additional configuration information that the resource manager needs for opening and managing the resource. The configuration mechanism is resource-manager specific, and is beyond the scope of this specification.

If the value of the res-auth element is Container, the Deployer is responsible for configuring the sign-on information for the resource manager. This is performed in a manner specific to the EJB Container and resource manager; it is beyond the scope of this specification.

For example, if principals must be mapped from the security domain and principal realm used at the enterprise beans application level to the security domain and principal realm of the resource manager, the Deployer or System Administrator must define the mapping. The mapping is performed in a manner specific to the EJB Container and resource manager; it is beyond the scope of the current EJB specification.

19.4.3 Container provider responsibility

The EJB Container provider is responsible for the following:

Provide the deployment tools that allow the Deployer to perform the tasks described in the previous subsection.

Provide the implementation of the resource manager connection factory classes for the resource managers that are configured with the EJB Container.

If the Bean Provider sets the res-auth of a resource manager connection factory reference to Application, the Container must allow the bean to perform explicit programmatic sign-on using the resource manager’s API.

The Container must provide tools that allow the Deployer to set up resource manager sign-on information for the resource manager references whose res-auth element is set to Container. The minimum requirement is that the Deployer must be able to specify the user/password information for each resource manager connection factory reference declared by the enterprise bean, and the Container must be able to use the user/password combination for user authentication when obtaining a connection to the resource by invoking the resource manager connection factory.

Although not required by the EJB specification, we expect that Containers will support some form of a single sign-on mechanism that spans the application server and the resource managers. The Container will allow the Deployer to set up the resource managers such that the EJB caller principal can be propagated (directly or through principal mapping) to a resource manager, if required by the application.

While not required by the EJB specification, most EJB Container providers also provide the following features:

395

5/31/00