web server - Borland Technical Publications

web server - Borland Technical Publications web server - Borland Technical Publications

techpubs.borland.com
from techpubs.borland.com More from this publisher
12.11.2014 Views

Deployment Descriptors for the Resource Adapter Configuring ra-borland.xml The ra-borland.xml file contains information required for deploying a Resource Adapter to the Borland Enterprise Server. Certain attributes need to be specified in this file in order to deploy the RAR file. This functionality is consistent with the equivalent .xml extensions for EJBs, EARs, WARs, and client components for the Borland Enterprise Server. Until Borland-specific deployment properties are provided in the ra.borland.xml file, the RAR cannot be deployed to the server. The following attributes must be specified first in ra-borland.xml: ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Name of the connection factory Description of the connection factory JNDI name bound to the connection factory Reference to a separately deployed connection factory that contains Resource Adapter components which can then be shared with the current Resource Adapter. Directory where all shared libraries should be copied Connection pool properties: ■ ■ ■ busy-timeout: the number of seconds to wait before a busy connection is released. The default is 600 seconds idle-timeout: a pooled connection remaining in an idle state for a period of time longer than this timeout value should be closed. All idle connections are checked for expiration every 60 seconds. The value of the idle-timeout is given in seconds. The default is 600 seconds. wait-timeout: the number of seconds to wait for a free connection. The default is 30 seconds. Values for configuration properties defined in a element of the Sun standard Resource Adapter deployment descriptor Mapping of security principals for Resource Adapter/EIS sign-on processing. This mapping identifies resource principals to be used when requesting EIS connections for applications that use container-managed security and for EIS connections requested during initial deployment. A flag to indicate whether logging is required for the ManagedConnectionFactory or ManagedConnection classes. The file to store logging information for the two aforementioned classes Configuring the element in ra-borland.xml The optional element allows you to associate multiple deployed Resource Adapters with a single deployed Resource Adapter. This provides for linking and reusing resources already configured in a base Resource Adapter to another Resource Adapter, modifying only a subset of attributes. Use of the element avoids duplication of resources (for example, classes, JARs, images, etc.) where possible. Any values defined in the base Resource Adapter deployment are inherited by the linked Resource Adapter unless otherwise specified. Chapter 27: Using VisiConnect 267

Developing the Resource Adapter Configuring the Security Map To use container-managed sign-on, the Borland Enterprise Server must identify a resource role and then request the connection to the EIS on behalf of the resource role. To make this identification, the server looks for a security map specified with the element in the ra-borland.xml descriptor file. This security map builds the required associations between the server's user roles (Borland Enterprise Server users with identities defined in a security realm) and resource roles (users known to the Resource Adapter and/or EIS). See “Security Map” above for details on using the Security Map. Developing the Resource Adapter This section describes how to develop a Connectors 1.0-compliant Resource Adapter. Resource Adapters must implement the following system contract requirements, discussed in detail below: ■ ■ ■ ■ Connection management Security management Transaction management Packaging and deployment Connection management Note The connection management contract for the resource adapter specifies a number of classes and interfaces necessary for providing the system contract. The resource adapter must implement the following interfaces: ■ javax.resource.spi.ManagedConnection ■ javax.resource.spi.ManagedConnectionFactory ■ javax.resource.spi.ManagedConnectionMetaData ■ ■ The ManagedConnection implementation provided by the Resource Adapter must, in turn, supply implementations of the following interfaces and classes to provide support to the application server. It is the application server which will ultimately be managing the connection and associated transactions. If your environment is non-managed (that is, not managed by the application server), you are not required to use these interfaces or classes. javax.resource.spi.ConnectionEvent javax.resource.spi.ConnectionEventListener In addition, support for error logging and tracing must be provided by implementing the following methods in the Resource Adapter: ■ ManagedConnectionFactory.setLogWriter() ■ ManagedConnectionFactory.getLogWriter() ■ ManagedConnection.setLogWriter() ■ ManagedConnection.getLogWriter() The resource adapter must also provide a default implementation of the javax.resource.spi.ConnectionManager interface for cases in which the Resource Adapter is used in a non-managed two-tier application scenario. A default implementation of ConnectionManager enables the Resource Adapter to provide services specific to itself. These services can include connection pooling, error logging and 268 BES Developer’s Guide

Developing the Resource Adapter<br />

Configuring the Security Map<br />

To use container-managed sign-on, the <strong>Borland</strong> Enterprise Server must identify a<br />

resource role and then request the connection to the EIS on behalf of the resource role.<br />

To make this identification, the <strong>server</strong> looks for a security map specified with the<br />

element in the ra-borland.xml descriptor file. This security map builds<br />

the required associations between the <strong>server</strong>'s user roles (<strong>Borland</strong> Enterprise Server<br />

users with identities defined in a security realm) and resource roles (users known to the<br />

Resource Adapter and/or EIS). See “Security Map” above for details on using the<br />

Security Map.<br />

Developing the Resource Adapter<br />

This section describes how to develop a Connectors 1.0-compliant Resource Adapter.<br />

Resource Adapters must implement the following system contract requirements,<br />

discussed in detail below:<br />

■<br />

■<br />

■<br />

■<br />

Connection management<br />

Security management<br />

Transaction management<br />

Packaging and deployment<br />

Connection management<br />

Note<br />

The connection management contract for the resource adapter specifies a number of<br />

classes and interfaces necessary for providing the system contract. The resource<br />

adapter must implement the following interfaces:<br />

■<br />

javax.resource.spi.ManagedConnection<br />

■<br />

javax.resource.spi.ManagedConnectionFactory<br />

■<br />

javax.resource.spi.ManagedConnectionMetaData<br />

■<br />

■<br />

The ManagedConnection implementation provided by the Resource Adapter must,<br />

in turn, supply implementations of the following interfaces and classes to provide<br />

support to the application <strong>server</strong>. It is the application <strong>server</strong> which will ultimately be<br />

managing the connection and associated transactions.<br />

If your environment is non-managed (that is, not managed by the application<br />

<strong>server</strong>), you are not required to use these interfaces or classes.<br />

javax.resource.spi.ConnectionEvent<br />

javax.resource.spi.ConnectionEventListener<br />

In addition, support for error logging and tracing must be provided by implementing the<br />

following methods in the Resource Adapter:<br />

■<br />

ManagedConnectionFactory.setLogWriter()<br />

■<br />

ManagedConnectionFactory.getLogWriter()<br />

■<br />

ManagedConnection.setLogWriter()<br />

■<br />

ManagedConnection.getLogWriter()<br />

The resource adapter must also provide a default implementation of the<br />

javax.resource.spi.ConnectionManager interface for cases in which the Resource<br />

Adapter is used in a non-managed two-tier application scenario. A default<br />

implementation of ConnectionManager enables the Resource Adapter to provide services<br />

specific to itself. These services can include connection pooling, error logging and<br />

268 BES Developer’s Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!