Development and deployment

The following sections describe development and deployment for both user-created senders and user-created handlers.

Development environment

The sender and sender handler development API relies on classes and interfaces from this package: com.ibm.bcg.bcgdk.gateway

This package is part of the bcgsdk.jar file, which is found among the WebSphere Partner Gateway installable files in the following directories:

In all deployed instances, this JAR file must be available in the application server classpath and not in the module classpath.

For development, the bcgsdk.jar file must be included in the build path of the project that contains the user exit classes, that is, in the classpath.

Deployment and packaging (senders)

All user-created code needs to be made available to the run-time environment. For use during runtime, package and deploy user-created code in one of the following ways:

Adding the JAR or class files to the run-time environment makes them available only if the transport or handler is configured to be used by the run-time environment. Sender transports and handlers are configured for use like the other product-provided transports and handlers. To configure them, you must first make them known to the Community Console. You do this by importing their definitions into the Community Console by means of an XML descriptor file.

To import a sender transport, click Account Admin > Profiles > Gateways > Manage Transport Types.

To import a sender transport handler, click Hub Admin > Hub Configuration > Handlers > Gateway > Import. One of the descriptors is the handler type. Only defined handler types are allowed and are based on the transport gateway configuration points. For user-defined transports, the transport descriptor file must be imported first to provide the handler type.

Descriptor file definition for a sender transport

The sender transport descriptor file uses the bcggateway.xsd schema. Following is a brief outline for each of the elements in the descriptor file based on the following example:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2004 IBM Corp. - All Rights Reserved.-->
<!-- IBM makes no representations or warranties about the suitability of -->
<!-- this program, either express or implied, including but not limited to -->
<!-- the implied warranties of merchantability, fitness for a particular -->
<!-- purpose, or non-infringement. -->
<tns:GatewayDefinition
    xmlns:tns="http://www.ibm.com/websphere/bcg/2004/v0.1/import/external"
    xmlns:tns2="http://www.ibm.com/websphere/bcg/2004/v0.1/import/external/types"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.ibm.com/websphere/bcg/2004/v0.1/import/external
    bcggateway.xsd http://www.ibm.com/websphere/bcg/2004/v0.1/import/external/types
bcgimport.xsd ">
<tns:GatewayClassName>com.mycompany.MyHTTPGateway</tns:GatewayClassName>
<tns:Description>My companies HTTP Gateway</tns:Description>
<tns:TransportTypeName>MYHTTP</tns:TransportTypeName>
<tns:TransportAttributes>
<tns2:ComponentAttribute>
<tns2:AttributeName>Timeout</tns2:AttributeName>
<tns2:AttributeDefaultValue>300</tns2:AttributeDefaultValue>
</tns2:ComponentAttribute>
</tns:TransportAttributes>
<tns:GatewayConfigurationPoints>
<tns:Postprocess>GATEWAY.POSTPROCESS.MYHTTP</tns:Postprocess>
</tns:GatewayConfigurationPoints>
</tns:GatewayDefinition>
GatewayClassName
The full class name of the sender implementation
Description
General description for the transport
TransportTypeName
The name that will appear in the Transport list in the Console Target List page
TransportAttributes
(optional) Any attributes that this transport can have
ComponentAttribute
An attribute's name and default values that are used to provide configuration information to the target at runtime
AttributeName
The name of a specific attribute
AttributeDefaultValue
(optional) The attribute's default value
GatewayConfigurationPoints
(optional) The names of the configuration points that this transport might have
Preprocess
GATEWAY.PREPROCESS.xxx, the name of a preprocessing configuration point being defined, where xxx is the value of the TransportTypeName attribute
Postprocess
GATEWAY.POSTPROCESS.xxx, the name of a postprocessing configuration point being defined, where xxx is the value of the TransportTypeName attribute

Any handlers defined for this sender transport must match one of these GatewayConfigurationPoints values.

Descriptor file definition for a sender transport handler

The sender transport handler descriptor file uses the bcghandler.xsd schema. The following example presents a brief outline for each of the elements in the descriptor file:

<?xml version="1.0" encoding="UTF-8"?>
<tns:HandlerDefinition
     xmlns:tns="http://www.ibm.com/websphere/bcg/2004/v0.1/import/external"
     xmlns:tns2="http://www.ibm.com/websphere/bcg/2004/v0.1/import/external/types"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.ibm.com/websphere/bcg/2004/v0.1/import/external
     bcghandler.xsd http://www.ibm.com/websphere/bcg/2004/v0.1/import/external/types
     bcgimport.xsd ">
<tns:HandlerClassName>com.mycompany.SenderHandler</tns:HandlerClassName>
<tns:Description>My company's handler for my business protocol and multiple
     transports.</tns:Description>
<tns:HandlerTypes>
<tns:HandlerTypeValue>GATEWAY.POSTPROCESS.MYHTTP</tns:HandlerTypeValue>
<tns:HandlerTypeValue>GATEWAY.POSTPROCESS.JMS</tns:HandlerTypeValue>
</tns:HandlerTypes>
<tns:HandlerAttributes>
<tns2:ComponentAttribute>
<tns2:AttributeName>Attribute 1</tns2:AttributeName>
</tns2:ComponentAttribute>
<tns2:ComponentAttribute>
<tns2:AttributeName>Attribute 2</tns2:AttributeName>
<tns2:AttributeDefaultValue>Attribute2DefaultValue</tns2:AttributeDefaultValue>
</tns2:ComponentAttribute>
</tns:HandlerAttributes>
</tns:HandlerDefinition>
HandlerClassName
The full class name of the handler implementation.
Description
General description of the handler.
HandlerTypes
The handler types with which the handler can be used. For transports, the handler type corresponds to the GatewayConfigurationPoint values defined for that transport. To see a list of the currently defined transport handler types, click Hub Admin > Hub Configuration > Handlers > Gateway > HandlerTypes.
HandlerTypeValue
The HandlerType value that corresponds to the GatewayConfigurationPoints value. A handler can be associated with more than one transport type.
HandlersAttributes
(optional) Any attributes that this handler can have.
ComponentAttribute
An attribute's name and default values that are used to provide configuration information to the handler at runtime.
AttributeName
The name of a specific attribute.
AttributeDefaultValue
(optional) The attribute's default value.

Copyright IBM Corp. 2003, 2005