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 > Implementing code from the IBM WebSphere Adapter Toolkit > Enterprise metadata discovery general interfaces and implementation for application adapters > Enterprise metadata discovery implementation samples

WBIAdapterTypeImpl sample

You use this class to implement the adapter type for enterprise metadata discovery.

Extend WBIAdapterTypeImpl and implement the methods described in the sections below.


Constructor

The constructor populates the adapter type instance as shown below:

public <AdapterPrefixName>AdapterType()throws MetadataException{
super(Constants.RESOURCE_ADAPTER_BEAN_NAME, 2, 1);
setId(Constants.ADAPTER_NAME);
setDisplayName(Constants.ADAPTER_NAME);
setDescription(WBIMetadataDiscoveryImpl.getPropertyDescription
(ADAPTERTYPE_PROPERTY));
setVendor(VENDOR);
setVersion(VERSION);
setOutboundConnections();
setInboundConnections();}


setInboundConnections

The setInboundConnections() method sets the inbound connections on the adapter type.

private void setInboundConnections() throws MetadataException {
<AdapterPrefixName>InboundConnectionType inConnTypeForRuntime =
new <AdapterPrefixName>InboundConnectionType(this);
addInboundConnectionType(inConnTypeForRuntime);
inConnTypeForRuntime.setResourceAdapterJavaBean
(Constants.RESOURCE_ADAPTER_BEAN_NAME);
inConnTypeForRuntime.setActivationSpecJavaBean
(Constants.ACTIVATION_SPEC);}


setOutboundConnections

This method sets the outbound connections on the adapter type. The connection type that can be used to perform discovery should be set to true for IsSupportedInMetadataService and connections that can be used for run time should be set to true for IsSupportedAtRuntime.

You might find it preferable to have separate connection types for enterprise metadata discovery and for run time. This way the property group for discovery can display properties needed to perform the discovery and not the entire set of properties describing ResourceAdapter and ManagedConnectionFactory properties.

private void setOutboundConnections() throws MetadataException {
<AdapterPrefixName>OutboundConnectionType outConnTypeForRuntime =
new <AdapterPrefixName>OutboundConnectionType(this);
<AdapterPrefixName>OutboundConnectionType outConnTypeForMetadata =
new <AdapterPrefixName>OutboundConnectionType(this);
addOutboundConnectionType(outConnTypeForMetadata);
addOutboundConnectionType(outConnTypeForRuntime);
outConnTypeForMetadata.setManagedConnectionFactoryJavaBean
(Constants.MANAGED_CONNECTION_FACTORY_NAME);
outConnTypeForRuntime.setManagedConnectionFactoryJavaBean
(Constants.MANAGED_CONNECTION_FACTORY_NAME);
outConnTypeForMetadata.setResourceAdapterJavaBean
(Constants.RESOURCE_ADAPTER_BEAN_NAME);
outConnTypeForRuntime.setResourceAdapterJavaBean
(Constants.RESOURCE_ADAPTER_BEAN_NAME);
outConnTypeForMetadata.setIsSupportedInMetadataService(true);
outConnTypeForMetadata.setIsSupportedAtRuntime(false);
outConnTypeForRuntime.setIsSupportedInMetadataService(false);
outConnTypeForRuntime.setIsSupportedAtRuntime(true);}

Enterprise metadata discovery implementation samples