The following sections describe development and deployment for both user-created senders and user-created handlers.
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.
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.
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>
Any handlers defined for this sender transport must match one of these GatewayConfigurationPoints values.
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>