IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Services and service-related functions > Access external services with adapters > Configure and using adapters > IBM WebSphere Adapters > Adapter Toolkit > Use the New Connector Project wizard
Generate an IBM WebSphere Resource Adapter
You use the wizard to generate adapter classes that correspond to the adapter capabilities you require. This involves choosing the types of adapter classes (outbound, inbound, data binding, or enterprise metadata discovery) you want to generate and then choosing the component properties associated with the adapter classes.
Use the Component Addition option in the Resource Adapter Deployment Descriptor editor to append the code for the newly specified components to the current implementation without override. See Component Addition option in Use the Overview pane.
The following sections describe the adapter classes and their associated component properties.
Outbound adapter classes and associated properties
Generating outbound adapter classes creates code (and in some cases sequence of calls, log and trace messages, and comments) for the methods that must be implemented to produce a resource adapter that can send business events to an EIS. The Adapter Foundation Classes that are extended in your Connector Project when you generate outbound adapter classes, is as follows:
- Connection extends com.ibm.j2ca.base.WBIConnection
- ConnectionFactory extends com.ibm.j2ca.base.WBIConnectionFactory
- ConnectionRequestInfo extends com.ibm.j2ca.base.WBIConnectionRequestInfo
- Interaction extends com.ibm.j2ca.base.WBIInteraction
- InteractionSpec extends com.ibm.j2ca.base.WBIInteractionSpec
- ManagedConnection extends com.ibm.j2ca.base.WBIManagedConnection
- ManagedConnectionFactory extends com.ibm.j2ca.base.WBIManagedConnectionFactory
In addition the following outbound adapter classes are generated directly from the JCA 1.5 interface specification:
- ConnectionSpec implements javax.resource.cci.ConnectionSpec
- ConnectionMetaDataImpl implements javax.resource.cci.ConnectionMetaData
- LocalTransaction implements javax.resource.spi.LocalTransaction
You can select the following properties when generating outbound adapter classes:
- Local transaction support
Generating outbound adapter classes with local transaction support means that the transaction is managed and performed by the EIS. LocalTransaction indicates the IBM WebSphere adapter supports local transactions. Local transaction support methods provide a LocalTransaction implementation and return the wrapper.
WBILocalTransaction implementation covers the following requirements:
- Notifies the JCA container
- Updates the state of transactions on the WBIManagedConnection
When you choose the Local Transaction Support component property from the list of outbound adapter component properties, the wizard creates the following method in the ManagedConnection class:
/** * Does the EIS support local transaction? Provide a LocalTransaction * implementation and return the wrapper. * * @return new instance of WBILocalResourceWrapper * @see javax.resource.spi.ManagedConnection#getLocalTransaction() */ public LocalTransaction getLocalTransaction() throws ResourceException { FooLocalTransaction transaction = new FooLocalTransaction(this); return new WBILocalTransactionWrapper(transaction, this); }For information about how to generate an outbound adapter with local transaction support, see Generate outbound local transaction support methods.
- XA transaction support
Generating outbound adapter classes with XA transaction support means the transaction spans multiple heterogeneous systems. It uses global or two-phase-commit protocol. If a transaction manager coordinates a transaction, that transaction is considered a global transaction.
Using the WBILocalTransaction covers the following requirements:
- Notifies the JCA container
- Updates the state of transactions on the WBIManagedConnection
The getXAResource() method gets the XAResource from your EIS and return the wrapper. The WBIXAResourceWrapper acts as a thin layer delegating all calls to the underlying EIS XAResource instance, at the same time tracking the sequence of calls to monitor and determine when the connection is involved in a transaction and when it is not.
The wizard creates getXAResource() and getLocaltransaction() methods as follows:
Local method
/** * Does the EIS support local transaction? * * @return new instance of WBIXAResourceWrapper * @see javax.resource.spi.ManagedConnection#getLocalTransaction() */ public LocalTransaction getLocalTransaction() throws ResourceException { <AdapterPrefixName>Transaction transaction = new <AdapterPrefixName>LocalTransaction(this); return new WBILocalTransactionWrapper(transaction, this);}XA method
/** * Does the EIS support XA transaction? * Get the XAResource from your EIS and return the wrapper. * * @return new instance of WBIXAResourceWrapper * @see javax.resource.spi.ManagedConnection#getXAResource() */ public XAResource getXAResource() throws ResourceException { return new WBIXAResourceWrapper(null, this);}Further implementation of these methods is needed to support XA transactions.
For information about how to generate XA Transaction support methods, see Generate XA Transaction support methods.
- Command pattern
Generating command pattern classes allows you to break down a hierarchical update into a series of nodes and then generate a collection of subcommands to manage the nodes. An interpreter processes the subcommands, retrieving, and executing the corresponding code. If you choose this option, the wizard generates code for the following classes:
- BaseCommand extends com.ibm.j2ca.extension.commandpattern.CommandForCursor
- CommandFactory implements com.ibm.j2ca.extension.commandpattern.CommandFactoryForCursor
- CreateCommand extends <your package name>.outbound.commandpattern. <your class prefix>BaseCommand
- DeleteCommand extends <your package name>.outbound.commandpattern. <your class prefix>BaseCommand
- NoOperationCommand extends <your package name>.outbound.commandpattern. <your class prefix>BaseCommand
- RetrieveCommand extends <your package name>.outbound.commandpattern. <your class prefix>BaseCommand
- RetrieveAllCommand extends <your package name>.outbound.commandpattern. <your class prefix>BaseCommand
- UpdateCommand extends <your package name>.outbound.commandpattern. <your class prefix>BaseCommand
For information about how to generate command pattern classes, see Generate command pattern classes.
Inbound adapter classes and associated methods
Generating inbound adapter classes creates code for the methods that must be implemented to produce a resource adapter that can send events from an EIS to a business process. The list of Adapter Foundation Classes that are extended in your Connector Project when you choose to generate inbound adapter classes is as follows:
- ActivationSpecWithXid extends com.ibm.j2ca.base.WBIActivationSpecWithXid
- EventStoreWithXid extends com.ibm.j2ca.extension.eventmanagement.EventStoreWithXid
You can select the following properties when generating inbound adapter classes:
- Connection pooling
When you choose the connection pooling component property the wizard creates the ActivationSpecWithXid class that extends WBIActivationSpecForPooling.
For information about how to generate inbound connection pooling support, see Generate inbound connection pooling support.
- Event polling support
Generating inbound adapter classes for event polling support creates code for the methods that must be implemented to produce a resource adapter that can send polling events from an EIS to a business process.
The Adapter Foundation Classes that are extended in your Connector Project when you generate inbound adapter classes for event polling support, is as follows:
- ActivationSpecWithXid extends com.ibm.j2ca.base.WBIActivationSpecWithXid
- EventStoreWithXid extends com.ibm.j2ca.extension.eventmanagement.EventStoreWithXid
When the CommException exception is logged during adapter startup because the EIS is down, stopped, or unreachable, the adapter automatically try the connection if the RetryConnectionOnStartup activation specification property is enabled. If the property is not enabled, the adapter immediately reports the failure. This support is provided by the Adapter Foundation Classes. An adapter user enables this property in the external service wizard by selecting Retry EIS connection on startup on the Service Generation and Deployment Configuration window. The RetryConnectionOnStartup property works with the RetryLimit and RetryInterval properties, which specify the number of times the adapter tries the connection, and the time intervals.
For information about how to generate event polling support, see Generate inbound event polling support.
- Generate inbound callback event support
Generating inbound adapter classes for callback event support creates code for the methods that must be implemented to produce a resource adapter that can send callback events from an EIS to a business process.
The Adapter Foundation Classes that are extended in your Connector Project when you generate inbound adapter classes for callback event support, is as follows:
- ActivationSpecWithXid extends com.ibm.j2ca.base.WBIActivationSpecWithXid
- InboundListener that imports in com.ibm.j2ca.extension.eventmanagment.external.CallbackEventSender
For information about how to generate inbound callback event support, see Generate inbound callback event support.
Data Binding classes
There are no properties associated with data binding classes.
Generating data binding classes creates code for the methods needed to marshall data from SDO to CCI record and from CCI record to SDO.
The Adapter Foundation Classes that are extended in your Connector Project when you generate data binding classes, is as follows:
- DataBinding implements
commonj.connector.runtime.RecordHolderDataBinding
- DataBindingGenerator extends
com.ibm.j2ca.extension.databinding.WBIDataBindingGenerator
For information about how to generate data binding classes, see Generate Data Binding Classes.
Enterprise Metadata Discovery classes
There are no properties associated with Enterprise Metadata Discovery classes.
Generating enterprise metadata discovery classes creates code for the methods needed to produce a service that you can use to glean business object structure and other data from an EIS.
The Adapter Foundation Classes that are extended in your Connector Project when you generate enterprise metadata discovery classes, is as follows:
- AdapterType extends
com.ibm.j2ca.extension.emd.discovery.WBIAdapterTypeImpl
- DataDescription extends
com.ibm.j2ca.extension.emd.description.WBIDataDescriptionImpl
- InboundConnectionConfiguration extends
com.ibm.j2ca.extension.emd.discovery.connection.WBIInboundConnectionConfigurationImpl- InboundConnectionType extends
com.ibm.j2ca.extension.emd.discovery.connection.WBIInboundConnectionTypeImpl- InboundServiceDescription extends
com.ibm.j2ca.extension.emd.description.WBIInboundServiceDescriptionImpl- MetadataDiscovery extends
com.ibm.j2ca.extension.emd.discovery.WBIMetadataDiscoveryImpl
- MetadataEdit extends
com.ibm.j2ca.extension.emd.discovery.WBIMetadataEditImpl
- MetadataImportConfiguration extends
com.ibm.j2ca.extension.emd.discovery.WBIMetadataImportConfigurationImpl- MetadataObject extends
com.ibm.j2ca.extension.emd.discovery.WBIMetadataObjectImpl
- MetadataSelection extends
com.ibm.j2ca.extension.emd.discovery.WBIMetadataSelectionImpl
- MetadataTree extends
com.ibm.j2ca.extension.emd.discovery.WBIMetadataTreeImpl
- OutboundConnectionConfiguration extends
com.ibm.j2ca.extension.emd.discovery.connection.WBIOutboundConnectionConfiguration- OutboundConnectionType extends
com.ibm.j2ca.extension.emd.discovery.connection.WBIOutboundConnectionTypeImpl- OutboundServiceDescription extends
com.ibm.j2ca.extension.emd.description.WBIOutboundServiceDescriptionImpl
In addition to the Adapter Foundation Classes listed above, the following classes are also generated, to help you:
- Constants
Contains enterprise metadata discovery constant variables.
- StringCaseChanger
A formatting utility to modify a business object or attribute name.
For information about how to generate Enterprise Metadata Discovery classes, see Generate Enterprise Metadata Discovery classes .
- Generate outbound adapter classes
Generate outbound adapter classes for an adapter that sends requests from a client application to an enterprise information system.- Generate inbound adapter classes
Generate inbound adapter classes for notifying a business process of an inbound event from the EIS.- Generate enterprise metadata discovery classes
The enterprise metadata discovery classes are used by the external service discovery tool in Integration Designer to introspect an EIS to create business objects and other artifacts.- Generate data binding classes
You can generate data binding classes separately from the data binding classes that are generated from enterprise metadata discovery.
Use the New Connector Project wizard
Previous topic: Specify generation options
Next topic: Generate a JCA resource adapter