Obtaining metadata

Server Access for J2EE provides additional information about an ICS connection and about the WebSphere Access Resource Adapter itself. An application component can access this information through the interfaces of the CCI that provide metadata. In Table 15, the Supported Methods column lists those interface methods that Server Access for J2EE implements.

Table 15. Server Access for J2EE CCI Implementation for Obtaining Metadata

CCI Interface Description Supported Methods
ConnectionMetaData , CwConnectionMetaData Provides information about the connection to WebSphere Interchange Server.

The getMetaData() method on a Connection instance returns a ConnectionMetaData instance.

All methods shown in Table 16.
ResourceAdapterMetaData , CwResourceAdapterMetaData Provides information about the WebSphere Access Resource Adapter.

The getMetaData() method on a ConnectionFactory instance returns a ResourceAdapterMetaData instance.

All methods shown in Table 17.

An application component can perform the following tasks to obtain metadata:

Obtaining metadata for a connection

The ConnectionMetaData interface provides information about the connection to the EIS. The implementation of the ConnectionMetaData interface that Server Access for J2EE provides is called CwConnectionMetaData, which allows an application component to obtain information about a connection it has established to InterChange Server through a Connection instance. Table 16 shows the methods that the ConnectionMetaData interface provides for obtaining metadata for a connection. The CwConnectionMetaData interface implements all methods in Table 16.

Table 16. Methods in the ConnectionMetaData interface

ConnectionMetaData method Description
getEISProductName()
WebSphere InterChange Server
getEISProductVersion()
The version of the InterChange Server software, usually of the form:

x.x.x

getUserName()
A user-defined value that is retrieved from the configuration properties

To obtain connection metadata, the application component takes the following steps:

  1. Use the Connection.getMetaData() method to obtain a ConnectionMetaData object.
  2. Use the appropriate ConnectionMetaData method (see Table 16) to obtain the metadata from this object.

Obtaining metadata for the Access Resource Adapter

The ResourceAdapterMetaData interface provides information about the WebSphere Access Resource Adapter. The implementation of the ResourceAdapterMetaData interface that Server Access for J2EE provides is called CwResourceAdapterMetaData, which allows an application component to obtain information about the capabilities of the Access Resource Adapter. Table 17 shows the methods that the ResourceAdapterMetaData interface provides for obtaining metadata for the resource adapter. The CwResourceAdapterMetaData interface implements all methods in Table 17.


Table 17. Methods in the ResourceAdapterMetaData interface

ResourceAdapterMetaData method WebSphere business integration system return value
getAdapterName()
IBM Crossworlds Resource Adapter for InterChange Server
getAdapterShortDescription()
IBM Crossworlds Resource Adapter for InterChange Server
getAdapterVendorName()
IBM Corp.
getAdapterVersion()
1.1.0
getInteractionSpecsSupported()
An array with one element:com.crossworlds.adapter.CwInteractionSpec
getSpecVersion()
1.0
supportsExecuteWithInputAndOutputRecord()
true
supportsExecuteWithInputRecordOnly()
true
supportsLocalTransactionDemarcation()
false

Note:
In Table 17, the return value of true for the methods supportsExecuteWithInputandOutputRecord() and supportsExecuteWithInputRecordOnly() indicates that Server Access for J2EE supports both forms of the Interaction.execute() method. For more information, see "Invoking the execute() method".

To obtain metadata for the Access Resource Adapter, the application component takes the following steps:

  1. Use the ConnectionFactory.getMetaData() method to obtain a ResourceAdapterMetaData object.
  2. Use the appropriate ResourceAdapterMetaData method (see Table 17) to obtain the metadata from this object.

For example, the following lines determine whether Server Access for J2EE supports the first form of the Interaction.execute() method (the form that supports both input and output records):

res_adpt_metadata = connFactory.getMetaData();
if (res_adpt_metadata.supportsExecuteWithInputandOutputRecord())
  {
  // takes steps to initialize input record
 
  // call first form of execute()
  Interaction.execute(.....);

Copyright IBM Corp. 1997, 2004