6-5 ADK Install and Users Guide
6-5 ADK Install and Users Guide
Version 6.5
October 2010
Copyright
This document applies to webMethods Adapter Development Kit Version 6.5 and to all subsequent releases.
Specifications contained herein are subject to change and these changes will be reported in subsequent release notes or new editions.
Copyright © 2008-2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its
affiliates and/or their licensors.
The name Software AG and all Software AG product names are either trademarks or registered trademarks of Software AG and/or
Software AG USA Inc. and/or its subsidiaries and/or its affiliates and/or their licensors. Other company and product names mentioned
herein may be trademarks of their respective owners.
Detailed information on trademarks and patents owned by Software AG and/or its subsidiaries is located at
http://documentation.softwareag.com/legal/.
Use of this software is subject to adherence to Software AG's licensing conditions and terms. These terms are part of the product
documentation, located at http://documentation.softwareag.com/legal/ and/or in the root installation directory of the licensed product(s).
This software may include portions of third-party products. For third-party copyright notices and license terms, please refer to "License
Texts, Copyright Notices and Disclaimers of Third Party Products”. This document is part of the product documentation, located at
http://documentation.softwareag.com/legal/ and/or in the root installation directory of the licensed product(s).
1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
What is the Adapter Development Kit? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Points of Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Data-Level Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Application Interface-Level Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Method-Level Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
User Interface-Level Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Development-Time Tasks and Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Create the Adapter Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Define Connections and Connection Factories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Define Adapter Service Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Define Polling Notification Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Define Listener Notification Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Define Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Transaction Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Exception Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Logging Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Internationalization Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Design-Time Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
The Run-Time Conceptual Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 3
Specifying Your JDK in Your Classpath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Modifying Your Classpath for Startup and Shutdown Services . . . . . . . . . . . . . . . 38
Creating an Adapter Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Registering Your Adapter's Major Code with Software AG . . . . . . . . . . . . . . . . . . . . . . 39
Adapter Definition Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Adapter Definition Implementation Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Creating a WmAdapter Implementation Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Describing the Adapter to Integration Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Describing the Adapter's Resources to Integration Server . . . . . . . . . . . . . . . . . . . . . . 43
Initializing and Cleaning Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Adding Custom DSPs to the Adapter Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Internationalization Considerations for Custom DSPS . . . . . . . . . . . . . . . . . . . . . 44
Example WmAdapter Implementation Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Creating Resource Bundles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Resource Bundle Lookup Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Considerations for Adapter Definition Lookup Keys . . . . . . . . . . . . . . . . . . . . . . . 52
Considerations for Specifying URLs in Resource Bundles . . . . . . . . . . . . . . . . . . 52
Example Resource Bundle Implementation Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Deploying the Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Creating Adapter Startup and Shutdown Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Example Adapter Startup and Shutdown Services . . . . . . . . . . . . . . . . . . . . . . . . 54
Compiling the Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Debugging the Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Registering the Adapter Startup and Shutdown Services in Software AG Designer . . 57
The Adapter Load Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
The Adapter Unload Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Reporting Adapter Fix Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
4. Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Connection Factories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Connection Management Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Connection Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Overview of Creating Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Connection Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Adapter Connection Implementation Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Creating a WmManagedConnection Implementation Class . . . . . . . . . . . . . . . . . . . . . . . . 68
Example WmManagedConnection Implementation Class . . . . . . . . . . . . . . . . . . . . . . 69
Creating a WmManagedConnectionFactory Implementation Class . . . . . . . . . . . . . . . . . . 70
Connection Callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
webMethods Metadata Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Metadata Parameter Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Metadata Parameter Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Metadata Parameter get Accessor Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
The WmDescriptor Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
4 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
Example WmManagedConnectionFactory Implementation Class . . . . . . . . . . . . . . . . 74
Updating the Resource Bundle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Updating AdapterTypeInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Connection Class Interactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Retrieving Connection Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Enabling Connection Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Creating Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Disabling Connection Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Releasing Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Receiving AdapterConnectionExceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Configuring and Testing Connection Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
5. Adapter Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Adapter Service Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Registering Adapter Service Templates in Connection Factories . . . . . . . . . . . . . . . . 86
The Metadata Model for Adapter Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Metadata Parameters for Adapter Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
The WmTemplateDescriptor Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
The WmTemplateDescriptor Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Resource Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Registering Resource Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
The addResourceDomain Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
The addResourceDomainLookup Method . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Example of Registering Resource Domains . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Associating Metadata Parameters with Resource Domains . . . . . . . . . . . . . . . . . 92
Parameter Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Populating Resource Domains with Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Resource Domain Lookups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Adapter Check Value Callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Field Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Tuples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Field Maps with Resource Domain Dependencies . . . . . . . . . . . . . . . . . . . . . . . . 100
Adapter Service Node Signatures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Implementing Resource Domain Lookups for Signature Names and Data Types 103
Field Name String Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Data Type String Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Adapter Service Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Interacting with the Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
The getIData Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Adapter Service Template Interactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Creating Adapter Service Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Selecting Connection Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Entering Names and Folders for Adapter Service Nodes . . . . . . . . . . . . . . . . . . . 107
Viewing or Editing Adapter Service Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 5
Executing Adapter Service Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Adapter Service Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Defining a WmAdapterService Implementation Class . . . . . . . . . . . . . . . . . . . . . . . . . 111
Updating the Resource Bundle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Specifying Adapter Service Configuration Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Creating "Data Entry" Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Specifying the Display and Data Entry Attributes of the "Data Entry" Parameters 112
Placing the Column Names and Column Data Types Parameters in a Field Map 112
Placing the Column Names and Column Types Parameters in a Tuple . . . . . . . . 112
Implementing Adapter Service Configuration Resource Domains . . . . . . . . . . . . . . . . 113
Manipulating Adapter Service Signature Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Template-Based Signature Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Signature Field Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Specifying Adapter Service Signature Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Specifying Adapter Service Signature Resource Domains . . . . . . . . . . . . . . . . . . . . . . 117
Implementing the WmAdapterService.execute Method . . . . . . . . . . . . . . . . . . . . . . . . 118
Code Example 1: WmAdapterService Implementation Class . . . . . . . . . . . . . . . . . . . . 118
Code Example 2: WmManagedConnection Implementation Class Updates . . . . . . . . 122
Code Example 3: Resource Bundle Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Configuring and Testing Adapter Service Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
6 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
Configuring and Testing Polling Notification Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Example Polling Notification: SimpleNotification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Cluster Support for Polling Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Callback Coordination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Polling Coordination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Configuration Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Global Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Adapter-Specific Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Node-Specific Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 7
Configuring Adapter Service Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Polling Notification Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Configuring Polling Notification Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Scheduling and Enabling Polling Notification Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Listener Notification Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Configuring Listener Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Configuring Listener Notification Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Enabling Listener Notification Nodes and Listener Nodes . . . . . . . . . . . . . . . . . . . . . . 188
8 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
WmART.pub.art.transaction:setTransactionTimeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
WmART.pub.art.transaction:startTransaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Changing the Integration Server's Transaction Timeout Interval . . . . . . . . . . . . . . . . . 224
Transaction Error Situations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Specifying Transaction Support in Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 9
Banking Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Banking Event Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Banking Alerts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Prerequisites for Code Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Phase 1: Creating an Adapter Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Compiling the Phase 1 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Before you begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Creating the WmSampleAdapter1 Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Compiling the WmSampleAdapter1 Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Testing the WmSampleAdapter1 Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Disabling or Deleting Your Copy of the Phase 1 Implementation . . . . . . . . . . . . . . . . . 275
Phase 2: Adding a Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Implementing the Connection Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Revised Code From Phase 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Compiling the Phase 2 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Creating the TestSampleAdapter2 Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Configuring the Connection Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Testing the Connection Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Disabling or Deleting Your Copy of the Phase 2 Implementation . . . . . . . . . . . . . . . . . 280
Phase 3: Adding Adapter Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Implementing the Adapter Service Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Implementing the execute Method in the FunctionInvocation Class . . . . . . . . . . . 282
Revised Code From Phases 1 and 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Compiling the Phase 3 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Creating the TestSampleAdapter3 Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Configuring the Deposit Adapter Service Node . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Testing the Deposit Adapter Service Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Disabling or Deleting Your Copy of the Phase 3 Implementation . . . . . . . . . . . . . . . . . 286
Phase 4: Adding Polling Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Implementing the Polling Notification Template . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Implementing the runNotification Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Revised Code From Phases 1, 2, and 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Compiling the Phase 4 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Configuring and Testing the Polling Notification Nodes . . . . . . . . . . . . . . . . . . . . . . . . 289
Creating the TestSampleAdapter4 Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Configuring the underBalancePolling Notification Node . . . . . . . . . . . . . . . . . . . . 290
Creating the Flow Service for the underBalancePolling Notification Node . . . . . . 291
Creating the Trigger for the underBalancePolling Notification Node . . . . . . . . . . . 292
Scheduling and Enabling the underBalancePolling Notification Node . . . . . . . . . . 292
Testing the underBalancePolling Notification Node . . . . . . . . . . . . . . . . . . . . . . . . 293
Disabling or Deleting Your Copy of the Phase 4 Implementation . . . . . . . . . . . . . . . . . 293
Phase 5: Adding Listener Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Implementing the Listener . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
Implementing the Asynchronous Listener Notification Template . . . . . . . . . . . . . . . . . 295
Revised Code From Phases 1, 2, 3, and 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
10 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
Configuring and Testing the Listener and the Listener Notification Nodes . . . . . . . . . . 297
Creating the TestSampleAdapter Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
Configuring the Listener Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
Configuring the checkDepositListener Notification Node . . . . . . . . . . . . . . . . . . . 299
Creating the Flow Service for the checkDepositListener Notification Node . . . . . 300
Creating the Trigger for the checkDepositListener Notification Node . . . . . . . . . . 300
Enabling the checkDepositListener Notification Node and the Listener Node . . . 301
Testing the checkDepositListener Notification Node . . . . . . . . . . . . . . . . . . . . . . . 301
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 11
12 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
About this Guide
This guide describes how to install, upgrade, and uninstall Adapter Development Kit, as
well as how to configure and use it. This guide contains information for application
developers who want to create adapters that interact with webMethods Integration
Server.
To use this guide effectively, you should be familiar with:
Terminology and basic operations of your operating system
How to perform basic tasks with Integration Server and webMethods Developer or
Software AG Designer
This version of the webMethods Adapter Development Kit Installation and User’s Guide
contains the most up to date information about the Adapter Development Kit. This
version obsoletes, replaces, and supersedes all previous versions.
Document Titles
Some webMethods document titles have changed during product releases. The following
table will help you locate the correct document for a release on the Software AG
Documentation Web site or the Empower Product Support Web site.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 13
About this Guide
14 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
About this Guide
Document Conventions
Convention Description
Bold Identifies elements on a screen.
Narrowfont Identifies storage locations for services on webMethods Integration
Server, using the convention folder.subfolder:service.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 15
About this Guide
Convention Description
UPPERCASE Identifies keyboard keys. Keys you must press simultaneously are
joined with a plus sign (+).
Italic Identifies variables for which you must supply values specific to
your own situation or environment. Identifies new terms the first
time they occur in the text.
Monospace font Identifies text you must type or messages displayed by the system.
{} Indicates a set of choices from which you must choose one. Type
only the information inside the curly braces. Do not type the { }
symbols.
| Separates two mutually exclusive choices in a syntax line. Type one
of these choices. Do not type the | symbol.
[] Indicates one or more options. Type only the information inside the
square brackets. Do not type the [ ] symbols.
... Indicates that you can type multiple options of the same type. Type
only the information. Do not type the ellipsis (...).
Online Information
Software AG Documentation Website
You can find documentation on the Software AG Documentation website at
http://documentation.softwareag.com. The site requires Empower credentials. If you do
not have Empower credentials, you must use the TECHcommunity website.
Software AG TECHcommunity
You can find documentation and other technical information on the Software AG
TECHcommunity website at http://techcommunity.softwareag.com. You can:
Access product documentation, if you have TECHcommunity credentials. If you do
not, you will need to register and specify "Documentation" as an area of interest.
Access articles, code samples, demos, and tutorials.
16 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
About this Guide
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 17
About this Guide
18 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
1 Overview
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 19
1 Overview
20 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
1 Overview
Points of Integration
Before you build an adapter, determine which "point of integration" is most appropriate
for integrating your back-end system. When determining this, consider such factors as
the type and volume of information you need to move between systems, and the number
of systems you need to integrate. The major "point of integration" types include the
following:
Data-Level Integration
An Enterprise Information System (EIS) that is integrated at the data level is one that
moves data between data stores. That is, the data stores in your EIS are involved in
processing or storing transaction data received from outside the EIS.
For example, you might need to expose a catalog and pricing database to customers to
enable them to transact with it. Assuming that this database has a JDBC driver, you can
use the database as your point of integration. That is, it would be the mechanism you use
to build your adapter.
You might have several of your databases involved in an integration scheme. Suppose
that in addition to the catalog and pricing database, you need to reference or update data
located in another database to process a customer transaction. For example, suppose that
after you extract data from an EIS-to-Integration Server purchase order (such as item,
quantity, and price), you:
Process that data using another database (perhaps you subtract the quantity ordered
from the quantity in inventory, which is located in another database)
Store the result (the updated quantity in inventory) in that other database.
Method-Level Integration
An EIS that is integrated at the method level is similar to one that is integrated at the
application interface level. Using this point of integration, you can enable any application
to access the methods of any application in your EIS.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 21
1 Overview
22 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
1 Overview
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 23
1 Overview
24 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
1 Overview
Define Metadata
Connection factories, adapter service templates, polling notification templates, and
listener notification templates all support a metadata interface. Metadata that you create
in your adapter implementation primarily supports design-time activities. It describes
parameters that the adapter users use to create namespace nodes for connections, adapter
services, and notifications, and describes the data passed to and from adapter services
and notification nodes.
When an adapter user creates a namespace node, the server interrogates the adapter for
metadata to describe the parameter values supported by the node. The node stores the
parameter values selected or entered by the user. These parameters are used to configure
the appropriate implementation class when it is instantiated at run time.
Metadata parameter values are derived from the adapter's resource domain. A resource
domain defines the domain of valid values for metadata parameters, based on rules
and/or data that are specific to the adapter resource. A resource domain can have a name,
a set of resource domain values, properties that affect the behavior of the resource
domain, and associations with metadata parameters.
A resource domain can be either fixed or dynamic. A fixed resource domain displays
default values that you provide for the resource domain parameters. With a dynamic
resource domain, you use a method that enables the adapter to look up values for the
parameters.
You can use resource domain values to constrain the values of parameters, to enable
dynamic validation of user-supplied data, and to disable parameters, based on specific
sets of values in other parameters. A common use of resource domain values is to create a
drop-down list of values for a parameter.
With both fixed and dynamic resource domains, you can allow adapter users to enter
their own values. In addition, you can enable the adapter to validate these values using
callbacks known as adapter check values.
With adapter services and polling notifications, resource domain values can interact with
the Adapter Service Editor and the Adapter Notification Editor. As values in one
parameter change, callbacks are made to the adapter to update resource domain values.
In addition, the adapter can retrieve resource domain values directly from the adapter
resource.
A parameter may contain a single value or an array of values. Parameters that hold arrays
of values are called sequence parameters. The user interface for configuring connections
does not allow you to populate more than the first element of a sequence parameter.
The metadata model provides the ability to:
Define groups of parameters that will appear on different pages in the user interface.
Define resource domain lookups that return drop-down lists of possible values for a
parameter. Resource domain lookups may return values established at development
time and/or retrieved at design time from the resource with which the adapter
communicates.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 25
1 Overview
Transaction Support
Integration Server considers a transaction to be one or more interactions with one or
more resources that are treated as a single logical unit of work. The interactions within a
transaction are either all committed or all rolled back. For example, if a transaction
includes multiple database inserts, and one or more inserts fail, all inserts are rolled back.
Integration Server supports the following kinds of transactions:
A local transaction, which is a transaction to a resource's local transaction mechanism
An XAResource transaction, which is a transaction to a resource's XAResource
transaction mechanism
Integration Server can automatically manage both kinds of transactions, without
requiring the adapter user to do anything. Integration Server uses the container-managed
(implicit) transaction management approach as defined by the JCA standard and also
performs some additional connection management. This is because adapter services use
connections to create transactions. However, there are cases where the adapter user needs
to explicitly control the transactional units of work.
26 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
1 Overview
Exception Support
The ADK provides standard exception classes that enable the adapter implementation to
inform the server of exception conditions encountered by the adapter implementation.
Any exception thrown from an adapter implementation will be caught and logged in the
IS server and error logs. For details about the standard ADK exceptions, see the Javadoc
for the com.wm.adk.error package.
Logging Support
The ADK provides the adapter with write access to the IS server and error logs. It also
provides the ability to determine whether a particular message at a particular log level
will be written to the log. All log messages generated by an adapter are stamped with the
current date and time, as well as codes that uniquely identify the adapter generating the
message. Logging services are tightly integrated with the resource bundle facilities for
internationalization support. For more information, see the Javadoc for
com.wm.adk.log.ARTLogger.
Internationalization Support
If you plan to run your adapter in multiple locales, you can internationalize an adapter
quickly, without having to change any code in the adapter. To accomplish this, you use
resource bundles. A resource bundle typically contains all display strings and messages
used by the adapter at run time and at design time. A resource bundle is specific to a
particular locale.
For more information, see “Creating Resource Bundles” on page 46.
Design-Time Tasks
At design time, adapter users will configure and initialize the run-time components of
the adapter. To do this, they will use the following kinds of Integration Server (IS)
packages:
The adapter package, which contains the adapter run-time components as well as the
ADK classes that you, the adapter developer, extend to produce the adapter
implementation.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 27
1 Overview
A namespace node package, in which adapter users will create the adapter's namespace
nodes for connections, adapter services, polling notifications, and listener
notifications.
A namespace node (or node) is based on its corresponding Java classes. For example, a
connection node is based on the Java connection classes created at development time.
Design-time tasks include the following:
Create one or more namespace node packages.
Create and initialize namespace nodes for connections, adapter services, polling
notifications, listeners, and listener notifications. Adapter users can place all the
nodes of an adapter in one package, or distribute them among multiple packages.
Load the adapter package and namespace node packages into Integration Server.
To perform these tasks, adapter users require access to Integration Server, Designer or
Developer, and a web browser.
For more information, see “Design-Time Tasks” on page 175.
28 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
1 Overview
In the diagram, entity icons represent namespace nodes, while standard class icons
represent the implementation classes. The (unlabeled) dependency lines show direct
references between classes and/or nodes. Thus, the adapter implementation class will
directly reference supported connections or notification templates by directly referencing
the connection factory and notification implementation class. The connection factory for
each connection type references the service implementation class of each supported
adapter service template.
Each namespace node depends on an implementation class. The implementation class for
each node provides metadata that describes the data that is included in the node at
design time. The node provides parameter settings that are passed back to the
implementation class when that class is executed at run time. Note that service and
notification nodes require a reference to a connection node that provides access to the
resource.
For more information, see “Run Time Activities” on page 191.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 29
1 Overview
30 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
2 Installing, Upgrading, and Uninstalling the Adapter
Development Kit
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Installing Adapter Development Kit 6.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Upgrading to Adapter Development Kit 6.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Uninstalling Adapter Development Kit 6.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 31
2 Installing, Upgrading, and Uninstalling the Adapter Development Kit
Overview
This chapter explains how to install, upgrade, and uninstall Adapter Development Kit
6.5. The instructions use Software AG Installer and Software AG Uninstaller For
complete information about other installation methods or installing other webMethods
products, see the webMethods installation guide for your release. See “About this Guide”
for specific document titles.
Requirements
For a list of the operating systems, webMethods Integration Server releases, webMethods
Developer releases, and Software AG Designer releases supported by the Adapter
Development Kit, see the webMethods Adapters System Requirements.
Adapter Development Kit 6.5 has no hardware requirements beyond those of its host
Integration Server.
32 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
2 Installing, Upgrading, and Uninstalling the Adapter Development Kit
Component Location
webMethods Adapter Integration Server_directory\doc\adk directory
Development Kit
Installation and User’s
Guide
Adapter Development Integration Server_directory\doc\api\adk directory
Kit API Reference
(Javadocs)
Sample Adapter Integration Server_directory\packages directory
(WmSampleAdapter
package) and Sample
Server for use with the
Sample Adapter.
In the product selection list, select Adapters > webMethods Adapter Development Kit 6.5.
2 To install documentation for Adapter Development Kit, on the Documentation panel
in Installer, select Adapter Readmes and Documentation. Alternatively, you can download
the adapter documentation at a later time from the Software AG Documentation Web
site.
3 After installation is complete, start the host Integration Server.
Important! Upgrading removes all installed Adapter Development Kit 6.0.1 or 6.1
components. You will not be able to restore the earlier version.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 33
2 Installing, Upgrading, and Uninstalling the Adapter Development Kit
3 Start Uninstaller, selecting the webMethods installation directory that contains the
host Integration Server. In the product selection list, select Adapters > webMethods
Adapter Development Kit.
4 Restart the host Integration Server.
5 Uninstaller removes all Adapter Development Kit 6.5 related files that were installed
into the Integration Server installation directory. However, Uninstaller will not delete
the Integration Server_directory\packages\WmSampleAdapter directory if you added
any files to it. You can delete this directory manually.
34 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
3 The Adapter Definition
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Setting Up Your Environment for Adapters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Adapter Definition Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Adapter Definition Implementation Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Creating a WmAdapter Implementation Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Creating Resource Bundles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Deploying the Adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 35
3 The Adapter Definition
Overview
This chapter describes how to create an adapter definition. An adapter definition is the
framework of an adapter. Although an adapter definition is recognized as an adapter by
Integration Server, it lacks functionality. Other chapters describe how to add
functionality by defining templates for connections, adapter services, polling
notifications, and listener notifications.
To create an adapter definition, you perform the following tasks:
Set up your environment for the adapter.
You modify your classpath, create a package to contain the adapter, and register the
adapter's major code with Software AG. For more information, see “Setting Up Your
Environment for Adapters” on page 37.
Create an adapter definition implementation class.
This class, which must extend the base class WmAdapter, represents the main class of
the adapter. In this class, you create services and methods that:
Describe the adapter to Integration Server.
Describe the adapter's resources to Integration Server, including its connection
factories, notification templates, and its default resource bundle implementation
class.
Initialize resources and properties referenced by the adapter definition when the
adapter is enabled, and clean up the resources when the adapter is disabled
(optional).
Load the adapter onto Integration Server when the adapter is enabled, and
unload the adapter when the adapter is disabled.
For more information, see “Creating a WmAdapter Implementation Class” on
page 41.
Create one or more resource bundles.
This class, which must extend the base class java.util.ListResourceBundle, typically
contains all display strings and messages used by the adapter at run time and at
design time. A resource bundle is specific to a particular locale. If you plan to run
your adapter in multiple locales, you can include a resource bundle for each locale.
Doing this enables you to internationalize an adapter quickly, without having to
change any code in the adapter. Each adapter must have one or more resource
bundles. For more information, see “Creating Resource Bundles” on page 46.
Deploy the adapter.
You will:
Create startup and shutdown services.
For more information, see “Creating Adapter Startup and Shutdown Services” on
page 54.
36 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
3 The Adapter Definition
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 37
3 The Adapter Definition
Important! You must set the package dependency to the WmART package. You may set the
version to the value *.*. The WmART package is automatically installed when you install
Integration Server.
Designer or Developer creates a directory structure in which you can begin your adapter
development, as shown below. Use the adapterName\code\source directory as your
source base. Under the code\source directory, create directories corresponding to your
Java package structure (for example, com\mycompany\adapter\myAdapter).
When you construct your build scripts, make sure they place your compiled code in the
\code\classes directory.
38 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
3 The Adapter Definition
IS package structure
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 39
3 The Adapter Definition
40 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
3 The Adapter Definition
This chapter discusses the classes that implement the following classes:
WmAdapter (see “Creating a WmAdapter Implementation Class” on page 41)
ListResourceBundle (see “Creating Resource Bundles” on page 46)
AdapterAdmin (see “Deploying the Adapter” on page 53)
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 41
3 The Adapter Definition
Describe the adapter to Integration Server (see “Describing the Adapter to Integration
Server” on page 42).
Describe the adapter's resources to Integration Server, including its connection
factories, polling notification templates, listener notification templates, and its default
resource bundle implementation class (see “Describing the Adapter's Resources to
Integration Server” on page 43).
Initialize resources and properties referenced by the adapter definition when the
adapter is enabled, and clean up the resources when the adapter is disabled (optional;
see “Initializing and Cleaning Up” on page 43).
Add custom Dynamic Server Pages (DSPs) to your adapter's administrative interface
(optional; see “Adding Custom DSPs to the Adapter Interface” on page 44).
The following sections describe the basic steps for implementing, deploying, and
debugging an adapter definition. An example WmAdapter implementation class is
presented in “Example WmAdapter Implementation Class” on page 45. Other chapters
introduce more advanced techniques that make your adapter more manageable as you
expand its functionality.
42 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
3 The Adapter Definition
Note: When specifying any resource, you must use the fully qualified name of the
resource's associated implementation class (rather than an object instance).
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 43
3 The Adapter Definition
Method Description
getUiItemNames() Returns a list of the label strings to insert in the left-hand panel
of the Integration Server Administrator page for the adapter.
Each label represents a link to the DSP to be executed.
getUiItemUrl Returns the URL of the DSP associated with the given
itemName. This effectively binds the displayable item link/label
(String itemName)
name with the DSP to launch when the adapter user selects that
link. The URL is relative to the packages directory of the server
installation. For example, if your adapter name is WmFoo and
your DSP is bar.dsp, the URL would be \WmFoo\bar.dsp. In the
file system, however, the .dsp file actually resides in
packages\WmFoo\pub\bar.dsp; the pub directory is not
included in the URL. You may also append arguments to the
URL, using the standard notation ?=.
getUiItemHelp Returns the URL of the help file describing the custom DSP page
associated with the given itemName. The pathname
(String itemName)
requirements are the same as for getUiItemUrl(). For example, if
your help file is located in \WmFoo\pub\bar_dsp.html, the
path returned by this method should be
\WmFoo\bar_dsp.html.
The labels for these DSPs appear in the navigation area in the left-hand window of the
interface, immediately below the default labels (the Connections, Polling Notifications,
Listeners, and Listener Notifications labels) but above the About label.
For information about creating DSPs, see the document Dynamic Server Pages and Output
Templates Developer’s Guide.
44 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
3 The Adapter Definition
This line of code in a static initializer of a resource bundle will produce the undesirable
results described above.
The following example WmAdapter implementation class includes only the concepts
discussed up to this point.
package com.mycompany.adapter.myadapter;
import com.wm.adk.WmAdapter;
import com.wm.adk.error.AdapterException;
import com.wm.adk.info.AdapterTypeInfo;
import com.wm.adk.log.ARTLogger;
import java.util.Locale;
public class MyAdapter extends WmAdapter
{
public static final String ADAPTER_NAME = MyAdapter.class.getName();
private static final int ADAPTER_MAJOR_CODE = 9001;
private static MyAdapter _instance = null;
private static ARTLogger _logger;
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 45
3 The Adapter Definition
}
try
{
_instance = new MyAdapter();
return _instance;
}
catch (Throwable t)
{
t.printStackTrace();
return null;
}
}
}
}
The following lookup key produces a description for a parameter named password,
which is used to configure a connection pool:
46 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
3 The Adapter Definition
"password" + ADKGLOBAL.RESOURCEBUNDLEKEY_DESCRIPTION
For more examples, see “Example Resource Bundle Implementation Class” on page 53.
The adapter automatically references lookup keys to provide text for the following
elements of your adapter:
The display names, property descriptions, and online help links of the:
Adapter definition
Connection types
Adapter service templates
Polling notification templates
Parameters used to configure nodes
Metadata group names
Log entries
Exception text
Note: You may also make explicit use of a resource bundle to localize other data, such as
resource domain values, especially if those values are known at development time (for
example, a list of known record status values). In these cases, the strategy for key
composition is left to your discretion. For more information, see “Using Resource
Bundles with Resource Domain Values” on page 210. Resource domain values are
discussed in detail in “Resource Domains” on page 89.
For more information about resource bundle naming conventions, see the Javadoc for
java.util.ResourceBundle.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 47
3 The Adapter Definition
Note: You specify the adapter’s default resource bundle in your WmAdapter
implementation class (see “Describing the Adapter to Integration Server” on
page 42). For each resource bundle lookup, the adapter uses the default resource
bundle if a bundle specific to the target locale is not available.
2 In your subclass, create resource bundle lookup keys using the formats shown in
“Resource Bundle Lookup Keys” on page 48.
3 In your WmAdapter implementation class, return the name of your default resource
bundle using the getAdapterResourceBundleName method. For an example, see
“Example WmAdapter Implementation Class” on page 45.
48 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
3 The Adapter Definition
Adapter
Element Key Format Usage
Adapter adapterName + Required. Displays
definition ADKGLOBAL.RESOURCEBUNDLEKEY_DISPLAYNAME adapter name in
Integration Server
Administrator and in
adapter interface.
adapterName + Required. Displays
ADKGLOBAL.RESOURCEBUNDLEKEY_DESCRIPTION adapter description in
adapter interface's
About window.
adapterName + Required. Displays
ADKGLOBAL.RESOURCEBUNDLEKEY_ABOUT + help hyperlink in
ADKGLOBAL.RESOURCEBUNDLEKEY_HELPURL
adapter interface's
About window.
adapterName + ADKGLOBAL.RESOURCEBUNDLE Displays help
KEY_LISTCONNECTIONTYPES + hyperlink for
ADKGLOBAL.RESOURCEBUNDLEKEY_HELPURL
connection type list in
adapter interface when
configuring new
connection.
adapterName + ADKGLOBAL.RESOURCEBUNDLEKE Displays help
Y_LISTPOLLINGNOTIFICATIONDETAILS+ hyperlink when
ADKGLOBAL.RESOURCEBUNDLEKEY_HELPURL
modifying or viewing a
polling notification's
schedule.
adapterName + ADKGLOBAL.RESOURCEBUNDLE Displays help
KEY_LISTPOLLINGNOTIFICATIONS + hyperlink for list of
ADKGLOBAL.RESOURCEBUNDLEKEY_HELPURL
polling notifications.
Connection ConnectionFactoryName.class.getName() + Displays connection
type ADKGLOBAL.RESOURCEBUNDLEKEY_DISPLAYNAME type column in adapter
interface.
ConnectionFactoryName.class.getName() + Displays description
ADKGLOBAL.RESOURCEBUNDLEKEY_DESCRIPTION column in connection
type listing when
configuring
connections.
ConnectionFactoryName.class.getName() + Displays help
ADKGLOBAL.RESOURCEBUNDLEKEY_HELPURL hyperlink when
editing connection
properties.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 49
3 The Adapter Definition
Adapter
Element Key Format Usage
Adapter AdapterServiceName.class.getName() + Displays adapter
service ADKGLOBAL.RESOURCEBUNDLEKEY_DISPLAYNAME service template name
template when selecting a
template to create an
adapter service in
Designer or Developer.
AdapterServiceName.class.getName() + Displays adapter
ADKGLOBAL.RESOURCEBUNDLEKEY_ DESCRIPTION service template
description when
selecting a template to
create an adapter
service in Designer or
Developer.
AdapterServiceName.class.getName() + Displays help
ADKGLOBAL.RESOURCEBUNDLEKEY_ HELPURL hyperlink when
editing adapter service
properties (focus must
be in Properties
window).
Polling AdapterNotificationName.class.getName() + Displays template
notification ADKGLOBAL.RESOURCEBUNDLEKEY_DISPLAYNAME name column when
template selecting a template to
create polling
notification in Designer
or Developer.
AdapterNotificationName.class.getName() + Displays template
ADKGLOBAL.RESOURCEBUNDLEKEY_ DESCRIPTION description column
when selecting a
template to create
polling notification in
Designer or Developer.
AdapterNotificationName.class.getName() + Displays help
ADKGLOBAL.RESOURCEBUNDLEKEY_ HELPURL hyperlink when
editing polling
notification properties
(focus must be in
Properties window).
50 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
3 The Adapter Definition
Adapter
Element Key Format Usage
Parameters parameterName + Displays property
used to ADKGLOBAL.RESOURCEBUNDLEKEY_DISPLAYNAME display name when
configure editing connection,
nodes adapter service, and
polling notification
properties in adapter
interface and Designer
or Developer.
parameterName + Displays tool tip when
ADKGLOBAL.RESOURCEBUNDLEKEY_DESCRIPTION mouse is over
parameter name when
editing service and
polling notification
properties in Designer
or Developer.
Metadata groupName + Displays property
group ADKGLOBAL.RESOURCEBUNDLEKEY_DISPLAYNAME display name when
names editing parameter
group for polling
notification in Designer
or Developer.
groupName + Overrides Designer or
ADKGLOBAL.RESOURCEBUNDLEKEY_GROUPURL Developer help
hyperlink on each tab
associated with group.
Log entries new Integer(minorCode).toString() Text in all log
repositories (server
locale)
Exception new Integer(minorCode).toString() Text in all log
text repositories (server
locale)
* See “Considerations for Adapter Definition Lookup Keys” on page 52 and
“Considerations for Specifying URLs in Resource Bundles” on page 52.
Note: By default, if you omit a DISPLAYNAME lookup key in your resource bundle, the
parameter or class name is used as the display name. Other omitted lookup keys display
nothing.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 51
3 The Adapter Definition
52 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
3 The Adapter Definition
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 53
3 The Adapter Definition
54 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
3 The Adapter Definition
Note: Make sure that you have modified your classpath as described in “Modifying Your
Classpath” on page 37.
<?xml version="1.0"?>
<project default="classes">
<property name="debug" value="on"/>
<property name="optimize" value="off"/>
<property name="deprecation" value="off"/>
<property name="server.home" value="../.."/>
<property="package" value = "MyAdapter" /> <!--needed for jcode -->
<!-- classes belonging to this package -->
<path id="this.package.classpath">
<fileset dir=".">
<include name="code/classes"/>
</fileset>
</path>
<!-- All classes that need to be found by this script -->
<path id="total.classpath">
<pathelement
location="${server.home}/packages/WmART/code/jars/wmart.jar"/>
<pathelement location="${server.home}/lib/server.jar"/>
<pathelement location="${server.home}/lib/client.jar"/>
<path refid="this.package.classpath"/>
</path>
<!-- Compile the java files of this package -->
<target name="classes" depends="init">
<mkdir dir="code/classes"/>
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 55
3 The Adapter Definition
To debug an adapter
1 To use a debugger with your adapter, you must first shut down your Integration
Server and start it using a custom start script.
2 Make a copy of your server.bat (or server.sh in a UNIX environment).
3 To edit your file copy to enable debugging, go to the line near the bottom of the file
where the server is actually started. It should look similar to this:
1. rem run Integration Server
2. title webMethods Integration Server
3. %JAVA_RUN% -DWM_HOME="%WM_HOME%" -classpath %CLASSPATH%
%IS_PROXY_MAIN% "%IS_DIR%"\bin\ini.cnf %PREPENDCLASSES_SWITCH%
%PREPENDCLASSES% %APPENDCLASSES_SWITCH% %APPENDCLASSES%
%ENV_CLASSPATH_SWITCH% %ENV_CLASSPATH% %1 %2 %3 %4 %5 %6 %7 %8 %9
56 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
3 The Adapter Definition
4 Modify the file so that the debug settings are inserted immediately after the classpath,
as follows:
1. set JDPA_ARGS=-Xdebug -Xnoagent -Djava.compiler=NONE
2. set JDWP_ARGS=
-Xrunjdwp:transport=dt_socket,server=y,address=9999,suspend=n
3.
4. rem run integration server
5. title webMethods Integration Server
6. %JAVA_RUN% -DWM_HOME="%WM_HOME%" -classpath
%CLASSPATH% %JDPA_ARGS%
%JDWP_ARGS% %IS_PROXY_MAIN% "%IS_DIR%"\bin\ini.cnf
%PREPENDCLASSES_SWITCH% %PREPENDCLASSES% %APPENDCLASSES_SWITCH%
%APPENDCLASSES% %ENV_CLASSPATH_SWITCH% %ENV_CLASSPATH% %1 %2 %3 %4
%5 %6 %7 %8 %9
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 57
3 The Adapter Definition
Adapter users explicitly load and unload an adapter by enabling and disabling the
adapter package, using Integration Server Administrator, as described in “Design-Time
Tasks” on page 175. This figure shows how My Adapter loads the adapter into
Integration Server at run time.
The loading process is described as follows:
1 The system calls MyAdapterAdmin.registerAdapter.
This method is the designated package startup service; see “Creating Adapter Startup
and Shutdown Services” on page 54.
2 The implementation of registerAdapter instantiates the MyAdapter class by calling
its getInstance method. It then registers the MyAdapter object as an adapter by
passing it to the registerAdapter method of the AdapterAdmin class provided by the
ADK.
3 During the construction of the MyAdapter instance, super() calls the base class
(WmAdapter) constructor, which instantiates the default resource bundle, calls
MyAdapter.initialize, and retrieves basic information about the adapter. (The
WmAdapter constructor only instantiates the default resource bundle; it instantiates
and reads other resource bundles if a request is received using the locale of that
supplementary resource bundle.)
58 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
3 The Adapter Definition
4 The adapter load process is completed with a call to the static method
AdapterAdmin.registerAdapter, which reads and evaluates the adapter's default
resource bundle, and updates the Integration Server list of registered adapters. If the
resource bundle does not provide the required resource bundle elements, the
registration process fails, with an error log entry explaining the failure.
5 Upon completion of the adapter's registration, the adapter loads any dependant node
packages. See the chapters about connections, adapter services, polling notifications,
and listener notifications for descriptions of their respective load processes.
6 If the load was successful, the adapter name (as specified in the resource bundle)
appears in the list of adapters in Integration Server Administrator. If it does not
appear, refresh your browser page. If it still does not appear, check the log for errors.
For information about debugging, see “Compiling the Adapter” on page 55.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 59
3 The Adapter Definition
60 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
4 Connections
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Connection Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Adapter Connection Implementation Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Creating a WmManagedConnection Implementation Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Creating a WmManagedConnectionFactory Implementation Class . . . . . . . . . . . . . . . . . . . . . . 70
Updating the Resource Bundle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Updating AdapterTypeInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Connection Class Interactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Configuring and Testing Connection Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 61
4 Connections
Overview
An adapter connection connects an adapter to an adapter resource. This chapter
describes the classes provided by the ADK to support connections, and how adapters
support them.
Connection Factories
The ADK's adapter connection model uses a factory method pattern in which a
connection factory object is responsible for creating connection objects. In many cases,
both the factory and its connections will wrap comparable functionality provided in the
resource's libraries. For example, an adapter connection factory may wrap a data source
class provided by a database vendor, from which it creates database connections and
wraps them in an adapter connection object produced by the factory.
Each connection factory in an adapter implementation constitutes a connection type on the
adapter's administrative interface. You can define one or more connection types for an
adapter. If you need a different set of configuration parameters, create another
connection type. For example, if you have a kind of request that requires special security
requirements, create a separate connection type for it.
A connection factory is also responsible for defining implementation-specific parameters
and for making them available to the connection. The adapter uses these parameters at
design time, when adapter users create connection namespace nodes. For example, note
the following connection type configuration window of the Sample Adapter.
62 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
4 Connections
Connection Management
The server includes a connection management service that dynamically manages
connections and connection pools based on the settings stored in the connection
namespace node (such as the connection pooling and timeout fields in “Connection
Management Properties” on page 63).
When a connection namespace node is enabled, the server uses the connection factory to
initialize the pool, creating a number of connection instances equal to the minimum
configured pool size. Whenever a connection is needed by an adapter service or
notification, the ADK provides a connection from the pool. If no connections are available
in the pool, and the maximum pool size has not been reached, a new connection is
retrieved from the connection factory. If the pool is full, the requesting thread will block
the amount indicated in the Block Timeout field until a connection becomes available. For
information about configuring your connection pool, see “Configuring and Testing
Connection Nodes” on page 80.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 63
4 Connections
64 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
4 Connections
Connection Classes
ADK adapter connection classes
The ADK's base connection classes are dependent on the following external interfaces.
These interfaces are used as arguments of the abstract methods that you must override in
the connection implementation classes:
Interface Description
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 65
4 Connections
Interface Description
66 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
4 Connections
The diagram above shows how a typical adapter implements the connection classes.
At design time, each connection factory in an adapter implementation constitutes a
connection type on the adapter's administrative interface. For a connection factory to be
recognized as part of the adapter, you must specify the class in the fillAdapterTypeInfo
method in the adapter's WmAdapter implementation class (see “Updating
AdapterTypeInfo” on page 76).
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 67
4 Connections
To learn how the server uses connection classes at design time to support the creation and
management of connection namespace nodes, see “Connection Class Interactions” on
page 76.
Note: The connection implementation classes will often use both the AdapterException
class and the AdapterConnectionException class. The main difference between these
classes is the impact on the connection pool (see “Receiving
AdapterConnectionExceptions” on page 80).
Method Description
68 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
4 Connections
Note: The methods that support metadata for services and notifications are described in
“Adapter Services” on page 83, and “Polling Notifications” on page 127.
package com.mycompany.adapter.myadapter.connections;
import com.wm.adk.connection.WmManagedConnection;
import com.wm.adk.metadata.*;
import com.mycompany.adapter.myadapter.MyAdapter;
public class SimpleConnection extends WmManagedConnection
{
String _parm1;
int _parm2;
public SimpleConnection(String configParm1, int configParm2)
{
super();
_parm1 = configParm1;
_parm2 = configParm2;
MyAdapter.getLogger().logDebug(9999,
"Simple Connection created with parm1 = "
+ _parm1 + "and parm2 = " +
Integer.toString(_parm2));
}
public void destroyConnection()
{
MyAdapter.getLogger().logDebug(9999,"Simple Connection
Destroyed");
}
// The remaining methods support metadata for related services, etc.
// Implement content as needed.
public void registerResourceDomain(WmAdapterAccess access)
{
}
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 69
4 Connections
Method Description
70 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
4 Connections
Connection Callbacks
The WmManagedConnectionFactory base class defines a set of callback methods that you
can override in any connection factory implementation class. These callbacks are called
during state changes on the connection node.
The following table describes which methods are called on an enabled connection for
certain operations.
The following table describes which methods are called on a disabled connection for
certain operations.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 71
4 Connections
Note: If more then one callback is listed, they occur in the specified order from top to
bottom. If an action is not listed in the table then no callback will occur.
For more information, refer to the Javadoc for the WmManagedConnectionFactory class.
The complete naming convention rules follow the Java bean property naming
conventions. For more information, see
http://www.oracle.com/technetwork/java/javase/documentation/spec-136004.html
72 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
4 Connections
Note: All namespace nodes store parameter settings based on the parameter name. If you
delete or change the name of your accessor methods, the parameter names stored in the
namespace nodes associated with that class will no longer be valid. From that point
forward, any use of that node (at design time or at run time) will fail. If you no longer
need a metadata parameter after upgrading a deployed adapter, hide the parameter
(using WmDescriptor.setHidden) instead of deleting it.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 73
4 Connections
To create webMethods metadata for your connection factory, you use the WmDescriptor
interface within the WmManagedConnectionFactory.fillWmDescriptor method.
Following are some commonly used WmDescriptor methods. For examples, see
“Example WmManagedConnectionFactory Implementation Class” on page 74.
Most WmDescriptor methods apply to a specified metadata parameter. In these cases, the
name of the parameter must be passed as a String.
74 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
4 Connections
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 75
4 Connections
Updating AdapterTypeInfo
The final step for creating a connection is to link the connection type to the adapter by
updating your fillAdapterTypeInfo method in your WmAdapter implementation class.
For example, MyAdapter accomplishes this as follows:
import com.mycompany.adapter.myadapter.connections.*;
.
.
.
public void fillAdapterTypeInfo(AdapterTypeInfo info, Locale locale)
{
info.addConnectionFactory(SimpleConnectionFactory.class.getName());
info.addNotificationType(SimpleNotification.class.getName());
}
76 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
4 Connections
basic flow used whenever connections are created or destroyed. The specifics of how
these activities pertain to the interactions of adapter services and notifications are
described later in this document.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 77
4 Connections
78 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
4 Connections
Creating Connections
The connection manager requests new connections from an adapter's connection factory
when the node is enabled, and whenever there is demand for a connection and the
pooling limits defined by the connection node have not been exceeded. If pooling for the
node is disabled, the manager creates a connection for each request, and destroys it when
the request is completed. The process of creating a connection is shown in steps 5-7 in the
previous figure.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 79
4 Connections
Note: A listener instance holds the connection it retrieves during listener initialization for
the lifetime of the listener instance. Disabling the connection node will not impact this
connection already held by the listener, but it will prevent the listener from starting or
restarting in the event of an AdapterConnectionException. For more information, see
“Listener and Listener Notification Interactions” on page 158.
Releasing Connections
When a connection is not in use and is not needed to maintain a connection pool, the
connection manager calls the connection implementation's destroyConnect method and
removes all references to the object, allowing it to be garbage collected.
Releasing a connection
Receiving AdapterConnectionExceptions
When the server receives an AdapterConnectionException thrown from an adapter, the
server re-sets the connection node associated with the exception. This means that the
connections in the pool are destroyed and not recreated until the next connection request.
80 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
4 Connections
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 81
4 Connections
82 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Adapter Service Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
The Metadata Model for Adapter Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Adapter Service Template Interactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Adapter Service Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Configuring and Testing Adapter Service Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 83
5 Adapter Services
Overview
An adapter service defines an operation that the adapter will perform on an adapter
resource. Adapter services operate like webMethods Integration Server flow services or
Java services. Adapter services have input and output signatures, you call them within
flow services, and you can audit them from the Integration Server's audit system.
Like a connection, an adapter service consists of a Java class component and a namespace
node in which design time settings are stored in metadata parameters. Adapter services
support the same basic metadata constructs supported by connections, as well as:
Additional data types.
More sophisticated widgets.
The ability to define the signature of the adapter service node.
This means that adapter users can specify what data to search for in the flow service
pipeline when the adapter service is called, and what data to place in the pipeline
during execution of the service. Using these signatures, you can link adapter services
to other Integration Server elements as part of a total integration solution.
Software AG Designer or webMethods Developer provides facilities for adapter users to
create, configure, and test adapter service nodes.
84 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 85
5 Adapter Services
Method Description
86 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
Important! Do not call the base class version of the method (by calling super()).
Note: The Adapter Service Editor does not support the automated password
confirmation facilities described for connections.
setDescriptions
Searches the resource bundle for display names, descriptions, help URLs for the
service, metadata parameters, and any groups that have been created at the point
setDescriptions is called. Since you normally want group display fields to be loaded
from the resource bundle, you typically call setDescriptions at the end of the
fillWmTemplateDescriptor implementation.
setHidden
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 87
5 Adapter Services
Note: Some of these methods have implicit order requirements because the methods build
on activities performed in previous method calls (see “The WmTemplateDescriptor
Methods” on page 88).
By default, the Adapter Service Editor displays each metadata parameter in its own
widget, based on the parameter's data type. These widgets include:
88 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
This method is another "grouping" mechanism that you can use to modify the
behavior of a resource domain lookup, and how resource domain values are applied
in a field map. For more information, see “Tuples” on page 99.
setMultiline
Changes the widget from a standard text box to a multi-line text box. This widget also
supports text import from files. The resulting parameter value may include
embedded returns.
setResourceDomain
Associates a metadata parameter of an adapter service with a resource domain
supported by the service's connection. For more information, see “Resource
Domains” on page 89 and “Associating Metadata Parameters with Resource
Domains” on page 92.
Some of these methods have implicit order requirements because they build on activities
performed in previous methods calls. For example, call setDescriptions after the final call
to createGroup so that the resource bundle lookups can include all groups defined in the
service. Use the calls in the following order:
1 createGroup
2 createFieldMap
3 createTuple
4 setResourceDomain
5 setDescriptions
Note: If you create tuples, make setResourceDomain calls for tuple parameters in the
order in which the parameters are set in the tuple.
Resource Domains
A resource domain defines the domain of valid values for metadata parameters, based on
rules and/or data that are specific to the adapter resource. Resource domains can have
properties that affect the behavior of the resource domain, and associations with
metadata parameters.
You can use resource domain values to:
Assign default values for parameters.
Enable the adapter to look up parameter values in the adapter resource.
Enable adapter users to supply their own parameter values, and enable the adapter to
validate these values.
Disable parameters, based on specified sets of values in other parameters.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 89
5 Adapter Services
A common use of resource domain values is to create a drop-down list of data values for
a parameter, much like the WmDescriptor.setValidValues method in connection factories.
However, resource domain values differ from the setValidValues lists in two important
ways:
Resource domain values can interact with the Adapter Service Editor.
As values in one parameter change, callbacks are made to the adapter to update
resource domain values. For example, if parameter A contains a list of database table
names, and parameter B contains a list of column names, then when a table is selected
in parameter A, the resource domain values used in parameter B can be updated to
reflect the columns from the table selected in parameter A.
Resource domain values can be retrieved directly from the adapter resource, using a
WmManagedConnection instance.
To create a resource domain, you perform the following tasks:
1 Register the resource domain and its properties in your WmManagedConnection
implementation (see “Registering Resource Domains” on page 90).
2 Associate the adapter's metadata parameters with the resource domain (see
“Associating Metadata Parameters with Resource Domains” on page 92).
3 Populate the resource domain with values in your WmManagedConnection
implementation (see “Populating Resource Domains with Values” on page 93).
90 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 91
5 Adapter Services
where:
92 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
Argument Description
Parameter Dependencies
Dependencies are important to dynamic resource domain lookups. When an adapter user
changes the value of a parameter in the dependency list, a lookup retrieves a new set of
resource domain values.
For example, for the parameters named columns and tables, you might assign the
columns parameter to a resource domain called columnsLookup, with a dependency on
the tables parameter as follows:
d.setResourceDomain("columns", "columnsLookup", new String[] {"tables"});
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 93
5 Adapter Services
This list can contain an array of either strings or ResourceDomainValue objects. This
array constitutes the list of values that appears in the appropriate widgets in the
Adapter Service Editor. The displayed values are communicated as strings, regardless
of the data type of the parameter associated with the resource domain.
Note: Using a values list that cannot be converted to the parameter's data type results
in a run-time error. Null and empty strings are not accepted in numeric parameters.
Methods that:
Allow adapter users to supply values (set the setComplete method to false).
When using both fixed resource domains and dynamic resource domains, you
may allow adapter users to enter their own values, allowing them to add to the
current list of values for the resource domain. For more information, see
“Registering Resource Domains” on page 90
Enable the adapter check values to validate the adapter user-supplied values (set
the setCanValidate method to true).
As mentioned previously, to validate adapter user-supplied values you use
callbacks known as adapter check values. The values are validated by the
adapterCheckValue method. For more information, see “Adapter Check Value
Callbacks” on page 96.
Disable parameters in the Adapter Service Editor, by setting the setDisabled
method to true.
For example, assume that a parameter named portNumber has a data type of int. When
constructing the associated resource domain values, limit the values list to numeric
strings as follows:
new ResourceDomainValues("portNumberLookup", new String[]
{"6048","8088","9090"});
The example above shows a ResourceDomainValues object with a set list. You have the
option to define a range of values, by providing a minimum/maximum value. In this case,
a single ResourceDomainValues object is used to define the minimum and maximum
values of a numeric parameter. The conditions for doing this are as follows:
The parameter must be of a numeric data type (such as int or long).
The parameter cannot be a sequence parameter (array).
The ResourceDomainValues object must contain exactly one value that is constructed
from a ResourceDomainValue object.
ResourceDomainValues.setComplete must be false. You must set this method
explicitly if you used the ResourceDomainValue[] constructor; otherwise, changes to
the parameter will not be saved.
The embedded ResourceDomainValue object must have a name representing a
numeric value, and an endName representing a number value greater that the value
of the name.
94 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
Note: This is the only defined use for ResourceDomainValue.endName. In all other
cases, only ResourceDomainValue.name is used. All other ResourceDomainValue
attributes are placeholders, and are not currently implemented. Using a String[] to
construct ResourceDomainValues is equivalent to using a ResourceDomainValue[]
where only the ResourceDomainValue.name attributes are populated.
where:
Argument Description
This call creates a dependency on tablesArg (see “Associating Metadata Parameters with
Resource Domains” on page 92). When the lookup for the columnsLookup resource
domain is made, the values argument will contain the current settings for the tablesArg
parameter. Data in the values argument is organized such that the first dimension of the
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 95
5 Adapter Services
array determines the dependent parameter, and the second dimension iterates the data in
the parameter. Thus, values[0][0] contains the value of the first dependent parameter. If it
is a sequence parameter, then values[0][1] would contain the next value in the sequence,
values[0][2] the next, and so on. If there were more than one dependency, the contents of
the second parameter on which the lookup depends would be contained in values[1][].
Note: Placing a sequence parameter in a field map has several effects on the resource
domain lookup process (see“Tuples” on page 99).
96 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
lookup, the resource domain list contains "Black" and "Gray". Assuming that the resource
domain is configured appropriately, the Adapter Service Editor performs an adapter
check value callback for "Red" and "White". If it finds either value, it deletes the cell
containing that value (or overwrites it, if the sequence is in a field map).
To use an adapter check value callback, you must:
Set the following methods of the ResourceDomainValues class as follows:
setComplete(false), which indicates that adapter users can enter their own
parameter values; it sets a flag named complete
setCanValidate(true), which indicates that the adapterCheckValue method will
validate user-supplied parameter values; it sets the canValidate flag
If both of these flags are set properly, the Adapter Service Editor calls the following
method for each value that is not already in the resource domain:
Boolean adapterCheckValue(String serviceName,
String resourceDomainName,
String[][] values,
String testValue)
Field Maps
As mentioned in “The WmDescriptor Interface” on page 73, you can use the createGroup
method to organize parameters into different tabs, and to specify the order in which they
appear. Similarly, you can use the createFieldMap method to organize various sequence
parameters (within the same group) into a single table widget in the Adapter Service
Editor.
The full signature for createFieldMap is:
void createFieldMap(String[] members,
boolean variable,
boolean fillAll);
where:
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 97
5 Adapter Services
Argument Description
members A list of the parameter names that make up the field map.
A field map may contain one or more member parameters, but a
parameter should not be a member of more than one field map.
The members argument is not an ordered list, and it has no
impact on the order in which columns appear in a field map.
The order of the columns in a field map is dictated entirely by
the order in which the parameters appear in the group. The first
member to appear in the group list will appear in the first
column of the field map, and the remaining columns will follow
in the order in which they appear in the group. If there is more
than one field map in a group, then the relative positions of the
first column parameters in the group will dictate the order in
which the field map tables are displayed. Using parameters
from different groups in a field map results in an exception.
variable The value true permits adapter users to add rows to the table.
In this case, the field map is considered to be a variable field
map because the number of fields that appear in the Adapter
Service Editor may vary.
By default, each time an adapter user adds a row to the field
map, each column is populated based on the associated
parameter's data type and the contents of the associated
resource domain. Typically, the column will contain a drop-
down list of string values from the resource domain. In other
cases, either a check box appears (for Boolean parameters) or the
column is empty.
98 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
Argument Description
fillAll The value true fills the table with all available data.
If the fillAll argument is true and the variable argument is false,
then the table is expanded to contain one row for each value
provided for the parameter in the first column of the field map.
The values for this first column are provided by the associated
resource domain, and cannot be changed or manipulated by the
user. This is true even when the associated resource domain's
setComplete method is false; the adapter user may not directly
update this column. (The adapter user may still make changes to
other parameters that might impact the content of the resource
domain of the first column's parameter; see “Parameter
Dependencies” on page 93.) The remaining columns will contain
the same value and user interface widget that would be
employed if the user manually inserted the row. If fillAll is false,
then rows must be added by the user.
Note: Do not set both fillAll and variable to true; the resulting behavior might be
unpredictable.
Tuples
The WmTemplateDescriptor.createTuple method is another grouping mechanism that
you can use to modify:
The behavior of a resource domain lookup.
How resource domain values are applied to parameters in the tuple.
Members of a tuple are linked when the resource domain values are retrieved, and when
the values are updated on the user interface. When the Adapter Service Editor performs a
resource domain lookup for a parameter in a tuple, it expects the response array to
contain a ResourceDomainValues object for each parameter in the tuple. Thus, changes
resulting from the resource domain lookup will be applied simultaneously to each
parameter in the tuple. This mechanism is particularly useful when two or more
sequence parameters in a field map are closely related, for example when one parameter
contains a column name and the other parameter contains the column format.
Requirements for reliable tuple operation are as follows:
The parameters of a tuple must be sequence parameters of the same field map. If
parameters are in separate field maps, the resource domain lookup will function
properly, but the user interface characteristics described below will not function.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 99
5 Adapter Services
A tuple must be declared (in the code) before a setResourceDomain method (see
“Associating Metadata Parameters with Resource Domains” on page 92).
The first parameter of a tuple must be assigned to a resource domain before any other
member of the tuple (see “Associating Metadata Parameters with Resource Domains”
on page 92).
Each parameter of a tuple must have the same parameter dependencies listed in the
setResourceDomain call that you used to assign the metadata parameters of the
adapter service to a resource domain (as described in “Associating Metadata
Parameters with Resource Domains” on page 92 and “Parameter Dependencies” on
page 93).
For each ResourceDomainValues object returned in the lookup, the setComplete
method must be true (meaning that adapter users cannot supply parameter values;
see “Populating Resource Domains with Values” on page 93).
The first parameter in the tuple must appear first in its group.
In the user interface, the first parameter in a tuple serves as the "master" parameter, and
all other parameters are "slave" parameters. In the Adapter Service Editor, the adapter
user may directly manipulate the master parameter, but not slave parameters. A slave
parameter contains the value from its resource domain that corresponds to the value
selected from the master parameter. For example, if the fourth member of the master
parameter's resource domain is selected, then the fourth member of the slave parameter's
resource domain will appear in the slave parameter's column. If a slave parameter does
not have a value in the position corresponding to the master parameter's value, then the
slave parameter is left blank in that row.
100 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
catalog item numbers, for example, and parameter B contains the colors in which the item
is available, then for each catalog item number in A, there would be a separate drop-
down list of available colors in column B. Also note that if the same catalog item number
appeared in multiple rows in column A, then the drop-down list of colors in column "B"
would be the same. There would not be a separate resource domain lookup for each of
those rows because the adapter service editor would recognize that it already has the list
of colors for that item number. Or, more accurately, that it already has a list of resource
domain values based on the given set of dependency parameter values.
If you want to suppress the behavior described above, prefix the name of the parameter
in the setResourceDomain dependency list with an asterisk (*). For example, the
following method causes the server to treat parameter A like any other parameter, even if
it were in a field map with B:
setResourceDomain("B", "bLookup", new String[] {"*A"})
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 101
5 Adapter Services
3 You may hide any or all of the parameters. (Hiding all parameters in a field map will
hide the map table as well.)
For example:
templateDescriptor.setHidden("inputNames");
templateDescriptor.setHidden("inputTypes");
templateDescriptor.setHidden("inputSignature");
4 Create a field map containing the three input parameters. In the createFieldMap
method, set the variable argument to false, and set the fillAll argument to true.
For example:
templateDescriptor.creatFieldMap(new String [] {"inputNames",
"inputTypes", "inputSignature"}, false, true);
In some cases, you can include other parameters in this field map, but this can
sometimes be problematic, particularly if these parameters are hidden.
5 Create a tuple containing the names and types parameters.
For example:
templateDescriptor.creatTuple(new String [] {"inputNames",
"inputTypes"});
6 In the associated connection class(es), register two resource domains to support name
and type lookups.
For example, assume that the resource domains "inputNamesLookup" and
"inputTypesLookup" are created as follows.
access.addResourceDomainLookup("inputNamesLookup", this);
access.addResourceDomainLookup("inputTypesLookup", this);
7 Assign the names parameter to the name lookup resource domain, and assign the
types parameter to the type lookup resource domain. These assignments must specify
the same dependencies because the parameters are in a tuple. If no dependencies are
known at this time, specify null.
For example:
templateDescriptor.setResourceDomain("inputNames","inputNamesLookup",null);
templateDescriptor.setResourceDomain("inputTypes","inputTypesLookup",null);
8 Assign the signature parameter to one of the reserved resource domain names
provided in WmTemplateDescriptor, specifying the names parameter and the types
parameter as dependencies.
For example, "INPUT_FIELD_NAMES" would be used as follows:
102 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
templateDescriptor.setResourcDomain( "inputSignature",
WmTemplateDescriptor.INPUT_FIELD_NAMES, new String[]
{"inputNames", "inputTypes"}););
Implementing Resource Domain Lookups for Signature Names and Data Types
As mentioned in “Adapter Service Node Signatures” on page 101, typically you load a
signature's name and data type parameters using resource domain lookups. You
implement lookups by including an adapterResourceDomainLookup method in your
WmManagedConnection implementation class.
These parameters are implemented as string arrays, with the corresponding index in each
array used to associate a name with a data type. The following subsections describe the
values you supply in your resource domains for the name and data type parameters.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 103
5 Adapter Services
See “About this Guide” for specific document titles.) That is, if the signature item is to be
accessible from an Integration Server flow, its data type should be "java.lang.String",
"java.util.Date", or one of the "big-letter-primitive" classes (e.g., java.lang.Integer). If the
data need not be accessible from a flow, then any class type is acceptable.
Multiplicity in the data type string uses a pair of square brackets [] appended to the class
name. Data type multiplicity represents the multiplicity across the entire signature
hierarchy by adding a set of brackets for each set of brackets in the corresponding name
string.
Even though there is only one item number in the lineItems aggregate, there are many in
the signature. In this case, the data type would be "java.lang.Integer[][]" (assuming
itemNumber is an integer).
For examples, see “Code Example 1: WmAdapterService Implementation Class” on
page 118. For more information, see “Interacting with the Pipeline” on page 104.
104 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
To retrieve data from the pipeline, the service should interrogate the WmRecord
argument of the execute method. Limit the interrogation to fields identified in the
service's signature because often there is other information in the pipeline that is not
intended for the service.
At the end of execution, the execute method should return a WmRecord instance
containing data that should be added to the pipeline. Organize the return data in a way
that is consistent with the metadata signature so that other adapter services (or flow or
Java services) can access it.
For discussion purposes, assume the following as a sample metadata signature for both
input and output of an adapter service:
customer.id java.lang.Integer
customer.name java.lang.String
customer.orders[].id java.lang.Integer[]
customer.orders[].date java.util.Date[]
customer.orders[].lineItems[].itemNumber java.lang.Integer[][]
customer.orders[].lineItems[].quantity java.lang.Integer[][]
customer.orders[].lineItems[].description java.lang.String [][]
The sample signature describes a hierarchal structure that can be expressed as a tree
structure, where the actual field names form the leaves, and the elements preceding the
field name are nodes. Thus, the names customer, orders, and lineItems are node names,
and id, name, date, itemNumber, quantity, and description are leaves in the tree
structure.
The WmRecord class, which is the primary carrier of data into and out of adapter
services, is a JCA-based wrapper for an IData object. It provides methods that access the
IData content. However, when dealing with a hierarchal structure (as is the case with the
sample), it is necessary to "drill down" into the IData structure. Therefore, ignore the
WmRecord methods except for getIData, and putIData (which is used to access the
underlying IData object).
Note: The IData interface is part of the standard webMethods Integration Server Java API.
Its structure is based on key/value pairs, where the key is a String and the value is a Java
object. For more information, see the Javadoc entries for IData, IDataCursor,
IDataFactory, and IDataUtil, located in the Integration Server_directory\doc\api\Java
directory.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 105
5 Adapter Services
service. The value associated with that key will be either another IData object (if the key is
a node name) or an object of the type specified by the corresponding type field of the
signature. If the name of the branch or leaf includes a pair of square braces "[]", then the
value will contain an array of the designated object type.
Thus, the fields in the sample would be populated as follows:
WmRecord.getIData would return an IData object with an entry, keyed with the name
customer.
The value associated with customer would be another IData object, this time with
three entries: id, name, and orders.
The value corresponding with id would be an Integer.
The value of name would be a String.
The value of orders would contain an array of IData objects.
The orders IData objects would each contain an Integer id, a java.util.Date date, and
an array of IData objects associated with the lineItems key.
The lineItems IData objects would contain entries for itemNumber, quantity, and
description, with the data types provided in the signature.
When constructing response data to place in the pipeline at the end of service execution,
use the same rules that apply to interpreting the metadata signature. For each node level
in the signature, there should be a corresponding layer of IData, keyed with the names
from the signature. For each leaf, there should be an IData entry with the corresponding
signature name and type.
Note: Signatures are not enforced by Integration Server or the ADK framework. The
validity of a request based on the presence or absence of a given field, or the value given
to a field, is determined exclusively by the adapter implementation. Similarly, if the
service fails to populate the response WmRecord with data organized according to the
signature, subsequent services will be unable to access the data provided by the adapter
service.
106 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
Note: The cache is not cleared when you recompile the code or reload the package, so it is
critical that you refresh the cache manually when loading updated metadata code. (To
refresh the cache, use the Refresh button on the Developer toolbar or select Refresh from
the Session menu.)
The following diagram shows the adapter calls made when adapter users select a
connection node.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 107
5 Adapter Services
Before displaying the Adapter Service Editor screens, the following occurs:
The server invokes the connection's adapterResourceDomainLookup method for each
lookup registered with the service.
The values argument in these lookups will reflect the dependent parameters' default
values that are cached when the adapter user selects a connection node. If your
default value for a dependent parameter is null, make sure your resource domain
lookup code can handle a null value in the values argument.
After the lookups are complete, the server instantiates the adapter service template
class (again), and each of the accessor methods are called.
Values passed to "set" methods come either from the parameter default, or from the
result of a resource domain lookup. These accessor method calls merely validate their
operation; the service class instance is not cached. This is the last interaction with the
metadata parameter accessor methods during the process of creating an adapter
service node. The "set" methods are not called with the final node settings until the
service is executed.
The following figure describes this interaction.
108 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 109
5 Adapter Services
110 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 111
5 Adapter Services
The following table describes the purpose of each of these "data entry" parameters:
Parameter Description
Specifying the Display and Data Entry Attributes of the "Data Entry"
Parameters
After you create the parameters, you specify their display and data entry attributes by
calling various methods of the WmTemplateDescriptor interface from the service's
fillWmTemplateDescriptor method. The example code places each data entry parameter
into a single group (in display order) referenced by the constant UPD_SETTINGS_GRP.
(A constant is used to name the group (instead of a string) because the same value is used
in the resource bundle to specify a localizable group name and help URL; see lines 8-11 of
“Code Example 3: Resource Bundle Updates” on page 124.)
Placing the Column Names and Column Data Types Parameters in a Field Map
Next, the example places columnNames and the two types parameters in a fieldMap
(lines 73-75). The use of two data type columns in the fieldMap warrants further
discussion. The desired behavior is to automatically update the data type when the
column name changes, but to also allow the adapter user to enter an alternative data type
for the given field and to (presumably) have the adapter convert the data at run time. In
order to have the type value change with the columnName, the resource domain
associated with the parameter must be "complete" (as specified by the setComplete
method being set to true; see “Registering Resource Domains” on page 90). Users are not
allowed to type values into fields of a "complete" resource domain. Because of these
conflicting constraints, it is necessary to have two parameters with different resource
domain associations: one updated by the Adapter Service Editor, and the other by the
adapter user.
112 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 113
5 Adapter Services
The final resource domain in this section, OverrideTypesRD (associated with the
"overrideTypes" parameter on line 91 of “Code Example 1: WmAdapterService
Implementation Class” on page 118), is used to validate data entered by adapter users
into a Java class that will contain the data at run time. The specifics of the check
implementation (lines 16-32 of “Code Example 2: WmManagedConnection
Implementation Class Updates” on page 122) are probably unrealistic for a real-world
environment, but all the mechanics of doing a check are demonstrated. Remember to set
the setCanValidate method to true in the resource domain (line 115 of “Code Example 2:
WmManagedConnection Implementation Class Updates” on page 122).
114 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
to create constraints on what data is valid for that field at run time. For more information
on these properties, see the Developer user’s guide or Designer Service Development
online help for your release. See “About this Guide” for specific document titles.
In flow services and java services, signature fields and their properties can be modified
by the user. For adapter services, the adapter defines resource domains that act as
callbacks from the developer tool that allow the adapter to specify the name, data type,
and structure of the service's signature while the service is being configured. A separate
callback mechanism allows the adapter to control a limited subset of signature field
constraint properties.
The signature field constraints that are controlled by the adapter include:
Required - If true, the field must be present on the pipeline.
Allow null - If false, when the field is present, it cannot hold a null value.
Allow unspecified fields - Controls whether the document (record) element can hold
fields that are not specifically identified in the signature. (This constraint has no effect
on non-document-type signature elements.)
The controls for these constraints are disabled so the user can view the value, but not
modify it. The remaining properties (that are not related to name and type) are enabled
and may be managed like any other service.
Note: Like other service types, signature constraints are only enforced at run time if the
associated "Validate input" or "Validate output" check box is selected by the user.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 115
5 Adapter Services
Note: This is the only place retrieveConnection should be used; using it from the service's
execute method will cause errors.
116 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 117
5 Adapter Services
Important! The unpackRequest and packResponse methods read class fields, but they
never write to them. This is important because of the multi-threaded nature of adapter
service execution. At run time, exactly one WmAdapterService object corresponds to
each adapter service node defined in the namespace. All invocations of a given adapter
service node call the execute method on the same object. If more than one thread is
executing the service at the same time, then updates to class fields by one thread will
inevitably collide with those of another thread.
118 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 119
5 Adapter Services
120 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
144. {
145. IDataCursor recordCursor = recordIData[rec].getCursor();
146. data[rec] = new Hashtable();
147. for(int c = 0; c < columnNames.length;c++)
148. {
149. if(recordCursor.first(columnNames[c]))
150. {
151. data[rec].put(tableName + "." + columnNames[c],
152. recordCursor.getValue());
153. }
154. }
155. recordCursor.destroy();
156. }
157. }
158. else
159. {
160. throw MyAdapter.getInstance().createAdapterException(9999,
161. new String[] {"No Request Data"});
162. }
163. }
164. catch (Throwable t)
165. {
166. throw MyAdapter.getInstance().createAdapterException(9999,
167. new String[] {"Error unpacking request data"},t);
168. }
169. finally
170. {
171. mainCursor.destroy();
172. }
173. return data;
174. }
175.
176. private WmRecord packResonse(Hashtable[] response) throws
ResourceException
177. {
178. WmRecord data = null;
179. try
180. {
181. IData[] recordIData = new IData[response.length];
182. String tableName = this._tableName;
183. String[] columnNames = this._columnNames;
184.
185. for(int rec = 0; rec < response.length; rec++)
186. {
187. recordIData[rec] = IDataFactory.create();
188. IDataCursor recordCursor = recordIData[rec].getCursor();
189. for(int col = 0; col < columnNames.length;col++)
190. {
191. IDataUtil.put(recordCursor,columnNames[col],
192. response[rec].get(tableName + "." +
columnNames[col]));
193. }
194. recordCursor.destroy();
195. }
196. IData mainIData = IDataFactory.create();
197. IDataCursor mainCursor = mainIData.getCursor();
198. if(this._repeating)
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 121
5 Adapter Services
199. {
200. IDataUtil.put(mainCursor,tableName,recordIData);
201. }
202. else
203. {
204. IDataUtil.put(mainCursor,tableName,recordIData[0]);
205. }
206. mainCursor.destroy();
207. data =
WmRecordFactory.getFactory().createWmRecord("nameNotUsed");
208. data.setIData(mainIData);
209. }
210. catch (Throwable t)
211. {
212. throw MyAdapter.getInstance().createAdapterException(9999,
213. new String[] {"Error packing response data"},t);
214. }
215. return data;
216. }
217. }
122 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 123
5 Adapter Services
88.
89. }
90.
91. }
92. results = new ResourceDomainValues[]{
93. new ResourceDomainValues(MockDbUpdate.FIELD_NAMES_RD,fieldNames),
94. new ResourceDomainValues(MockDbUpdate.FIELD_TYPES_RD,fieldTypes)};
95.
96. }
97.
98. return results;
99. }
100.
101. public void registerResourceDomain(WmAdapterAccess access)
102. throws AdapterException
103. {
104. ResourceDomainValues tableRdvs = new ResourceDomainValues(
105. MockDbUpdate.TABLES_RD,mockTableNames);
106. tableRdvs.setComplete(true);
107. access.addResourceDomain(tableRdvs);
108.
109. access.addResourceDomainLookup(MockDbUpdate.COLUMN_NAMES_RD,this);
110. access.addResourceDomainLookup(MockDbUpdate.COLUMN_TYPES_RD,this);
111.
112. ResourceDomainValues rdvs = new ResourceDomainValues(
113. MockDbUpdate.OVERRIDE_TYPES_RD, new String[] {""});
114. rdvs.setComplete(false);
115. rdvs.setCanValidate(true);
116. access.addResourceDomain(rdvs);
117. access.addCheckValue(MockDbUpdate.OVERRIDE_TYPES_RD,this);
118.
119. access.addResourceDomainLookup(MockDbUpdate.FIELD_NAMES_RD,this);
120. access.addResourceDomainLookup(MockDbUpdate.FIELD_TYPES_RD,this);
121. }
124 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
5 Adapter Services
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 125
5 Adapter Services
126 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
6 Polling Notifications
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Polling Notification Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
The Metadata Model for Polling Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Polling Notification Callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
The runNotification Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Polling Notification Interactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Polling Notification Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Cluster Support for Polling Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 127
6 Polling Notifications
Overview
A polling notification is a facility that enables an adapter to initiate activity on
webMethods Integration Server, based on events that occur in the adapter resource. A
polling notification monitors an adapter resource for changes (such as an insert, update,
or delete operation) so that the appropriate flow or Java services can react to the data,
such as sending an invoice or publishing an invoice to Integration Server.
Adapter users create a polling notification node using Software AG Designer or
webMethods Developer. They assign to the notification an adapter connection node that
they created earlier. At the same time, Designer creates a document type node that
describes the data generated by the polling notification when it executes. The notification
publishes this document and sends it to Integration Server. For more information on
Integration Server publishable documents, see the Integration Server publish-subscribe
developer’s guide for your release. See “About this Guide” for specific document titles.
Important! If you are using Integration Server 8.0 SP1 or earlier, a polling notification
cannot use a connection that is also used for an adapter listener.
To process a document associated with the notification, adapter users can use an
Integration Server trigger. When Integration Server receives a document, the trigger
invokes the flow or Java service registered with the trigger. The service then processes the
data contained in the notification's document.
Finally, adapter users must specify notification scheduling parameters that specify the
interval at which Integration Server should invoke the notification, and then enable the
notification. To accomplish these tasks, they use Integration Server Administrator. For
instructions on creating and using polling notification nodes, see “Polling Notification
Nodes” on page 183.
128 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
6 Polling Notifications
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 129
6 Polling Notifications
Method Description
deleteCallBack Any attempt is made to delete or Error logged, node will not
rename the notification node. be deleted/renamed.
130 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
6 Polling Notifications
disableCallBack The node status is changed to Error logged but node is still
disabled. disabled.
enableCallBack The node status is changed from Error logged, node status
disabled to enabled. remains disabled.
initCallBack The node is created, the package Error logged.
is enabled, and so on.
resumeCallBack The node status is changed from Error logged, node remains
suspended to enabled. suspended.
shutdownCallBack The node is disabled or Error logged.
suspended, the server is
shutdown, the package is
disabled, and so on.
startupCallBack The node is enabled or resumed, Error logged, node is
the server starts, and so on. disabled.
suspendCallBack The node state is changed from Error logged.
enabled to suspended.
updateCallBack The node is modified (not called Error logged, updates are
when node is created). discarded.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 131
6 Polling Notifications
The adapter implementation must guarantee that the value of msgID is unique and
constant for each notification event. (A notification event is defined as any activity on the
adapter resource that will cause your runNotification implementation to call doNotify.)
This means that the msgID will never be duplicated for different notification events, but
the msgID will be the same if the same notification event is retrieved multiple times from
the adapter resource (even in a failure-recovery scenario).
The server guarantees that msgID values generated by different notification nodes are
unique. It accomplishes this by combining the adapter-provided msgID value with a
GUID that is created by the server and associated with the notification node when it is
created.
Note: The length (the number of characters) of the value in msgId should not exceed a
particular limit. To determine this limit, call the
WmAsynchronousNotification.adapterMaxMessageIdLen() method. There is a fixed
number of characters available in Integration Server to hold a notification ID. Of these,
the WmART package reserves a certain number to hold a unique ID that it inserts prior to
dispatching a notification. The remaining characters are available to you when calling
WmAsynchronousNotification.doNotify(WmRecord rec, String msgId). For more
information, see the Javadoc for WmAsynchronousNotifcation.doNotify.
If you do not want to use the Exactly Once feature, use the following form of doNotify:
public void doNotify(WmRecord rec)
132 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
6 Polling Notifications
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 133
6 Polling Notifications
134 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
6 Polling Notifications
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 135
6 Polling Notifications
136 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
6 Polling Notifications
Note: This example implements a design strategy that enables you to encapsulate the
resource domain support inside an adapter service or notification. This strategy is
discussed in “An Alternative Approach to Organizing Resource Domains” on page 206.
You do not need to fully understand this strategy to understand the example code.
However, if you are uncomfortable with this strategy, you may implement those methods
in your connection implementation. You will have to adjust the method signatures and
the "this" references appropriately. The "this" reference refers to the notification. If you
move the methods to the connection, then the "this" refers to the connection.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 137
6 Polling Notifications
Parameter Description
138 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
6 Polling Notifications
Parameter Description
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 139
6 Polling Notifications
140 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
6 Polling Notifications
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 141
6 Polling Notifications
142 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
6 Polling Notifications
109. CHECK_DELETED_PARM,
110. SIG_FIELD_NAMES_PARM,
111. SIG_FIELD_TYPES_PARM,
112. SIG_PARM});
113. descriptor.createFieldMap(new String[]
114. {SIG_FIELD_NAMES_PARM,
115. SIG_FIELD_TYPES_PARM,
116. SIG_PARM},false);
117. descriptor.setHidden(SIG_FIELD_NAMES_PARM);
118. descriptor.setHidden(SIG_FIELD_TYPES_PARM);
119. descriptor.setHidden(SIG_PARM);
120. descriptor.createTuple(
121. new String[]{SIG_FIELD_NAMES_PARM,SIG_FIELD_TYPES_PARM});
122.
123. descriptor.setResourceDomain(DIRECTORY_PARM,DIRECTORIES_RD,null);
124.
125.
descriptor.setResourceDomain(SIG_FIELD_NAMES_PARM,FIELD_NAMES_RD,null);
126.
descriptor.setResourceDomain(SIG_FIELD_TYPES_PARM,FIELD_TYPES_RD,null);
127. descriptor.setResourceDomain(SIG_PARM,
128. WmTemplateDescriptor.OUTPUT_FIELD_NAMES,
129. new String[]{SIG_FIELD_NAMES_PARM,SIG_FIELD_TYPES_PARM});
130. descriptor.setDescriptions(
MyAdapter.getInstance().getAdapterResourceBundleManager(),l);
131. }
132.
133. public Boolean adapterCheckValue(
134. WmManagedConnection connection,
135. String resourceDomainName,
136. String[][] values,
137. String testValue)
138. throws AdapterException
139. {
140.
141. boolean result = true;
142.
143. if(resourceDomainName.equals(DIRECTORIES_RD))
144. {
145. File testDir = new File(testValue);
146. if (!testDir.exists())
147. {
148. result = false;
149. }
150. else if(!testDir.isDirectory())
151. {
152. result = false;
153. }
154. }
155.
156. return new Boolean(result);
157. }
158.
159. public ResourceDomainValues[] adapterResourceDomainLookup(
160. WmManagedConnection connection,
161. String resourceDomainName,
162. String[][] values)
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 143
6 Polling Notifications
144 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
6 Polling Notifications
Callback Coordination
When a callback is coordinated across the cluster, that callback is only executed on one
instance of the polling notification in the cluster. For example, if the enableCallBack is
coordinated, the first polling notification in the cluster to be enabled will execute the
enableCallBack. When subsequent instances of that notification are enabled, the
enableCallBack call is suppressed. If the callbacks were not coordinated, each instance
would execute the enableCallBack when the node instance was enabled.
The purpose of callback coordination is to prevent redundant updates to the backend
associated with starting or stopping a notification. For example, when the
disableCallBack is called on a polling notification for the webMethods JDBC Adapter, a
database trigger that gathers information for the notification is removed. Without
coordination, all instances of that notification would be effectively disabled as soon as the
first instance was disabled. With coordination, the disableCallBack is not executed until
the last instance of that notification in the cluster is disabled.
From a design standpoint, it is important to segregate management of resources on the
backend in separate callbacks from management of resources that are local to the
notification instance. Callback coordination is configured so that related pairs of
callbacks are either coordinated, or not. The following pairs of callbacks may be
coordinated:
Enable/Disable. This occurs when the persistent node state is changed from or to
"disabled". When coordinated, the first instance to go from "disabled" to "enabled"
will execute the enableCallBack and the last instance to go from either "suspended" or
"enabled" to "disabled" executes the disableCallBack.
Startup/Shutdown. This occurs when the node becomes active or inactive for any
reason, including when the node is enabled, disabled, suspended, or resumed (if the
node is enabled, it also includes server and package startup or shutdown). When
coordinated, the first instance to become active will execute the startupCallBack and
the last instance to become inactive executes the shutdownCallBack.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 145
6 Polling Notifications
Polling Coordination
When a polling notification is started, it executes polls on an interval according to its
schedule configuration. When polling is coordinated across a cluster, a poll is executed
on only one of the active instances at each scheduled interval. Which instance executes
depends on configuration and timing.
Integration Server supports a coordination mode configuration setting for each polling
notification node. This configuration is normally set from Integration Server
Administrator on the same page where the schedule is set. The following coordination
mode values are supported:
Coordination Mode
Setting Description
Disabled Disables all cluster coordination for this node (both polling and
callback coordination). Instances of this node will act entirely
independently with no consideration for the cluster.
Standby The first instance of this notification to start will execute all polls
until that instance either shuts down, or fails. When that occurs,
the first active notification instance that detects that the original
instance is no longer polling will take its place.
Distributed Behaves much like standby, except that at the end of each
interval, the instance that first detects that the time to poll has
arrived will execute the poll. When the server clocks are
properly synchronized, generally the server with the lightest
load will execute the poll.
Starting with Integration Server 8.0, the coordination information for clustered polling
notifications is stored in the cluster’s shared cache.
All coordination of clustered polling notifications is done through an entry specific to the
node in the cluster's shared cache. When the first instance of a notification (with
coordination enabled) is introduced into a cluster, a new shared cache session is created
and populated with the name of the server hosting the node, and the state of the node. As
that node is copied to other servers in the cluster, each instance is registered in the same
shared cache session. The states of these respective instances are used to determine when
coordinated callbacks should be executed.
146 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
6 Polling Notifications
Important! Always copy polling notification nodes instead of creating new nodes with the
same name and configuration. Each polling notification node is created with a GUID that
forms part of the message ID of all documents published by the notification. If the
instances do not have the same GUID, it can interfere with duplicate-message detection
facilities.
When the first instance of a clustered polling notification is started, that instance is
marked as "primary", its schedule and coordination settings are recorded, and the time it
calculates for the next poll are all recorded in the shared cache session. Being "primary"
means that first instance will execute the first poll (barring failures). When it schedules
the next poll, it will release the "primary" status if coordination is distributed, or retain it
if coordination is configured for standby mode.
When another instance of the notification starts, it first detects that a previous instance
was already started. Since it is not first, it overwrites its own cluster and schedule settings
with those recorded in the shared cache. It then schedules itself to "wake up" at the next
scheduled poll time. When it wakes up, if another instance is marked as primary, the
notification instance will verify that the indicated instance is still active, then reschedule
itself to wake up periodically until it detects that the poll was completed within the
configured time limit. It then reschedules itself to wake up at the next scheduled poll and
repeats the process. If the polling time arrives and no instance is marked as primary, or it
detects that the primary instance is no longer functioning, then the local instance assumes
the primary role and executes the poll as described above. Since all coordination is based
on timestamps recorded in the shared cache, it is very important for server clocks to be
synchronized.
Configuration Settings
Cluster coordination is controlled by a number of configuration settings to control
behavior and tune failure detection using timeouts.
Global Settings
The following settings are set in the server.cnf file and apply globally to all clustered
notifications for all adapters:
watt.art.clusteredPollingNotification.keepAliveInterval - frequency, in milliseconds, with
which a secondary instance will check to see if an executing instance is still alive. If
not set, the secondary instance will change to the default maxLockDuration value of
"180000" for the shared cache.
watt.art.clusteredPollingNotification.keepAliveExpireTimeout - amount of time, in
milliseconds, that an executing node can be late before it is assumed to have failed. In
general, this setting should be equal to the amount of drift anticipated on the server
clocks. If not set, the secondary instance will change to the default maxLockDuration
value of "180000" for the shared cache.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 147
6 Polling Notifications
Adapter-Specific Settings
Within the configuration directory of the adapter's package, the clusterProperties.cnf
provides settings that specify a callback scheme, and place limits on which coordination
modes can be applied to notification nodes for the adapter. The clusterProperties.cnf file
is an XML file in which settings may be provided globally for the adapter or specifically
to a particular notification template. Template-specific settings use the template class
name to set the scope of the setting.
The following example includes all of the major constructs of a clusterProperties.cnf file:
<?xml version="1.0"?>
<clusterProps>
<pollingNotifications>
<callbackScheme>1</callbackScheme>
<runtimeModeLimit>distribute</runtimeModeLimit>
<template className="com.wm.adapter.wmarttest.notification.LatchedPollingNot
ification">
<callbackScheme>1</callbackScheme>
<runtimeModeLimit>standby</runtimeModeLimit>
</template>
</pollingNotifications>
<listenerNotifications>
<callbackScheme>1</callbackScheme>
</listenerNotifications>
<listeners>
<runtimeModeLimit>standby</runtimeModeLimit>
</listeners>
</clusterProps>
148 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
6 Polling Notifications
runtimeModelLimit
Value Result
disable Nodes created using this template cannot be coordinated across
a cluster. Nodes will be forced to coordination mode "disabled".
standby (default) Nodes can be coordinated in "standby" mode or coordination
may be disabled.
distribute Nodes can be coordinated in "distributed" or "standby" mode, or
coordination may be disabled.
Node-Specific Settings
The polling notification schedule page in Integration Server Administrator includes
cluster-settings that are only editable in a clustered environment. On this page, the
coordination mode may be set to one of the values supported by its template (see
runtimeModeLimit above). In addition, timeouts may be separately configured for
polling and setup (callback) operations.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 149
6 Polling Notifications
150 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
7 Listener Notifications
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Listener Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Asynchronous Listener Notification Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Synchronous Listener Notification Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Listener and Listener Notification Interactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Listener Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Listener Notification Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 151
7 Listener Notifications
Overview
Listeners and listener notifications work together to create a much more powerful model
for detecting and processing events in the adapter resource than is possible with polling
notifications.
When the adapter user enables the polling notification node, the server instantiates and
initializes a polling notification object with settings from the node. The server then
invokes the object (via a call to its runNotification method) on a periodic basis. The
polling notification object must retrieve a connection and use it to determine if
publishable events have occurred in the adapter resource. If an event has occurred, the
polling notification object must generate a WmRecord object conforming to the output
signature of the polling notification node, and publish it by calling the doNotify method.
Then the polling notification object "goes to sleep" until the next time it is invoked. If the
overlap option is enabled in the notification schedule, a second object may be instantiated
while a previous instance is still processing events detected in a previous invocation. The
second instance retrieves another connection, and interrogates the resource again. This
model can make state management significantly more difficult.
With a listener notification, the responsibility for monitoring the adapter resource and
processing any events is divided between a listener and its notification(s). A listener
object is instantiated and is given a connection when the adapter user enables the
associated node. The listener object remains active with the same connection to monitor
the resource activity until it is disabled (either explicitly or by disabling the containing
package, the adapter, the connection, or webMethods Integration Server). When the
listener detects a publishable event in the resource, it passes an object back to the server.
The server will interrogate a configured list of listener notifications associated with the
listener node until it finds a listener notification node that can process the event. To do
this, it calls the listener notification's supports method. The first notification to return true
from this call will be invoked using its runNotification method. This behavior is similar
to a polling notification in that any data about the event that was provided by the listener
is passed as an argument to runNotification.
Important! If you are using Integration Server 8.0 SP1 or earlier, you must use separate
connections for listeners and adapter services as well as listeners and polling
notifications.
152 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
7 Listener Notifications
Listener Classes
You implement a listener class by extending the base class
com.wm.adk.notification.WmConnectedListener, as shown by the SimpleListener class
in the following figure.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 153
7 Listener Notifications
Listener classes
Like other adapter components, the adapter's implementation class must support both
design-time and run-time activities. Metadata parameters for listeners work exactly the
same way as described for connections in “webMethods Metadata Parameters” on
page 72. In addition, the implementation class is required to override the following
methods:
Method Description
fillWmDescriptor Adds any display and data entry constraints to the listener's
metadata parameters. From the standpoint of the adapter
implementation, the model is identical to the connection model.
listenerStartup Initializes the listener. This method is called during the listener
startup sequence as well as during the recovery procedure after
an AdapterConnectionException is encountered.
154 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
7 Listener Notifications
Method Description
waitForData Monitors the adapter resource. This method returns data that is
analyzed by the supports method of associated listener
notifications. For more details, see “Listener and Listener
Notification Interactions” on page 158.
listenerShutdown Cleans up listener resources. This method is called during the
listener shutdown sequence.
In addition, the implementation class may override the following optional methods:
Method Description
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 155
7 Listener Notifications
156 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
7 Listener Notifications
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 157
7 Listener Notifications
158 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
7 Listener Notifications
Important! A listener and the associated listener notifications must reside in the same
package in the Integration Server_directory/packages directory. Otherwise, data can be lost
when a package is reloaded.
The figures that illustrate listener run-time interactions with synchronous and
asynchronous notifications in this section show the run-time lifecycle of a listener from
the time it is started until the time it is shut down. The difference between the two
diagrams begins at step 3.3, when the server calls the runNotification method of the
notification. Do not interpret the separation of these diagrams to imply that a given
listener can use only synchronous or asynchronous notifications. On the contrary, step 3
represents a loop that repeats continuously while the listener is running, and any
iteration of the loop may follow either course depending on the class type of the
notification that indicates support for the notification event.
When a listener starts (or restarts), the server retrieves a connection from the associated
connection node before it calls the listener's listenerStartup method. This method can
access the connection using the retrieveConnection method from the base class. The
listenerStartup implementation should validate the values of any metadata parameter
settings, and perform any initialization required prior to the first waitForData call. An
exception thrown by the listenerStartup method, or a failure to retrieve a connection by
the server, disables the listener.
Note: A listener instance holds the connection it retrieves during listener initialization for
the lifetime of the listener instance. Disabling the connection node will not impact this
connection already held by the listener, but will prevent the listener from starting or
restarting in the event of an AdapterConnectionException.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 159
7 Listener Notifications
After initialization of the listener is complete, the server initiates the notification event-
processing loop represented by step 3 of the interaction diagrams. This loop continues
until one of the following events occurs:
The adapter user disables the listener in the adapter's administrative interface.
The package containing the listener is disabled (or reloaded).
Note: Disable the listener package before you disable the adapter package.
160 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
7 Listener Notifications
The event-processing loop begins with a call to the listener's waitForData method. This
method should interrogate the adapter resource to determine whether an event has
occurred that the listener should report. If not, the listener should return a null object to
allow the server to check for the shutdown conditions mentioned above. The model
assumes that the listener will implement some form of blocking read operation with a
time component that will allow it to return periodically, even if no notification event has
occurred. It is your responsibility to provide appropriate means of configuring the timing
characteristics of this blocked read (such as through a metadata parameter on either the
listener or the connection).
When the listener's waitForData method returns a non-null object, the server iterates
through the listener notifications that are currently registered with the listener (which
must be enabled and registered). For each notification, the supports method is passed the
data object received from waitForData (step 3.2). (The notification list order can be
manipulated in the adapter's administrative interface by editing the listener's settings.)
For the first notification to return true from its supports method, the server calls the
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 161
7 Listener Notifications
Listener Implementation
The example listener implementation provided in this section shows the basic mechanics
of a simple listener that can be used to monitor activity on an Integration Server log file.
The example listener notification parses a session log entry and produces asynchronous
notifications.
The tasks for implementing a listener are as follows:
“Defining a WmConnectedListener Implementation Class” on page 163.
“Updating the fillAdapterTypeInfo Method” on page 163.
“Updating the Resource Bundle” on page 164.
“Specifying Configuration Metadata” on page 164.
“Implementing Run-Time Code” on page 165.
“Configuring and Testing Listener Nodes and Listener Notification Nodes” on
page 173.
162 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
7 Listener Notifications
Because shutdownCallBack is called from within an external thread (that is, not the same
thread in which the listener itself is executing), you can take advantage of this feature to
gracefully interrupt the normal functioning of the waitForData method. The
listenerShutdown method will be subsequently invoked by WmART on the listener's
thread. This is where you should perform any listener-specific cleanup tasks.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 163
7 Listener Notifications
164 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
7 Listener Notifications
Note: All names returned by this method should refer to classes that extend
WmNotification.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 165
7 Listener Notifications
try
{
if(_reader.ready())
{
do
{
int i = _reader.read();
if (i != -1)
{
char c = (char)i;
workingBuffer.append(c);
if(c == '\n')
{
_lastDataObject = new String(workingBuffer);
workingBuffer = new StringBuffer();
break;
}
}
else
{
break;
}
}
while (_reader.ready());
}
}
catch (Throwable t)
{
throw MyAdapter.getInstance().createAdapterException(100,t);
}
return _lastDataObject;
}
public void listenerShutdown()
{
try
{
_reader.close();
}
catch(Throwable t){}
}
166 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
7 Listener Notifications
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 167
7 Listener Notifications
168 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
7 Listener Notifications
Specifying Metadata
The example listener notification in this section includes only those configuration
parameters that are directly related to the signature. The only new concept in this section
is the use of the useParam argument of the WmTemplateDescriptor.setResourceDomain
method.
You use this argument as a filter to determine which of the available fields will be
included in the signature. The example in this section implements the useParam
argument as USES_PARM, in the setResourceDomain method near the end of the
example.
This parameter is only meaningful when the parameter identified in the name argument
and the parameter names in useParam are in the same fieldMap, and the data type of the
useParam parameter is boolean[]. When these conditions are satisfied, the Adapter
Service Editor will treat the useParam setting as a filter on the resource domain
association. When this occurs, the resource domain values will only be applied to the
name parameter row in the fieldMap if the corresponding value in the useParam is true
(that is, when the adapter user selects the check box).
When the adapter user selects the fields to use for the notification (by selecting the check
boxes in the Uses column), values appear in the Signature column. When you save
changes to the notification node, the signature changes are reflected in the associated
document type.
public static final String FIELD_NAMES_PARM = "fieldNames";
public static final String FIELD_TYPES_PARM = "fieldTypes";
public static final String USES_PARM = "uses";
public static final String SIG_PARM = "signature";
public static final String NOTIFICATION_SETUP_GROUP =
"SessionLogListenerNotification.setup";
public static final String FIELD_NAMES_RD =
"SessionLogListenerNotification.fieldNames.rd";
public static final String FIELD_TYPES_RD =
"SessionLogListenerNotification.fieldTypes.rd";
private String[] _fieldNames = null;
private String[] _fieldTypes = null;
private boolean[] _uses = null;
public void setFieldNames(String[] val){_fieldNames = val;}
public void setFieldTypes(String[] val){_fieldTypes = val;}
public void setUses (boolean[] val){_uses = val;}
public void setSignature(String[] val){}
public void fillWmTemplateDescriptor(WmTemplateDescriptor descriptor,Locale l)
throws ResourceException
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 169
7 Listener Notifications
{
String[] parms = new String[] {FIELD_NAMES_PARM,
FIELD_TYPES_PARM,
USES_PARM,
SIG_PARM};
descriptor.createGroup(NOTIFICATION_SETUP_GROUP,parms);
descriptor.createFieldMap(parms,false);
descriptor.createTuple(new String[]{FIELD_NAMES_PARM,
FIELD_TYPES_PARM});
descriptor.setResourceDomain(FIELD_NAMES_PARM,FIELD_NAMES_RD,null);
descriptor.setResourceDomain(FIELD_TYPES_PARM,FIELD_TYPES_RD,null);
descriptor.setResourceDomain(SIG_PARM,
WmTemplateDescriptor.OUTPUT_FIELD_NAMES,
new String[]{FIELD_NAMES_PARM,FIELD_TYPES_PARM}, USES_PARM);
descriptor.setDescriptions(
MyAdapter.getInstance().getAdapterResourceBundleManager(),l);
}
Note: In this example, notice the use of class.getName when specifying data types. Using
this technique enables you to catch spelling errors at compile time.
170 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
7 Listener Notifications
WmManagedConnection connection,
String resourceDomainName,
String[][] values) throws AdapterException
{
ResourceDomainValues[] results = null;
if (resourceDomainName.equals(FIELD_NAMES_RD)
|| resourceDomainName.equals(FIELD_TYPES_RD))
{
ResourceDomainValues names =
new ResourceDomainValues(FIELD_NAMES_RD,_sigFieldNames);
ResourceDomainValues types =
new ResourceDomainValues(FIELD_TYPES_RD,new String[] {
Date.class.getName(), //timestamp
String.class.getName(), // component
String.class.getName(), // rootContext
String.class.getName(), // parentContext
String.class.getName(), // currentContext
String.class.getName(), // server
Integer.class.getName(), // eventCode
String.class.getName(), // user
String.class.getName(), // sessionName
Integer.class.getName(), // RPCs
Long.class.getName() // age
});
results = new ResourceDomainValues[] {names,types};
}
return results;
}
public void registerResourceDomain(WmManagedConnection connection,
WmAdapterAccess access)
throws AdapterException
{
access.addResourceDomainLookup(
this.getClass().getName(),FIELD_NAMES_RD,connection);
access.addResourceDomainLookup(
this.getClass().getName(),FIELD_TYPES_RD,connection);
}
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 171
7 Listener Notifications
this._parsedValues[2] = st.nextToken();
this._parsedValues[3] = st.nextToken();
this._parsedValues[4] = st.nextToken();
st.nextToken(); // skip the session ID
this._parsedValues[5] = st.nextToken();
this._parsedValues[6] = new Integer(st.nextToken());
this._parsedValues[7] = st.nextToken();
this._parsedValues[8] = st.nextToken();
this._parsedValues[9] = new Integer(st.nextToken());
this._parsedValues[10] = new Long(st.nextToken());
result = true;
}
catch(Throwable t){}
return result;
}
The runNotification implementation assumes that the supports method was successful in
parsing the data object, so it does not need the NotificationEvent argument. It merely
populates a WmRecord object by inserting the parsed names, using the same key names
array that populate the resource domain.
public NotificationResults runNotification(NotificationEvent event)
throws ResourceException
{
NotificationResults result = null;
WmRecord notice = WmRecordFactory.getFactory().createWmRecord("notUsed");
for(int i = 0; i< _sigFieldNames.length;i++)
{
if (_uses[i])
{
notice.put(_sigFieldNames[i],_parsedValues[i]);
}
}
this.doNotify(notice);
result = new AsyncNotificationResults(this.nodeName(),true,null);
return result;
}
Note: The doNotify method has two forms. When calling the
WmAsynchronousNotification.doNotify(WmRecord rec, String msgId) form of this
method, the length (the number of characters) of the value in msgId should not exceed a
particular limit. To determine this limit, call the
WmAsynchronousNotification.adapterMaxMessageIdLen() method. There is a fixed
number of characters available in Integration Server to hold a notification ID. Of these,
the WmART package reserves a certain number to hold a unique ID that it inserts prior to
dispatching a notification. The remaining characters are available to you when calling
WmAsynchronousNotification.doNotify(WmRecord rec, String msgId). For more
information, see the Javadoc for WmAsynchronousNotifcation.doNotify.
172 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
7 Listener Notifications
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 173
7 Listener Notifications
174 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
8 Design-Time Tasks
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Package Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Configuring Connection Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Configuring Adapter Service Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Polling Notification Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Listener Notification Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 175
8 Design-Time Tasks
Overview
At design time, adapter users will configure and initialize the following run-time
components of the adapter:
Namespace node packages. Management tasks include:
Setting package dependencies for namespace node packages (see “Package
Dependency Considerations for Namespace Node Packages” on page 177).
Setting package dependencies for namespace nodes (see “Package Dependency
Considerations for Namespace Nodes” on page 177).
Using access control lists (ACLs) to control which development group has access
to which adapter services (see “Group Access Control” on page 178).
“Enabling and Disabling Packages” on page 178).
“Loading, Reloading, and Unloading Packages” on page 178).
Connection nodes (see “Configuring Connection Nodes” on page 179).
Adapter service nodes (see “Configuring Adapter Service Nodes” on page 182).
Polling notification nodes (see “Polling Notification Nodes” on page 183).
Listener nodes and listener notification nodes (see “Listener Notification Nodes” on
page 186).
To perform these tasks, adapter users will use webMethods Integration Server,
Software AG Designer or webMethods Developer, and a web browser.
Note: You must have Integration Server administrator privileges to access an adapter's
management screen. For information about setting user privileges, see the Integration
Server administration guide for your release. See “About this Guide” for specific
document titles.
Package Management
A namespace node package is a package in which an adapter user will create the
adapter's namespace nodes for connections, adapter services, polling notifications,
listener notifications, and listeners. They should not create nodes in the adapter package.
Keeping namespace nodes separate from the adapter package simplifies the process of
upgrading a deployed adapter.
The procedure for creating a namespace node package is identical to the procedure for
creating any webMethods package. For instructions for creating packages, see the
Designer Service Development online help for your release. See “About this Guide” for
specific document titles.
All the nodes of an adapter may be located in one package, or they may be distributed
among multiple packages.
176 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
8 Design-Time Tasks
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 177
8 Design-Time Tasks
Note: Enabling an adapter package will not cause its associated node package(s) to be
reloaded. For information about reloading packages, see “Loading, Reloading, and
Unloading Packages” on page 178.
Important! Before you manually enable a node package, you must first enable its associated
adapter package. Similarly, if your adapter has multiple node packages, and you want to
disable some of them, disable the adapter package first. Otherwise, errors will be issued
when you try to access the remaining enabled node packages.
178 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
8 Design-Time Tasks
Unloading Packages
At shutdown, Integration Server unloads the packages in the reverse order in which it
loaded them: it unloads the node package(s) first, the adapter package next, and the
WmART package last (assuming the dependencies are correct).
Field Description
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 179
8 Design-Time Tasks
Field Description
Folder Name Type the folder name in which to create the connection. If
the folder does not already exist in the package, the server
creates it.
Connection Name Type a connection name.
Field Description
Enable Connection Enables or disables the use of connection pooling for the
Pooling connection. The default value is true (enabled).
Minimum Pool Size The number of connections to create when the connection
is enabled. The default value is 1.
Maximum Pool Size The maximum number of connections that can exist at one
time in the connection pool. The default value is 10.
Pool Increment Size The number of connections by which the pool will be
incremented if connections are needed, up to the
maximum pool size. The default value is 1.
180 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
8 Design-Time Tasks
Field Description
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 181
8 Design-Time Tasks
Field Description
Startup Backoff The number of seconds that the system should wait
Timeout between attempts to initialize the connection pool. This
field is irrelevant if the value of Startup Retry Count is 0. The
default value is 10.
Note: If a connection node is enabled when the server shuts down, it will be enabled at
server startup.
Note: Make sure that the Integration Server, with which you want to use Designer, is
running.
2 Select a namespace node package in which to create the adapter service node.
3 Create a folder in the selected package and navigate to that folder in the Package
Navigator section of Designer.
182 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
8 Design-Time Tasks
Important! If you are using the adapter with Integration Server 8.0 SP1 or earlier,
adapter services cannot use connections that are also used for adapter listeners.
9 On the Select a Template screen, select an adapter service template and click Next.
10 Click Finish.
11 Specify values for the tab that is specific for your adapter resource (such as Query,
Update, Add, or Delete tab).
12 Specify values for the Input/Output tab and the Settings tab. For more information,
see the Designer Service Development online help for your release. See “About this
Guide” for specific document titles.
13 Select File > Save.
Note: Make sure that the Integration Server, with which you want to use Designer, is
running.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 183
8 Design-Time Tasks
2 Select a namespace node package in which to create the adapter service node.
3 Create a folder in the selected package and navigate to that folder in the Package
Navigator section of Designer.
4 Select File > New.
5 Select Adapter Notification from the list of elements.
6 On the Create a New Adapter Notification screen, type a name for your service in the
Element name field and click Next.
7 On the Select Adapter Type screen, select the name of your adapter and click Next.
8 On the Select a Template screen, select an adapter notification template and click Next.
9 On the Select an Adapter Connection Alias screen, select the appropriate adapter
connection name and click Next.
Important! If you are using the adapter with Integration Server 8.0 SP1 or earlier,
adapter services cannot use connections that are also used for adapter listeners.
10 Click Finish.
11 Select File > Save.
The adapter creates the notification node and a document (named
notificationNamePublishDocument). This document is used to contain the data of the
affected portion of the adapter resource (such as a database row), and to inform
Integration Server of the changes.
12 In the Adapter Notification Editor's Message Polling tab, select a polling event from the
Polling Name field.
13 Configure the Adapter Notification Editor fields as appropriate for your adapter
resource. For information about using the Adapter Notification Editor, see the
Designer Service Development online help for your release. See “About this Guide”
for specific document titles.
14 Select File > Save.
15 Schedule and enable the notification at runtime, as described in “Scheduling and
Enabling Polling Notification Nodes” on page 184.
184 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
8 Design-Time Tasks
Option Description/Action
View Schedule Click on the View Schedule icon to review the parameters for
the selected polling notification. Click Return to Notifications to
go back to the main polling notification page.
5 To create or modify schedule parameters for the selected notification, click the Edit
Schedule icon and set the following options:
Option Description/Action
Interval (seconds) Type the polling interval time in seconds.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 185
8 Design-Time Tasks
Option Description/Action
Overlap This option determines when the scheduled interval time you
set in the Interval field begins. Enable this option to allow for
executions of the scheduled notification to overlap. With the
Overlap option enabled, the next scheduled execution does
not wait for the current execution to end.
If your notification requires the preservation of the
notification ordering, do not enable this option.
Immediate Enable this option to start polling immediately.
Note: One way to test a polling notification node is presented in “Testing the
underBalancePolling Notification Node” on page 293.
186 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
8 Design-Time Tasks
Field Description\Action
Retry Limit The number of times that the system should attempt to start
the listener if the initial attempt fails. Specifically, it specifies
how many times to retry the listenerStartup method before
issuing an AdapterConnectionException. When the value is
set to 0, the system makes a single attempt. The default value
is 5.
Retry Backoff The number of seconds the system should wait between each
Timeout attempt to start the listener. This field is irrelevant if the value
of Retry Limit is 0. The default value is 10.
Note: Enabling the listener before you configure and enable its corresponding listener
notification node produces a warning.
Note: A listener instance holds the connection it retrieves during listener initialization for
the lifetime of the listener instance. Disabling the connection node will not impact the
connection already held by the listener, but it will prevent the listener from starting or
restarting in the event of an AdapterConnectionException.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 187
8 Design-Time Tasks
188 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
8 Design-Time Tasks
3 On the Listener Notification screen, enable the listener notification node by clicking
No in the Enabled column. The Enabled column now shows Yes (enabled).
4 On your adapter management screen, click Listeners.
5 On the Listeners screen, enable the listener by clicking No in the Enabled column. The
Enabled column now shows Yes (enabled).
Note: One way to test a listener notification node is presented in “Testing the
checkDepositListener Notification Node” on page 301.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 189
8 Design-Time Tasks
190 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
9 Run Time Activities
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Retry and Recovery Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Run Time Connection Allocation for Adapter Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 191
9 Run Time Activities
Overview
A well designed adapter should include the following run-time capabilities:
Ability to identify, and recover from, temporary errors (see “Retry and Recovery
Architecture” on page 192 below).
Ability to retrieve and manage connections, and allow the user to dynamically
control the type of connection used for each service invocation (see “Run Time
Connection Allocation for Adapter Services” on page 196).
Detection
The ability to recognize these errors is critical in every component of an adapter. It is up
to the adapter developer to determine which backend errors are transient. When an
adapter recognizes this situation, it throws an AdapterConnectionException to alert
Integration Server to the error. This exception is a subclass of the ResourceException. This
is a valid exception to throw from any ADK method that declares, "throws
ResourceException".
An adapter writer should make an effort to isolate the errors that are transient. When
Integration Server catches the AdapterConnectionException it will initiate the retry
operations. If this occurs for non-transient errors it will be a waste of processing time.
192 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
9 Run Time Activities
Removal/Regeneration
Transient exceptions within adapters are all related to connection errors. Therefore, the
connection used in the operation will need to be cleared and regenerated before a retry
occurs.
Based on the AdapterConnectionException received from the adapter, Integration Server
will clean the entire pool or just the current connection. The
AdapterConnectionException will indicate if the entire pool needs to be cleaned or only
the current connection. By default, the exception will indicate the entire pool needs to be
cleaned. For most applications this is the correct behavior.
To clean the current connection, the destroy() method is called and the object is
discarded. To clean the pool, the connection pool manager will be notified and all free
connections will be destroyed and discarded. Any busy connections will be destroyed
and discarded when they are released. The connection node will remain enabled.
The regeneration occurs when a new connection is requested. If the connection is non-
pooled an attempt is made to create the connection. If successful a connection will be
created and used. If the connection is pooled and only the single connection was
destroyed, another connection is reserved from the pool and used. If the pool was
cleared, the pool will attempt to fill to the minimum number of connections specified for
the pool. If successful a connection will be reserved and used.
If the transient error still exist at any stage of the pool regeneration or connection creation
you should throw an AdapterConnectionException. This will end the current retry
operation and Integration Server will start another retry execution or end the retry loop if
the maximum attempts have been made.
Retry Mechanisms
The retry facility is provided by Integration Server. The facility depends on what adapter
construct detected the failure. A retry is configured with a retry count and a backoff time.
Retry count sets the number of times the action will be tried before being considered a
fatal error. The backoff time is the time waited between retries. Note that throwing a non-
retryable exception on any retry iteration will be treated as a fatal exception and the
retries will stop.
The following is a list of adapter objects and how retry behavior applies to each:
Connection Pools. Retry is possible at pool startup. If the backend system is down and
the user tries to enable the pool from webMethods Integration Server Administrator,
the pool startup will retry until the number of retries is exhausted or the retryable
exception goes away. If retries are exhausted, the pool will become disabled. Retries
also occur when the pool is created during server startup.
Listeners. Retry is possible during listener startup or during execution. If the number
of retries is exhausted, the listener will become disabled. By default, if during
execution the Listener Notification produces an AdapterConnectionException, it will
cause the corresponding listener to go into retry mode.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 193
9 Run Time Activities
194 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
9 Run Time Activities
If so configured, and after an appropriate timeout period, the adapter service is once
again invoked (beginning at step 4). Since the connection pool was emptied after the
AdapterConnectionException, a new connection will be created for this service
invocation (steps 5 and 6). If a transient error condition still exists, another
AdapterConnectionException should be thrown from either the
createManagedConnectionObject() or initializeConnection() call. In that event the pool
will once again be reset (step 3) and the retry logic used again.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 195
9 Run Time Activities
196 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
9 Run Time Activities
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 197
9 Run Time Activities
198 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
9 Run Time Activities
Create a class to hold any required information gathered from an adapter service
invocation. This class must extend com.wm.adk.connection.WmConnectionSpec.
Implement the getConnectionRequestInfo() method in the adapter's
WmManagedConnectionFactory implementation
Implement the getConnectionSpec() method in the adapter's WmAdapterService
implementation.
To demonstrate an implementation, we will use the fictional MegaBank corporation.
MegaBank is an aggressive company, regularly acquiring and absorbing the customer
base of smaller banks. A customer acquired in this way is assigned a new MegaBank user
name with which he can access his accounts as well as other services provided by the
larger bank. Since MegaBank has adapters for most major banking systems, it is able to
seamlessly integrate the new bank's system very quickly, by mapping the customer's new
MegaBank user name with login information already present in the acquired bank's
system. Using partitioned pools, connections are established using authentication
information already known to the backend.
Extending WmConnectionRequestInfo
A ConnectionRequestInfo object defines a partition both within the connection pool and
in WmManagedConnectionFactory.createManagedConnectionObject() when a new
connection is created. The connection pool organized its connections based on the
ConnectionRequestInfo object used when the connection was created. In this case,
ConnectionRequestInfo objects X and Y are considered the same if (X.hashCode() ==
Y.hashCode() && X.equals(Y)) The remainder of the ConnectionRequestInfo
implementation is defined by the adapter.
In the MegaBank example, a partition is defined by the userId with which the back-end
connection is established. In order to ensure that the connection pool properly recognizes
objects that refer to the same partition, the example below implements the hashCode()
and equals() methods so that they only refer to the userId String.
The final abstract method that must be implemented is getLogableName(). This method
is used to provide a partition name that can be recorded in Integration Server logs. In this
example, it is also used to correlate the MegaBank user name with the ID used to access
the backend. Care should be taken in implementing this method to avoid exposing any
sensitive data (such as passwords).
public class MbConnectionRequestInfo extends WmConnectionRequestInfo
{
/**
* Sole constructor. verifies all fields populated.
*
* @param mbUserName - common user name used across the integration
* @param userId - name of user as known to the backend system
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 199
9 Run Time Activities
/**
* Name used by the connection pool when creating log entries relevant
* to the partition identified by this object.
*/
public String getLoggableName()
{
return logName;
}
/**
* In a ConnectionRequestInfo object the hashCode of objects that
* identifythe same partion must be the same, so we use only the
* hashcode of the userId String.
*/
public int hashCode()
{
return this.userId.hashCode();
}
/**
* If two ConnectionRequestInfo objects identify the same partition,
* then the equals method must return true. We compare the userIds of
* the two object rather than allow the default equals implementation
* which only checks if they are the same object instance.
* @param obj - object being compared to this.
*/
public boolean equals(Object obj)
{
boolean isEqual = false;
200 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
9 Run Time Activities
Extending WmConnectionSpec
A WmConnectionSpec object is used during an adapter service invocation to identify a
connection node and/or to hold any contextual information from the service
configuration and invocation pipeline that is needed to identify the partition of the
connection. Accessors for the connection node name are provided in the base class.
Contextual information need for partition definition is specific to the adapter and must
be implemented in an adapter-defined subclass.
For the MegaBank example, each customer is assigned a username that allows access to
all of the bank's services. This value must be cross-referenced to obtain the name by
which that user is known on the specific back-end system. This cross-referencing will be
delegated to the WmConnectionFactory.getConnectionRequestInfo() implementation
described later in this document. For now, we simply need a container to hold the
information.
public class MbConnectionSpec extends WmConnectionSpec
{
private String mbUserName;
public MbConnectionSpec()
{
super();
}
public String getMbUserName()
{
return mbUserName;
}
public void setMbUserName(String mbUserName)
{
this.mbUserName = mbUserName;
}
}
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 201
9 Run Time Activities
/**
* Produce a ConnectionRequestInfo object based on the provided ConnectionSpec
* object. If an mbUserName is provided, lookup the name to use on the backend
* for this connection pool.
*/
public ConnectionRequestInfo getConnectionRequestInfo(ConnectionSpec spec)
{
MbConnectionRequestInfo partitionDef = null;
if(spec != null && spec instanceof MbConnectionSpec)
{
synchronized(this)
{
try
{
String mbUserName = ((MbConnectionSpec)spec).getMbUserName();
lookupUser(mbUserName);
partitionDef = new MbConnectionRequestInfo(mbUserName,
this.backendUserID, this.credentials);
}
catch(IllegalArgumentException ex)
{
// no partition info available for this user. Swallow the
// exception and return null
}
}
}
return partitionDef
}
When the connection pool needs a new connection belonging to a particular partition, the
ConnectionRequestInfo object returned above is passed to the
createManagedConnectionObject method. In the sample code shown below, this
information is used to override default logon information that is otherwise established
based on metadata parameter settings. Note that all createManagedConnectionObject
implementations must be able to establish default-partition connections when null is
passed in the cxRequestInfo argument.
/**
* Create a connection using userId and credentials from the provided
* connectionRequestInfo object, if provided. If connectionRequestInfo is
* not provided use the default userId and credentials information established
* at node startup from metadata parameters.
*/
public WmManagedConnection createManagedConnectionObject(Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException
{
String connUser;
Credentials connCredentials;
if (cxRequestInfo != null && cxRequestInfo instanceof
MbConnectionRequestInfo)
{
connUser = ((MbConnectionRequestInfo)cxRequestInfo).getUserId();
connCredentials =
((MbConnectionRequestInfo)cxRequestInfo).getCredentials();
}
else
{
202 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
9 Run Time Activities
connUser = this.defaultUserId;
connCredentials = this.defaultCredentials;
}
return new MbConnection(connUser, connCredentials);
}
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 203
9 Run Time Activities
204 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
A Alternative Approaches to Metadata
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Implementing Metadata Parameters Using External Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
An Alternative Approach to Organizing Resource Domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Using Resource Bundles with Resource Domain Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 205
A Alternative Approaches to Metadata
Overview
This chapter describes other capabilities supported by the ADK that are useful, but not
required, for implementing an adapter.
where parameters is derived from setParameters, and foo is derived from setFoo.
206 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
A Alternative Approaches to Metadata
package com.mycompany.adapter...;
import com.wm.adk.connection.WmManagedConnection;
import com.wm.adk.metadata.*;
import com.wm.adk.error.*;
public interface ResourceDomainHandler
{
/**
* Implements resource domain lookups using the provided connection. Refer to
* the method of the same name in com.wm.adk.connection.WmManagedConnection.
*
* @param connection
* @param resourceDomainName
* @param values
* @return ResourceDomainValues[]
* @throws AdapterException
*/
public ResourceDomainValues[] adapterResourceDomainLookup(
WmManagedConnection connection,
String resourceDomainName,
String[][] values) throws AdapterException;
/**
* Implements Adapter check values using the provided connection. Refer to
* the method of the same name in com.wm.adk.connection.WmManagedConnection.
*
* @param connection
* @param resourceDomainName
* @param values
* @param testValue
* @return Boolean
* @throws AdapterException
*/
public Boolean adapterCheckValue( WmManagedConnection connection,
String resourceDomainName,
String[][] values,
String testValue) throws AdapterException;
/**
* Implements resource domain registrations specific to a particular service
* or notification. Refer to the method of the same name in
* com.wm.adk.connection.WmManagedConnectionFactory.
*
* @param connection
* @param access
* @throws AdapterException
*/
public void registerResourceDomain(WmManagedConnection connection,
WmAdapterAccess access)throws
AdapterException;
}
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 207
A Alternative Approaches to Metadata
To use this model, you must have a list of services and notifications that implement the
interface. Since the connection factory must already register its services, the connection
factory is a logical place to create these lists. The lists are then passed to the connections
that the connection factory creates. For example:
public class SimpleConnectionFactory extends WmManagedConnectionFactory
{
private static final String[] _supportedServiceTemplates = {
SimpleService.class.getName(),
TestService.class.getName(),
CopySLN.class.getName(),
Copy2SLN.class.getName()};
private static final String[] _supportedNotificationTemplates = {
SimpleNotification.class.getName(),
SessionLogListenerNotification.class.getName()};
// add metadata parameter support here
public WmManagedConnection createManagedConnectionObject(
javax.security.auth.Subject subject,
javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
{
ArrayList templateList = new ArrayList(
Arrays.asList(_supportedServiceTemplates));
templateList.addAll(Arrays.asList(_supportedNotificationTemplates));
String [] listArg = new String[templateList.size()];
templateList.toArray(listArg);
return new SimpleConnection(...,listArg);
}
public void fillWmDescriptor(WmDescriptor d,Locale l) throws
AdapterException
{
...
}
public void fillResourceAdapterMetadataInfo(
ResourceAdapterMetadataInfo info,
Locale locale)
{
String[] templateList = _supportedServiceTemplates;
for (int i = 0; i < templateList.length;i++)
{
info.addServiceTemplate(templateList[i]);
}
}
}
The connection implementation then uses the service name it receives in the
adapterResourceDomainLookup, and adapterCheckValue calls to forward those requests
to the appropriate service or notification class:
public class SimpleConnection extends WmManagedConnection
{
private String[] _resourceHandlerList;
public SimpleConnection(...,String[] resourceHandlerList)
{
_resourceHandlerList = resourceHandlerList;
...
}
public void registerResourceDomain(WmAdapterAccess access)throws
208 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
A Alternative Approaches to Metadata
AdapterException
{
try
{
Class serviceClass;
ResourceDomainHandler serviceObject;
for (int i = 0;i < _resourceHandlerList.length;i++ )
{
serviceClass = Class.forName(_resourceHandlerList[i]);
serviceObject =
(ResourceDomainHandler)serviceClass.newInstance();
serviceObject.registerResourceDomain(this,access);
}
}
catch (Throwable t)
{
throw MyAdapter.getInstance().createAdapterException(9999,t);
}
}
public Boolean adapterCheckValue( String serviceName,
String resourceDomainName,
String[][] values,
String testValue)throws
AdapterException
{
Class serviceClass;
ResourceDomainHandler serviceObject;
try
{
serviceClass = Class.forName(serviceName);
serviceObject =
(ResourceDomainHandler)serviceClass.newInstance();
}
catch (Throwable t)
{
throw
MyAdapter.getInstance().createAdapterException(9999,t);
}
return
serviceObject.adapterCheckValue(this,resourceDomainName,values,testValue);
}
public ResourceDomainValues[] adapterResourceDomainLookup(
String serviceName,
String resourceDomainName,
String[][] values) throws AdapterException
{
Class serviceClass;
ResourceDomainHandler serviceObject;
try
{
serviceClass = Class.forName(serviceName);
serviceObject =
(ResourceDomainHandler)serviceClass.newInstance();
}
catch (Throwable t)
{
throw
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 209
A Alternative Approaches to Metadata
MyAdapter.getInstance().createAdapterException(9999,t);
}
return
serviceObject.adapterResourceDomainLookup(this,resourceDomainName,values);
}
...
}
210 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
A Alternative Approaches to Metadata
locale. From the adapter user's perspective, all localized values change from English to
Japanese. (This example assumes that the adapter includes both an English and a
Japanese resource bundle.)
To support localized resource domain values, include the property name
ADKGLOBAL.DESIGN_LOCALE_PROPERTY in the resource domain dependency list
of any parameter that uses a resource domain with localized resource domain values.
Include this property name for any parameters where the lookup depends on a
parameter containing localized values, as well. For example:
d.setResourceDomain( "status", "statusLookup", new
String[]{ADKGLOBAL.DESIGN_LOCALE_PROPERTY} );
d.setResourceDomain( "statusDescription","statusDescriptionLookup", new
String[]
{ "status",ADKGLOBAL.DESIGN_LOCALE_PROPERTY } );
At run time, the adapter uses the getDesignTimeLocale method to retrieve the locale, and
to interpret the value of localized parameters. For example:
Locale lookupLocale =
AdapterUtil.parseLocaleString(this.getDesignTimeLocale());
AdapterResourceBundleManager ar =
MyAdapter.getInstance().getAdapterResourceBundleManager();
if (this.getStatus.equals(ar.getStringResource("active",lookupLocale)))
{
...
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 211
A Alternative Approaches to Metadata
com.wm.adk.ADKGLOBALS.DESIGN_TIME_LOCALE_PROPERTY
com.wm.adk.cci.interaction.WmAdapterService.getDesignTimeLocale()
com.wm.adk.notification.WmNotification.getDesignTimeLocale()
com.wm.adk.util.AdapterUtil.parseLocaleString()
212 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
B Integration Server Transaction Support
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Simple Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
More Complex Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Implicit Transaction Usage Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Explicit Transaction Usage Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Built-In Services For Explicit Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Transaction Error Situations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Specifying Transaction Support in Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 213
B Integration Server Transaction Support
Overview
This section describes how webMethods Integration Server supports transactions.
Integration Server considers a transaction to be one or more interactions with one or
more resources that are treated as a single logical unit of work. The interactions within a
transaction are either all committed or all rolled back. For example, if a transaction
includes multiple database inserts, and one or more inserts fail, all inserts are rolled back.
Integration Server supports the following kinds of transactions:
A local transaction, which is a transaction to a resource's local transaction mechanism
An XAResource transaction, which is a transaction to a resource's XAResource
transaction mechanism
Integration Server can automatically manage both kinds of transactions, without
requiring the adapter user to do anything. Integration Server uses a container-managed
(implicit) transaction management approach based on the JCA standard, and also
performs some additional connection management. This is because adapter services use
connections to create transactions. For more information, see “Implicit Transaction Usage
Cases” on page 216.
However, there are cases where adapter users need to explicitly control the transactional
units of work. Examples of these cases are provided in “Explicit Transaction Usage
Cases” on page 217.
To support transactions, Integration Server relies on a built-in transaction manager. The
transaction manager is responsible for beginning and ending transactions, maintaining a
transaction context, enlisting newly connected resources into existing transactions, and
ensuring that local and XAResource transactions are not combined in illegal ways.
Beginning with Integration Server 8.0, the Transaction Manager also manages operations
performed by a transacted JMS trigger, or a built-in JMS service that uses a transacted
JMS connection alias.
Important! You cannot create steps and trace a flow that contains a transacted adapter
service.
Note: If you interact with a resource that does not support transactions, Integration Server
will not create a transaction for it.
Simple Transactions
The simplest Integration Server transaction scenario is a flow service (or a Java service)
that invokes one adapter service that interacts with one resource. For example, the
transaction might perform a database insert.
214 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
B Integration Server Transaction Support
Integration Server executes this transaction without requiring adapter users to perform
any transaction management, as follows.
1 Integration Server invokes the request as follows:
a The adapter service obtains a connection from the connection pool, creates a
transaction, and enlists the connection in the current transaction.
b The adapter service performs the database insert. If the insert fails, a
ServiceException is thrown.
2 Integration Server informs the transaction manager that the service request has
completed as follows:
If the service request succeeds, the transaction manager commits the current
transaction. If the commit fails, the transaction manager throws an exception that
causes the service request to fail, and a ServiceException is returned to the
adapter user.
If the service request fails, the transaction manager rolls back the current
transaction.
Note that the commit or rollback occurs after the service has completed, but before any
response is sent to the client that invoked the service. This is because if the transaction
commit fails, the service itself must fail. So, the transaction notification essentially
becomes the last step of the service (as opposed to occurring after the service has already
completed).
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 215
B Integration Server Transaction Support
Note: If a transaction accesses multiple resources, and more than one of the resources only
supports local transactions, the integrity of the transaction cannot be guaranteed. For
example, if the first resource successfully commits, and the second resource fails to
commit, the first resource interaction cannot be rolled back; it has already been
committed. To help prevent this problem, Integration Server detects this case when
connecting to more than one resource that does not support two-phase commits. It
throws a run-time exception and the service execution fails.
216 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
B Integration Server Transaction Support
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 217
B Integration Server Transaction Support
For example, the following flow includes a local transaction nested within another local
transaction:
BEGIN FLOW // start transaction 1
.
.
.
INVOKE startTransaction(2) // start transaction 2
.
.
.
INVOKE commitTransaction(2) // commit transaction 2
END FLOW // commit transaction 1
A nested transaction must adhere to the same rules that apply to container-manager
transactions. That is, a nested transaction can contain one of the following:
One local transaction, interacting with one resource
One or more XAResource transactions; each transaction can interact with one or more
resources
One or more XAResource transactions and one local transaction
Following are some examples of explicit transactions.
218 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
B Integration Server Transaction Support
3 When the flow ends, Integration Server closes the connection for transaction 1 and
commits its work to ResourceA.
Note: Each transaction is a separate unit of work. Transaction 1 could be rolled back (or
the commit could fail), while transaction 2 remains committed (or vice versa).
Alternatively, to achieve the same result, you can explicitly start transaction 1 before the
adapter service is invoked, and explicitly commit it as follows:
BEGIN FLOW
INVOKE startTransaction(1) // start transaction 1
INVOKE interactWithResourceA // service for transaction 1
INVOKE startTransaction(2) // start transaction 2
INVOKE interactWithResourceB // service for transaction 2
INVOKE commitTransaction(2) // commit transaction 2
INVOKE commitTransaction(1) // commit transaction 1
END FLOW
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 219
B Integration Server Transaction Support
220 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
B Integration Server Transaction Support
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 221
B Integration Server Transaction Support
WmART.pub.art.transaction:commitTransaction
This service commits an explicit transaction. It must be used in conjunction with the
WmART.pub.art.transaction:startTransaction service. If it does not have a corresponding
WmART.pub.art.transaction:startTransaction service, your flow service will receive a run-time
error.
For more information about implicit and explicit transactions, see “Built-In Services For
Explicit Transactions” on page 222.
Input Parameters
222 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
B Integration Server Transaction Support
WmART.pub.art.transaction:rollbackTransaction
This service rolls back an explicit transaction. It must be used in conjunction with a
WmART.pub.art.transaction:startTransaction service. If it does not have a corresponding
WmART.pub.art.transaction:startTransaction service, your flow service will receive a run-time
error.
For more information about implicit and explicit transactions, see “Built-In Services For
Explicit Transactions” on page 222.
Input Parameters
WmART.pub.art.transaction:setTransactionTimeout
This service enables you to manually set a transaction timeout interval for implicit and
explicit transactions. When you use this service, you are overriding the Integration
Server's transaction timeout interval. To change the server's default transaction timeout,
see “Changing the Integration Server's Transaction Timeout Interval” on page 224.
You must call this service within a flow before the start of any implicit or explicit
transactions. Implicit transactions start when you call an adapter service in a flow.
Explicit transactions start when you call the WmART.pub.art.transaction:startTransaction service.
If the execution of a transaction takes longer than the transaction timeout interval, all
current executions associated with the flow are cancelled and rolled back if necessary.
This service only overrides the transaction timeout interval for the flow service in which
you call it.
Input Parameters
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 223
B Integration Server Transaction Support
WmART.pub.art.transaction:startTransaction
This service starts an explicit transaction. It must be used in conjunction with either a
WmART.pub.art.transaction:commitTransaction service or WmART.pub.art.transaction:rollbackTransaction
service. If it does not have a corresponding WmART.pub.art.transaction:commitTransaction
service or WmART.pub.art.transaction:rollbackTransaction service, your flow service will receive a
run-time error.
For more information about implicit and explicit transactions, see “Built-In Services For
Explicit Transactions” on page 222.
Input Parameters
Output Parameters
224 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
B Integration Server Transaction Support
This transaction timeout parameter does not halt the execution of a flow; it is the
maximum number of seconds that a transaction can remain open and still be considered
valid. For example, if a current transaction has a timeout value of 60 seconds and a flow
takes 120 seconds to complete, the transaction manager will rollback all registered
operations regardless of the execution status.
For more information about modifying the server.cnf file, see the Integration Server
administration guide for your release. See “About this Guide” for specific document
titles.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 225
B Integration Server Transaction Support
Important! Do not call the super() method when you override getLocalTransaction or
getXAResource.
226 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Connection Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Adapter Service Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Listener Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Listener Notification Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Polling Notification Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 227
C Using the Services for Managing Namespace Nodes
Overview
The ADK provides a set of auxiliary Java services that you can use to replicate namespace
nodes programmatically and to change the nodes' metadata appropriately when
deploying an adapter to a different Integration Server. It provides services for
connections, adapter services, listeners, listener notifications, and polling notifications.
Connection Services
These services are located in the wm.art.dev.connection directory.
Service Description
wm.art.dev.connection:createConnectionNode Creates a new connection node in the
specified package and folder.
wm.art.dev.connection:deleteConnectionNode Removes the specified connection node.
wm.art.dev.connection:fetchConnectionManagerMe Returns the connection manager
tadata metadata properties that are predefined
for all connections.
wm.art.dev.connection:fetchConnectionMetadata Queries the connection factory and
returns the metadata for all properties
supported by connections of the specified
type.
wm.art.dev.connection:updateConnectionNode Alters the values of an existing
connection.
Service Description
wm.art.dev.service:createAdapterServiceNode Creates a new adapter service node in the
specified package and folder from the
specified service template and connection
alias.
wm.art.dev.service:deleteAdapterServiceNode Removes a specified adapter service node.
wm.art.dev.service:fetchAdapterServiceTemplateM Returns all metadata for a specified
etadata adapter service template.
wm.art.dev.service:updateAdapterServiceNode Alters the values of an existing adapter
service.
228 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
Listener Services
These services are located in the wm.art.dev.listener directory.
Service Description
wm.art.dev.listener:analyzeListenerNodes Logs the data for listeners.
wm.art.dev.listener:createListenerNode Creates a new instance of a listener in
the specified package and folder from
the specified listener template and
connection alias.
wm.art.dev.listener:deleteListenerNode Removes a specified instance of a
listener.
wm.art.dev.listener:fetchListenerTemplateMetadata Returns all metadata supported by that
listener template.
wm.art.dev.listener:updateListenerNode Alters the values of an existing listener.
wm.art.dev.listener:updateRegisteredNotifications Checks the registration of listener
notifications.
Service Description
wm.art.dev.notification:analyzeListenerNotifications Logs the data for listener notifications.
wm.art.dev.notification:createListenerNotificationNode Creates a new instance of a
synchronous or asynchronous listener
notification in the specified package
and folder from the specified
notification template and connection
alias.
wm.art.dev.notification:deleteListenerNotificationNode Removes a specified instance of listener
notification.
wm.art.dev.notification:fetchListenerNotificationTempl Returns all metadata for a specified
ateMetadata listener notification template.
wm.art.dev.notification:updateListenerNotificationNod Alters the values of an existing
e synchronous or asynchronous listener
notification.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 229
C Using the Services for Managing Namespace Nodes
Service Description
wm.art.dev.notification:createPollingNotificationNo Creates a new instance of a polling
de notification in the specified package and
folder from the specified notification
template and connection alias.
wm.art.dev.notification:deletePollingNotificationNo Removes an instance of a specified
de polling notification.
wm.art.dev.notification:fetchPollingNotificationTem Returns all metadata for a specified
plateMetadata polling notification template, and returns
any scheduling properties that are set for
the notification.
wm.art.dev.notification:updatePollingNotificationNo Alters the characteristics of an existing
de polling notification.
wm.art.dev.listener:analyzeListenerNodes
This service logs the data for listeners in the server log file. The data includes the names
of associated listener notifications, the class name of listener notifications, their status
(active or disabled), and whether the associated listener notification is linked with the
same listener or not.
Note: A listener can be used by multiple listener notifications, but a listener notification
will have only one listener node.
Input Parameters
None.
Output Parameters
None.
230 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
wm.art.dev.notification:analyzeListenerNotifications
This service logs the data for listener notifications. The data includes the name of a
listener to which a listener notification is linked, and the class name of the listener. The
service also checks whether the listener notification is registered with the listener or not.
Note: A listener can be used by multiple listener notifications, but a listener notification
will have only one listener node.
Input Parameters
None.
Output Parameters
None.
wm.art.dev.service:createAdapterServiceNode
This service creates a new adapter service node in the specified package and folder from
the specified service template and connection alias. You must populate the input pipeline
according to the table below before calling this service. To obtain a list of supported
adapter service template properties, call the service
wm.art.dev.service:fetchAdapterServiceTemplateMetadata.
The value of a property's systemName is the internal name of the property. When
constructing the input parameter adapterServiceSettings, you must use this internal name
as the key for setting a property's value. For example, if a service template defines a
property named sqlCommand, then its systemName (as returned by
fetchAdapterServiceTemplateMetadata) would be sqlCommand.If the caller is a Java
application, it might then use this information to set this property's value as follows:
IData pipeline = IDataFactory.create();
IDataCursor pipeCursor = pipeline.getCursor();
.
.
.
IData svcSettings = IDataFactory.create();
IDataCursor svcCursor = svcSettings.getCursor();
svcCursor.insertAfter("sqlCommand", "SELECT * FROM fooTable");
.
.
.
pipeCursor.insertAfter("adapterServiceSettings", svcSettings);
.
.
.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 231
C Using the Services for Managing Namespace Nodes
This example assumes that the property sqlCommand takes a java.lang.String value.
Use the service's parameters inputFieldNames, inputFieldTypes, outputFieldNames,and
outputFieldTypes to define the properties that comprise the adapter service's input and
output signatures. The data types of these properties are arrays of java.lang.String. There
is a one-to-one correspondence between the elements in the *FieldNames and *FieldTypes
arrays. For example, if the property names abc, xyz, and foo are inserted into the
outputFieldNamesparameter, then the service expects that exactly three data types will be
inserted into outputFieldTypes, and that those data types correspond to the same element
in outputFieldNames.
Adapter service properties may or may not have default values, depending on the
specific adapter's implementation. (In fact, depending on the underlying data type of the
property, it might not be possible to assign it a default value.) You may use these default
values or override them with values that conform to the underlying data types of the
properties. You must explicitly set all required properties in the input parameter
adapterServiceSettings. A required property is one whose metadata attribute isRequiredis
set to true. (The isRequired attribute is contained in fetchAdapterServiceTemplateMetadata.) The
absence of the isRequiredattribute implies that the property is not required. If you fail to
set a required property, the service throws an exception. In addition, be aware of any
properties that may become required based on the current value of some other property.
This service will not try to locate and assign defaults for properties that you have
omitted.
Be aware of any resource domains registered by the adapter service template, and set the
service's properties according to the interdependencies between resource domains. This
includes input and output signatures since they are supported via resource domains.
This service provides the properties inputFieldNames, inputFieldTypes,
outputFieldNames,and outputFieldTypesfor this purpose. Knowledge of these
interdependencies is notification-specific, and beyond the scope of this service. This
service does not interpret resource domains.
Input Parameters
232 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
.inputFieldTypes String[]. The data types of the fields used in the adapter's
input signature; see note 1.
.outputFieldNames String[]. The names of the fields used in the adapter's output
signature.
.outputFieldTypes String[]. The data types of the fields used in the adapter's
output signature; see note 1.
Notes
1 The following Java data types are supported for adapter services: char, short, int,
long, float, double, boolean, java.lang.String, java.lang.Character, java.lang.Short,
java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, java.lang.Boolean.
Arrays of all the above data types are also supported.
2 The implementation of the adapter determines whether a particular property is
required. To determine whether a property is required, call the service
wm.art.dev.service:fetchAdapterServiceTemplateMetadata and check whether its isRequired
attribute is set to true. If you do not provide a value for a required property,
createAdapterServiceNode throws an exception.
3 The number of properties to be configured is adapter-dependent. At a minimum, set
those properties whose isRequired attribute is set to true.
Output Parameters
None.
wm.art.dev.connection:createConnectionNode
This service creates a new connection node in the specified package and folder. The
service initializes the connection in a disabled state. You must populate the input pipeline
according to the table below prior to calling this service. To obtain a list of supported
connection manager properties and connection-specific properties, call the services
wm.art.dev.connection:fetchConnectionManagerMetadata and
wm.art.dev.connection:fetchConnectionMetadata.
The value of a property's systemName is the internal name of the property. When
constructing the input parameters connectionManagerSettingsand connectionSettings, use
this internal name as the key for setting a property's value. For example, if a connection
defines a property named hostPort, then its systemName (as returned by
fetchConnectionMetada) would be hostPort. If the caller is a Java application, it might then
use this information to set this property's value as follows:
IData pipeline = IDataFactory.create();
IDataCursor pipeCursor = pipeline.getCursor();
.
.
.
IData connSettings = IDataFactory.create();
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 233
C Using the Services for Managing Namespace Nodes
This example assumes that the property hostPort takes a java.lang.Integer value. The
system names of connection manager properties are predefined. See the output
specification of wm.art.dev.connection:fetchConnectionManagerMetadata for their definitions.
All connection manager properties have default values, in the defaultValuemetadata
attribute for each property in the connectionManagerPropertiesstructure returned by
fetchConnectionManagerMetadata. You may use these default values or override them with
values that conform to the underlying data types of the properties. This service will not
automatically set property values to their default values; you must explicitly set all
required properties in the input parameter connectionManagerSettings.A required
property is one whose metadata attribute isRequiredis set to true. (The isRequired attribute
is contained in fetchConnectionManagerMetada.) The absence of the isRequiredattribute implies
that the property is not required. If you fail to set a required property, the service throws
an exception. In addition, be aware of any properties that may become required based on
the current value of some other property. This service will not try to locate and assign
defaults for properties that you have omitted. In particular, the connection manager
property poolable is always required. The remaining connection manager properties have
a special dependence on the value of poolable. Specifically, if you set poolable to true, then
the remaining connection manager properties must be assigned values as well. If poolable
is false however, may omit the remaining connection manager properties.
Connection-specific properties may or may not have default values, depending on the
specific adapter's implementation. (In fact, depending on the underlying data type of the
property, it might not be possible to assign it a default value.) You may use these default
values or override them with values that conform to the underlying data types of the
properties. This service will not automatically set property values to their default values;
you must explicitly set all required properties in the input parameter connectionSettings.
A required property is one whose metadata attribute isRequiredis set to true. (The
isRequired attribute is contained in fetchConnectionMetada.) The absence of the
isRequiredattribute implies that the property is not required. If you fail to set a required
property, the service throws an exception. In addition, be aware of any properties that
may become required based on the current value of some other property. This service will
not try to locate and assign defaults for properties that you have omitted.
Be aware of any resource domains registered by the connection factory, and set the new
connection's properties according to the interdependencies between resource domains.
Knowledge of these interdependencies is notification-specific, and beyond the scope of
this service. This service does not interpret resource domains.
234 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
Input Parameters
Notes
1 Unlike connection manager properties, which are predefined for all connections,
actual connection properties (and their underlying data types) vary from adapter to
adapter. You must set a connection property's value in accordance with its data type.
To determine the value, call the service wm.art.dev.connection:fetchConnectionMetadata and
note the parameterType attribute for that property.
2 The implementation of the adapter determines whether a particular property is
required. To determine whether a property is required, call the service
wm.art.dev.connection:fetchConnectionMetadata and check whether its isRequired attribute is
set to true. If you do not provide a value for a required property, createConnectionNode
throws an exception.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 235
C Using the Services for Managing Namespace Nodes
None.
wm.art.dev.listener:createListenerNode
This service creates a new instance of a listener in the specified package and folder from
the specified listener template and connection alias. You must populate the input pipeline
according to the table below before calling this service. To obtain a list of supported
listener template properties, call wm.art.dev.listener:fetchListenerTemplateMetadata.
The value of a property's systemName attribute is the internal name of the property. When
constructing the input parameter listenerSettings, use this internal name as the key for
setting a property's value. For example, if a listener template defines a property called
portNumber, then its systemName (as returned by fetchListenerTemplateMetadata) would be
portNumber.If the caller is a Java application, it might then use this information to set
this property's value as follows:
IData pipeline = IDataFactory.create();
IDataCursor pipeCursor = pipeline.getCursor();
.
.
.
IData lstnrSettings = IDataFactory.create();
IDataCursor lstnrCursor = lstnrSettings.getCursor();
lstnrCursor.insertAfter("portNumber", new Integer((int)8888));
.
.
.
pipeCursor.insertAfter("listenerSettings", lstnrSettings);
.
.
.
This example assumes that the property portNumber takes a java.lang.Integer value.
Listener properties may or may not have default values, depending on the specific
listener's implementation. You may use these default values or override them with values
that conform to the underlying data types of the properties. You must explicitly set all
required properties in the input parameter listenerSettings. A required property is one
whose metadata attribute isRequiredis set to true. (The isRequired attribute is contained in
fetchListenerTemplateMetadata.) The absence of the isRequiredattribute implies that the
property is not required. If you fail to set a required property, the service throws an
exception. In addition, be aware of any properties that may become required based on the
current value of some other property. This service will not try to locate and assign
defaults for properties that you have omitted.
236 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
The service initializes the new listener in a disabled state. After calling createListenerNode,
you should subsequently call the service to activate it. For more information, see the
Integration Server built-in services reference guide. See “About this Guide” for specific
document titles.
You should also consider any resource domains registered by the listener template, and
should set the new listener's properties according to the interdependencies between
resource domains. Knowledge of these interdependencies is listener-specific, and is
beyond the scope of this service. This service does not interpret resource domains.
Input Parameters
Notes
1 The following Java data types are supported for listeners: char, short, int, long, float,
double, boolean, java.lang.String, java.lang.Character, java.lang.Short,
java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, java.lang.Boolean.
There is currently no support for arrays.
2 The implementation of the listener determines whether a particular property is
required. To determine whether a property is required, call the service
wm.art.dev.listener:fetchListenerTemplateMetadata and check whether its isRequired attribute
is set to true. If you do not provide a value for a required property, createListenerNode
throws an exception.
3 The number of properties to be configured is also listener-dependent. At a minimum,
set those properties whose isRequired attribute is set to true.
Output Parameters
None.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 237
C Using the Services for Managing Namespace Nodes
wm.art.dev.notification:createListenerNotificationNode
This service creates a new instance of a synchronous or asynchronous listener notification
in the specified package and folder from the specified notification template and
connection alias. You must populate the input pipeline according to the table below
before calling this service. To obtain a list of supported listener notification template and
schedule properties, call the service
wm.art.dev.notification:fetchListenerNotificationTemplateMetadata.
The value of a property's systemName attribute is the internal name of the property. When
constructing the input parameter notificationSettings, use this internal name as the key for
setting a property's value. For example, if a notification template defines a property
named foo, then its systemName (as returned by fetchListenerNotificationTemplateMetadata)
would be foo. If a Java application calls the service, it might use this information to set
this property's value as follows:
IData pipeline = IDataFactory.create();
IDataCursor pipeCursor = pipeline.getCursor();
.
.
.
IData ntfySettings = IDataFactory.create();
IDataCursor ntfyCursor = ntfySettings.getCursor();
ntfyCursor.insertAfter("foo", "bar");
.
.
.
pipeCursor.insertAfter("notificationSettings",
ntfySettings);
.
.
.
This example assumes that the property foo takes a java.lang.String value.
Listener notification properties may or may not have default values, depending on the
specific notification's implementation. You may use these default values or override them
with values that conform to the underlying data types of the properties. You must
explicitly set all required properties in the input parameter notificationSettings. A required
property is one whose metadata attribute isRequiredis set to true. (The isRequired attribute
is contained in fetchListenerNotificationTemplateMetadata.)The absence of the
isRequiredattribute implies that the property is not required. If you fail to set a required
property, the service throws an exception. In addition, be aware of any properties that
may become required based on the current value of some other property. This service will
not try to locate and assign defaults for properties that you have omitted.
The particular combination of input parameters you specify determines whether you
create a synchronous or an asynchronous listener notification. The table below identifies
which parameters are synchronous- or asynchronous-only. This service throws an
exception if you specify invalid or ambiguous combinations of input parameters.
238 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
Input Parameters
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 239
C Using the Services for Managing Namespace Nodes
Notes
1 Synchronous listener notification classes should extend the
WmSyncListenerNotification class. Asynchronous listener notifications should
extend the WmAsyncListenerNotification class.
2 The following Java data types are supported for listener notifications: char, short, int,
long, float, double, boolean, java.lang.String, java.lang.Character, java.lang.Short,
java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, java.lang.Boolean.
Arrays of all the above data types are also supported.
3 The implementation of the notification determines whether a particular property is
required. To determine whether a property is required, call the service
wm.art.dev.notification:fetchListenerNotificationTemplateMetadata and check whether its
isRequired attribute is set to true. If you do not provide a value for a required property,
createListenerNotificationNode throws an exception.
4 The number of properties to be configured is notification-dependent. At a minimum,
set those properties whose isRequired attribute is set to true.
Output Parameters
None.
240 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
wm.art.dev.notification:createPollingNotificationNode
This service creates a new instance of a polling notification in the specified package and
folder from the specified notification template and connection alias. You must populate
the input pipeline according to the table below before calling this service. To obtain a list
of supported template and schedule properties, call the service
wm.art.dev.notification:fetchPollingNotificationTemplateMetadata.
The value of a property's systemName attribute is the internal name of the property. When
constructing the notificationSettingsinput parameter, use this internal name as the key for
setting a property's value. For example, if a notification template defines a property
named sqlCommand, then its systemName (as returned by
fetchPollingNotificationTemplateMetadata) would be sqlCommand. If a Java application
calls the service, it might then use this information to set this property's value as follows:
IData pipeline = IDataFactory.create();
IDataCursor pipeCursor = pipeline.getCursor();
.
.
.
IData ntfySettings = IDataFactory.create();
IDataCursor ntfyCursor = ntfySettings.getCursor();
ntfyCursor.insertAfter("sqlCommand", "SELECT * FROM fooTable");
.
.
.
pipeCursor.insertAfter("notificationSettings", ntfySettings);
.
.
.
This example assumes that the property sqlCommand takes a java.lang.String value.
Polling notification properties may or may not have default values, depending on the
specific notification's implementation. You may use these default values or override them
with values that conform to the underlying data types of the properties. You must
explicitly set all required properties in the input parameter notificationSettings. A required
property is one whose metadata attribute isRequiredis set to true. (The isRequired attribute
is contained in fetchPollingNotificationTemplateMetadata.)The absence of the
isRequiredattribute implies that the property is not required. If you fail to set a required
property, the service throws an exception. In addition, be aware of any properties that
may become required based on the current value of some other property. This service will
not try to locate and assign defaults for properties that you have omitted.
By default, this service creates a publishable document node in a folder named
notificationNamePublishDocument, where notificationName is the value you specify for the
input parameter notificationName.This name is not configurable.
You specify the format (the names and types of the fields) of the publishable document by
populating the publishableRecordDefparameter with the names and types of any
notification fields that may appear in the document generated by the notification. You
construct this parameter in the same manner you construct notificationSettings(as
described above). The difference is that the fieldNamesand fieldTypesproperties of
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 241
C Using the Services for Managing Namespace Nodes
Input Parameters
242 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
Notes
1 The following Java data types are supported for polling notifications: char, short, int,
long, float, double, boolean, java.lang.String, java.lang.Character, java.lang.Short,
java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, java.lang.Boolean.
Arrays of all the above data types are also supported.
2 The implementation of the notification determines whether a particular property is
required. To determine whether a property is required, call the service
wm.art.dev.notification:fetchPollingNotificationTemplateMetadata and check whether its
isRequired attribute is set to true. If you do not provide a value for a required property,
createPollingNotificationNode throws an exception.
3 The number of properties to be configured is notification-dependent. At a minimum,
set those properties whose isRequired attribute is set to true.
Output Parameters
None.
wm.art.dev.service:deleteAdapterServiceNode
This service removes a specified adapter service node. This action is immediate and non-
reversible, and returns no output data. You may assume that the service completed
successfully if it does not throw a checked exception.
Input Parameters
Output Parameters
None.
wm.art.dev.connection:deleteConnectionNode
This service removes the specified connection node. You must disable the connection
before you delete it, using the disableConnection service. (For more information, see the
Integration Server built-in services reference guide for your release. See “About this
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 243
C Using the Services for Managing Namespace Nodes
Guide” for specific document titles.) This action is immediate and non-reversible, and
returns no output data. You may assume that the service completed successfully if it does
not throw a checked exception.
Input Parameters
Output Parameters
None.
wm.art.dev.listener:deleteListenerNode
This service removes a specified instance of a listener. You must disable the listener
before deleting it, using the disableListener service. For more information, see the
Integration Server built-in services reference guide for your release. See “About this
Guide” for specific document titles.
This action is immediate and non-reversible, and returns no output data. You may
assume that the service completed successfully if it does not throw a checked exception.
Input Parameters
Output Parameters
None.
wm.art.dev.notification:deleteListenerNotificationNode
This service removes a specified instance of listener notification. You must disable the
notification before deleting it, using the disableListenerNotification service. For more
information, see the Integration Server built-in services reference guide for your release.
See “About this Guide” for specific document titles.
This action is immediate and non-reversible, and returns no output data. Use the
cascadeDeleteflag to propagate the deletion across the Broker. You may assume that the
service completed successfully if it does not throw a checked exception.
Input Parameters
244 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
Output Parameters
None.
wm.art.dev.notification:deletePollingNotificationNode
This service removes an instance of a specified polling notification. You must disable the
notification before deleting it, using the disablePollingNotificationNode service. For
more information, see the Integration Server built-in services reference guide for your
release. See “About this Guide” for specific document titles.
This action is immediate and non-reversible, and returns no output data. Use the
cascadeDelete flag to propagate the deletion across Broker. You may assume that the
service completed successfully if it does not throw a checked exception.
Input Parameters
Output Parameters
None.
wm.art.dev.service:fetchAdapterServiceTemplateMetadata
Given a specified connection alias and adapter service template class path, this service
returns all metadata for an adapter service template.
The service returns a templatePropertiesarray containing all metadata associated with each
of the adapter service template properties. Of particular interest are the systemName,
parameterType, defaultValue,and isRequiredattributes, which you can use to configure a new
adapter service node.
Input Parameters
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 245
C Using the Services for Managing Namespace Nodes
Output Parameters
246 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
Notes
1 The following Java data types are supported for adapter services: char, short, int,
long, float, double, boolean, java.lang.String, java.lang.Character, java.lang.Short,
java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, java.lang.Boolean.
Arrays of all the above data types are also supported.
wm.art.dev.connection:fetchConnectionManagerMetadata
This service returns the connection manager metadata properties that are predefined for
all connections, such as poolable, minimumPoolSize, maximumPoolSize, and others. (These
are the properties of connectionManagerSettings.) No inputs are required to run this
service.
The service returns a connectionManagerProperties array containing all metadata
associated with each of the connection manager properties. Of particular interest are the
systemName, parameterType, defaultValue, and isRequiredattributes, which you can use to
configure a connection node.
Input Parameters
None.
Output Parameters
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 247
C Using the Services for Managing Namespace Nodes
Notes
1 The following Java data types are supported for connections: char, short, int, long,
float, double, boolean, java.lang.String, java.lang.Character, java.lang.Short,
java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, java.lang.Boolean.
Arrays are not currently supported.
wm.art.dev.connection:fetchConnectionMetadata
Given an adapter type name and a fully qualified connection factory class path, this
service queries the connection factory and returns the metadata for all properties
supported by connections of that type.
For example, a Java client might invoke this service as follows:
IData pipeline = IDataFactory.create();
IDataCursor pipeCursor = pipeline.getCursor();
pipeCursor.insertAfter("adapterTypeName",
"FooAdapter");
pipeCursor.insertAfter("connectionFactoryType",
"com.wm.adapters.FooConnFactory");
ExtendedConnectionUtils.fetchConnectionMetadata(pipeline);
.
.
.
248 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
Input Parameters
Output Parameters
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 249
C Using the Services for Managing Namespace Nodes
Notes
1 The following Java data types are supported for connections: char, short, int, long,
float, double, boolean, java.lang.String, java.lang.Character, java.lang.Short,
java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, java.lang.Boolean.
Arrays are not currently supported.
wm.art.dev.listener:fetchListenerTemplateMetadata
Given a valid connection alias and listener template class path, this service returns all
metadata supported by that listener template.
The service returns a templatePropertiesarray containing all metadata associated with each
of the listener template properties. Of particular interest are the systemName,
parameterType, defaultValue,and isRequiredattributes, which you can use to configure a new
listener instance.
Input Parameters
Output Parameters
250 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 251
C Using the Services for Managing Namespace Nodes
Notes
1 The following Java data types are supported for listeners: char, short, int, long, float,
double, boolean, java.lang.String, java.lang.Character, java.lang.Short,
java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, java.lang.Boolean.
Arrays of the above data types are not supported.
wm.art.dev.notification:fetchListenerNotificationTemplateMet
adata
Given a valid listener node name and listener notification template class path, this service
returns all metadata for that listener notification template.
This service returns a templatePropertiesarray containing all metadata associated with each
notification template property. Of particular interest are the systemName, parameterType,
defaultValue,and isRequiredattributes, which you can use to configure a new listener
notification instance.
Input Parameters
Output Parameters
252 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 253
C Using the Services for Managing Namespace Nodes
Notes
1 The following Java data types are supported for listener notifications: char, short, int,
long, float, double, boolean, java.lang.String, java.lang.Character, java.lang.Short,
java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, java.lang.Boolean.
Arrays of all the above data types are also supported.
wm.art.dev.notification:fetchPollingNotificationTemplateMeta
data
Given a valid connection alias and polling notification template class path, this service
returns all metadata for that polling notification template. It also returns any scheduling
properties that are set for the notification.
This service returns a templatePropertiesarray containing all metadata associated with each
notification template property. The schedulePropertiesarray contains the names of the
properties used to configure a notification's schedule. Of particular interest are the
systemName, parameterType, defaultValue,and isRequiredattributes, which you can use to
configure a new polling notification instance.
Input Parameters
Output Parameters
254 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 255
C Using the Services for Managing Namespace Nodes
Notes
1 The following Java data types are supported for polling notifications: char, short, int,
long, float, double, boolean, java.lang.String, java.lang.Character, java.lang.Short,
java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, java.lang.Boolean.
Arrays of all the above data types are also supported.
wm.art.dev.service:updateAdapterServiceNode
This service alters the values of an existing adapter service. You must populate the input
pipeline according to the table below before calling this service. To obtain a list of
supported template and schedule properties, call the service
wm.art.dev.service:fetchAdapterServiceTemplateMetadata.
The value of the systemNamemetadata attribute is the internal name of a property. When
constructing the input parameter adapterServiceSettings, use this internal name as the key
for setting a property's value. For an example of setting an adapter service property, see
the Java code example in wm.art.dev.service:createAdapterServiceNode.
You only need to supply values for the properties you want to change. This service
attempts to overlay these new values on the adapter service's current property values.
The resulting set of merged property values are used to reconfigure the adapter service.
You can change the connection resource that the adapter service uses by providing a new
connectionAliasinput parameter. If you omit this parameter, the adapter service will
continue to use its current connection resource. If you are changing only the connection
resource, it is not necessary to provide the adapterServiceSettingsinput parameter.
When providing explicit property values in adapterServiceSettings, you must provide
values that conform to the underlying data types of those properties.
Be aware of any resource domains registered by the adapter service, and set the service's
properties according to the interdependencies between resource domains. This includes
input and output signatures since they are supported via resource domains. The
properties inputFieldNames, inputFieldTypes, outputFieldNames, and outputFieldTypesare
provided for this purpose. Knowledge of these interdependencies is adapter-specific, and
beyond the scope of this service. This service does not interpret resource domains.
Input Parameters
256 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
Notes
1 The following Java data types are supported for adapter services: char, short, int,
long, float, double, boolean, java.lang.String, java.lang.Character, java.lang.Short,
java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, java.lang.Boolean.
Arrays of all the above data types are also supported.
2 Set only those properties that you want to change. If a property's data type is non-
primitive (that is, derived from java.lang.Object), you may clear a property's current
value by setting it to null. There is no way to do this for Java primitives; they may
only be redefined.
Output Parameters
None.
wm.art.dev.connection:updateConnectionNode
This service alters the values of an existing connection. You must disable the connection
before attempting this operation, using the disableConnection service. For more
information, see the Integration Server built-in services reference guide for your release.
See “About this Guide” for specific document titles.
You must populate the input pipeline according to the table below before calling this
service. To obtain a list of supported template and schedule properties, call the services
wm.art.dev.connection:fetchConnectionMetadata and
wm.art.dev.connection:fetchConnectionManagerMetadata.
The value of the systemNamemetadata attribute is the internal name of a property. When
constructing the input parameters connectionManagerSettingsand connectionSettings, use
this internal name as the key for setting a property's value. For an example of setting a
connection property, see the Java code example in wm.art.dev.connection:createConnectionNode.
The system names of connection manager properties are predefined. See the output
specification of wm.art.dev.connection:fetchConnectionManagerMetadata for their definitions.
You only need to supply values for the properties you want to change. This service
attempts to overlay these new values on the connection's current property values. The
resulting set of merged property values are used to reconfigure the connection. If you are
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 257
C Using the Services for Managing Namespace Nodes
Notes
1 Unlike connection manager properties, which are predefined for all connections,
actual connection properties (and their underlying data types) vary from adapter to
adapter. You should set a connection property's value in accordance with its data
type. To determine the value, call the service wm.art.dev.connection:fetchConnectionMetadata
and note the parameterType attribute for that property.
2 Set only those properties that you want to change. If a property's data type is non-
primitive (that is, derived from java.lang.Object) you may "undefined" its current
value by setting it to null. There is no way to do this for Java primitives; they may
only be redefined.
258 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
Output Parameters
None.
wm.art.dev.listener:updateListenerNode
This service alters the values of an existing listener. You must populate the input pipeline
according to the table below before calling this service. To obtain a list of supported
template and schedule properties, call the service
wm.art.dev.listener:fetchListenerTemplateMetadata. You must disable a listener before updating
its properties, using the disableListener service. For more information, see the Integration
Server built-in services reference guide for your release. See “About this Guide” for
specific document titles.
The value of the systemNamemetadata attribute is the internal name of a property. When
constructing the input parameter listenerSettings, use this internal name as the key for
setting a property's value. For an example of setting a connection property, see the Java
code example in wm.art.dev.listener:createListenerNode.
You only need to supply values for the properties you want to change. This service will
attempt to overlay these new values on the listener's current property values. The
resulting set of merged property values will be used to reconfigure the listener.
You can change the connection resource that the listener uses by providing a new
connectionAliasinput parameter. If you omit this parameter, the listener will continue to
use its current connection resource. If you are changing only the connection resource, it is
not necessary to provide the listenerSettingsinput parameter.
When providing explicit property values in listenerSettings, you must provide values that
conform to the underlying data types of those properties.
Be aware of any resource domains registered by the listener, and set the listener's
properties according to the interdependencies between resource domains. Knowledge of
these interdependencies is adapter-specific, and beyond the scope of this service. This
service does not interpret resource domains.
Input Parameters
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 259
C Using the Services for Managing Namespace Nodes
Notes
1 The following Java data types are supported for adapter services: char, short, int,
long, float, double, boolean, java.lang.String, java.lang.Character, java.lang.Short,
java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, java.lang.Boolean.
Arrays are not supported.
2 Set only those properties that you want to change. If a property's data type is non-
primitive (that is, derived from java.lang.Object) you may "undefined" its current
value by setting it to null. There is no way to do this for Java primitives; they may
only be redefined.
Output Parameters
None.
wm.art.dev.notification:updateListenerNotificationNode
This service alters the values of an existing synchronous or asynchronous listener
notification. You must populate the input pipeline according to the table below before
calling this service. To obtain a list of supported template and schedule properties, call
the service wm.art.dev.notification:fetchListenerNotificationTemplateMetadata.You must disable a
listener notification before updating its properties, using the disableListenerNotification
service. For more information, see the Integration Server built-in services reference guide
for your release. See “About this Guide” for specific document titles.
You should be familiar with the differences between synchronous and asynchronous
listener notifications, as described in wm.art.dev.notification:createListenerNotificationNode.
Once you configure a synchronous notification, you cannot convert it to an asynchronous
one. Nor can you convert an asynchronous notification to a synchronous one.
In the table below, two input parameters apply to both synchronous and asynchronous
listener notifications: listenerNodeand notificationSettings.For each of these parameters, the
service attempts to overlay the given values onto the notification's current values. The
resulting set of merged property values are used to reconfigure the notification.
For instance, you can change the listener resource used by the notification by providing a
new listenerNodeinput parameter. If you omit this parameter, the notification continues to
use its current listener. If you are changing only the listener resource, it is not necessary to
provide the notificationSettings or any other input parameters.
For an example of setting values within the pipeline, see
wm.art.dev.notification:createListenerNotificationNode. In particular, note that when constructing
the notificationSettingsparameter, the value of the systemName metadata attribute is an
adapter-specific internal name of a property. You should substitute the actual internal
system property name for the systemNameplaceholder. (You can fetch the name using
wm.art.dev.notification:fetchListenerNotificationTemplateMetadata.)
260 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
For synchronous notifications there are three additional input parameters that may be
provided: serviceName, requestRecordDef,and replyRecordDef.The first one specifies the
node name of a separate service to be invoked by the notification at run time. If you omit
this parameter, the notifications still retains the current value of the parameter. The latter
two parameters view document record definitions that the notification uses to format
messages when communicating with this service. You can modify these definitions by
providing requestRecordDefor replyRecordDef (or both). You populate these parameters in
the same manner that you populate notificationSettings(as described above). The
difference is that the fieldNamesand fieldTypesproperties each view an array of String.
There is a one-to-one correspondence between the elements in these two arrays.The
values assigned to these properties should correspond to fields that the notification class
and the invoked service will actually use when communicating with each other. Note that
this service has no way to verify this assertion. If you mis-configure either record
definition, the consequence may not be manifested until run time.
You can use the input parameter publishableRecordDef to redefine the structure of an
asynchronous notification's output document. You configure this parameter in the same
way that you configure requestRecordDefand replyRecordDef for synchronous notifications.
The same caveats apply as well: you are responsible for knowing how to define this
document such that it conforms to the notification's expectations.
Unlike notificationSettings, listenerNode,and serviceName,the parameters requestRecordDef,
replyRecordDef,and publishableRecordDefare used to replace their existing counterparts in
their entirety. The service does not attempt to merge the values in these parameters with
the notification's current values. For instance, if you want to redefine a synchronous
notification's reply record definition, you must define the entire record in the
replyRecordDefinput parameter.
When specifying property valuesyou must provide values that conform to the
underlying data types of those properties.
Be aware of any resource domains registered by the notification, and set the notification's
properties according to the interdependencies between resource domains. Knowledge of
these interdependencies is adapter-specific, and beyond the scope of this service. This
service does not interpret resource domains.
Input Parameters
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 261
C Using the Services for Managing Namespace Nodes
Notes
1 The following Java data types are supported for adapter services: char, short, int,
long, float, double, boolean, java.lang.String, java.lang.Character, java.lang.Short,
java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, java.lang.Boolean.
Arrays of all the above data types are also supported.
2 Set only those properties that you want to change. If a property's data type is non-
primitive (that is, derived from java.lang.Object) you may clear a property's current
value by setting it to null. There is no way to do this for Java primitives; they may
only be redefined.
3 Values inserted into fieldNames must correspond in number and order to the values
inserted into fieldTypes. Additionally, you must provide values defining the entire
document; the service does not attempt to merge these values into the current
document definition.
Output Parameters
None.
wm.art.dev.notification:updatePollingNotificationNode
This service alters the characteristics of an existing polling notification. You must
populate the input pipeline according to the table below before calling this service. To
obtain a list of supported template and schedule properties, call the service
262 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 263
C Using the Services for Managing Namespace Nodes
Input Parameters
Notes
1 The following Java data types are supported for adapter services: char, short, int,
long, float, double, boolean, java.lang.String, java.lang.Character, java.lang.Short,
java.lang.Integer, java.lang.Long, java.lang.Float, java.lang.Double, java.lang.Boolean.
Arrays of all the above data types are also supported.
2 Set only those properties that you want to change. If a property's data type is non-
primitive (that is, derived from java.lang.Object) you may "undefined" its current
value by setting it to null. There is no way to do this for Java primitives; they may
only be redefined.
3 Values inserted into fieldNames must correspond in number and order to the values
inserted into fieldTypes. Additionally, you must provide values defining the entire
document; the service does not attempt to merge these values into the current
publishable record definition.
Output Parameters
None.
264 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
C Using the Services for Managing Namespace Nodes
wm.art.dev.listener:updateRegisteredNotifications
This service checks listener notifications, finds the linked listener, and then checks
whether the listener notification is also registered for the same listener or not. If not, then
the service registers the listener notification with the linked listener.
Note: A listener can be used by multiple listener notifications, but a listener notification
will have only one listener node. In an ideal case, if a listener notification is linked with a
listener, then the listener user interface must show the entry of the listener notification.
Input Parameters
Output Parameters
None.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 265
C Using the Services for Managing Namespace Nodes
266 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
The Sample Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Banking Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Banking Event Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Banking Alerts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Prerequisites for Code Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Phase 1: Creating an Adapter Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Phase 2: Adding a Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
Phase 3: Adding Adapter Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Phase 4: Adding Polling Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
Phase 5: Adding Listener Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 267
D Using the Sample Adapter
Overview
The ADK provides an example adapter package named WmSampleAdapter. You can use
this adapter as a model for developing your own adapters. This adapter enables you to
exchange data with a simulated back-end resource provided with the ADK, named
Sample Server. You will configure this adapter to perform a banking application. All of
the underlying Sample Adapter class files are located in the
Integration Server_directory\packages\WmSampleAdapter directory. This appendix
describes how the Sample Adapter was developed, and how you can configure and run
it. The adapter is provided in five phases. Each phase is a standalone adapter, delivered
in its own source files; you can build, configure, and run each phase separately. Each
phase includes new functionality such that the first phase consists of just the basic
framework of the adapter, and the final phase is the fully functional adapter. These
phases are as follows:
Phase 1: Creating the adapter definition.
An adapter definition is recognized as an adapter by webMethods Integration Server,
but it lacks functionality. In the next four phases of development, the adapter includes
new functionality including an adapter connection, an adapter service template, a
polling notification template, and a listener notification template.
Phase 2: Adding a connection that connects clients to the Sample Server.
Phase 3: Adding adapter services.
You will create adapter services that perform operations such as depositing, clearing,
and bouncing checks, withdrawing and transferring funds, and other operations, as
described in “Banking Functions” on page 270.
Phase 4: Adding polling notifications.
You will configure polling notification nodes that query the Sample Server and
publish documents when the following events occur:
Using the Clear Check service or the Bounce Check service clears (approves) or
bounces (disapproves) a deposited check.
Using the Withdraw service or the Transfer service causes a negative account
balance.
Phase 5: Adding listener notifications.
This phase represents the adapter with all its functionality. You will configure a
listener to monitor the Sample Server for "alerts" generated by the Sample Server. An
alert is a Sample Server mechanism that informs the adapter that an event has
occurred. You will configure the listener notification nodes to publish notification
documents when the Sample Server generates the following alerts:
The Deposit service successfully deposits a check. (You can then invoke the Clear
Check service or the Bounce Check service to approve or disapprove the check.)
The Withdraw service or the Transfer service causes a negative account balance.
268 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
Transaction Control
You can configure the client connection for either no transaction control (auto commit
mode) or local transaction control across multiple service invocations. The
SampleAdapter allows the adapter user to select the transaction type for each
WmSampleConnection node.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 269
D Using the Sample Adapter
Banking Functions
The Sample Server provides the following banking functions. You use the adapter service
template to create adapter service nodes that use these functions:
Function Description
Deposit Creates multiple cash and check deposits. When the check
number is equal to or less than 0, the deposit is considered to be
a cash deposit.
Bounce Check Bounces (disapproves) a check deposit.
Clear Check Clears (approves) a check deposit.
Get Balance Retrieves the current balance of the specified account.
Get History Retrieves the service history of the specified account.
Transfer Transfers funds between two accounts. The user ID and Personal
Identification Number (PIN) are authenticated against both
accounts.
Withdraw Withdraws funds from the specified account. A negative
amount cannot be withdrawn.
270 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
UnderBalance
This event query requests a list of accounts that have been overdrawn since the last
time the query was made. These events occur as a result of Withdraw or Transfer
functions that result in a negative account balance. Note that the function request
must have succeeded if the function request was rejected because the debit would
exceed the account's credit limit. In this case, no UnderBalance event is recorded.
Because there is no protocol support for the Sample Server client to acknowledge the
polling message from the receiving side, a document will not be published with the same
message twice. For example, if a document reports that an account has fallen to -10, no
other document is published until the amount changes.
Banking Alerts
Banking alerts are generated when specified events occur on the Sample Server. Unlike
banking event queries, banking alerts are generated and delivered in real time to a
configured address. The Sample Adapter implements listeners to monitor these
addresses and to retrieve the alert data. Listener notifications are then used to distribute
the alert information to Integration Server services. There is no queueing mechanism for
alerts, so if no listener is ready to retrieve the alert data, it will be lost.
The Sample Server supports the following types of alerts:
CheckDepositNotification
This alert is generated for each check that is successfully deposited with the Deposit
function.
UnderBalanceNotification
This alert is identical to the UnderBalance banking event, but is delivered as an alert.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 271
D Using the Sample Adapter
Integration Server_directory\common\lib\glassfish\gf.javax.resource.jar
Integration Server_directory\packages\WmART\code\classes
where Integration Server_directory is the directory in which you installed
Integration Server.
Class Description
WmSampleAdapter Represents the main class of the adapter. In
the Sample Adapter package's main source
code directory, the adapter definition extends
the base class WmAdapter.
WmSampleAdapterConstants Contains all the string constants used by the
adapter. It includes such things as the major
code, group names, parameter names, bean
property names, and resource domain names.
WmSampleAdapterResourceBundle Contains all display strings and messages
used by the adapter at run time and at design
time.
admin Registers and un-registers the adapter when
the adapter package starts up and shuts
down.
272 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
Field Value
Package WmART
Version *.*
Click OK.
7 Click OK.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 273
D Using the Sample Adapter
Important! You must maintain the proper subdirectory structure when copying the
source code files.
6 Go to Integration Server Administrator > Package > Management and reload the
WmSampleAdapter1 package.
274 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
Property Description
sampleServerHostName The IP host name for the computer where the
Sample Server is running.
sampleServerPortNumber The TCP/IP port number that Sample Server is
accepting client connection. The default value is
4444.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 275
D Using the Sample Adapter
Class Revision
WmSampleAdapter Added a reference to
WmSampleConnectionFactory in the
fillAdapterTypeInfo method.
WmSampleAdapterConstants Added string constants for the connection
property names.
WmSampleAdapterResourceBundle Added entries for the connection property
configuration.
276 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
6 In the Package Dependencies section, click to add a row and specify values for the
following fields:
Field Value
Package WmART
Version *.*
Click OK.
7 Click to add an additional row and specify values for the following fields:
Field Value
Package WmSampleAdapter2
Version *.*
Click OK.
8 Click OK.
Field Description
Package Select the namespace node package
TestSampleAdapter2. This is the package in which
you will create the connection.
Folder Name Type the folder name connections. This is the
folder in which you will create the connection.
Connection Name Type the connection name sampleConnection.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 277
D Using the Sample Adapter
Field Description
Sample Server Host Name Type localhost.
Sample Server Port Number Accept the default value 4444.
Local Transaction Control? Select false.
Sample Connector Timeout Accept the default value 20000.
Field Description
Enable Connection Pooling Accept the default value true, which enables the
connection to use connection pooling.
Minimum Pool Size Accept the default value 1, which specifies the
number of connections to create when the
connection is enabled.
Maximum Pool Size Accept the default value 10, which specifies the
maximum number of connections that can exist
at one time in the connection pool.
Pool Increment Size Accept the default value 1, which specifies the
number of connections by which the pool will be
incremented if connections are needed, up to the
maximum pool size.
Block Timeout Specify the value 20000, which specifies the
number of milliseconds that the Integration
Server will wait to obtain a connection with the
Sample Server before it times out and returns an
error.
Expire Timeout Specify the value 20000, which specifies the
number of milliseconds that inactive connections
can remain in the pool before they are closed and
removed from the pool.
Startup Retry Count Accept the default value 0, which specifies the
number of times that the system should attempt
to initialize the connection pool at startup if the
initial attempt fails, before issuing an
AdapterConnectionException. The default value
0 means that the system makes a single attempt.
278 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
Field Description
Startup Backoff Timeout Accept the default value 10, which specifies the
number of seconds to wait between each attempt
to initialize the connection pool. This field is
irrelevant if the value of Startup Retry Count is set
to 0.
Note: If a connection node is enabled when the server shuts down, it will be enabled at
server startup.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 279
D Using the Sample Adapter
Property Description
functionName The service function name. For a list of the functions,
see “Banking Functions” on page 270.
inputParameterNames The fully qualified input parameter names, including
all the record structures and array indicators.
280 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
Property Description
inputFieldNames The fully qualified suggested input parameter
signature names, including all the record structures
and array indicators.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 281
D Using the Sample Adapter
Class Revision
WmSampleAdapterConstants Added string constants for the service
property names.
WmSampleAdapterResourceBundle Added entries for the service property
configuration.
WmSampleConnectionFactory Added a reference to FunctionInvocation in
the fillResourceAdapterMetadataInfo
method.
WmSampleConnection In the registerResourceDomain method, the
sample code now registers all resource
domains declared by the FunctionInvocation
service template.
In the adapterResourceDomainLookup
method, the sample code now includes
resource domain lookup code to request the
service metadata from the Sample Server
repository.
282 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
You can use the FunctionInvocation adapter service template to create adapter service
nodes that use any of the banking functions (Deposit, GetBalance, Withdraw, and so on).
At a minimum, configure nodes for Deposit and either Withdraw or Transfer. You will
need to execute these nodes later, when you test the notifications.
The following procedures describe how to configure and test the Deposit adapter service
node. To configure and test other nodes, repeat these procedures, substituting the
appropriate function name in each node.
Field Value
Package WmART
Version *.*
Click OK.
7 Click to add an additional row and specify values for the following fields:
Field Value
Package WmSampleAdapter3
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 283
D Using the Sample Adapter
Field Value
Version *.*
Click OK.
8 Click OK.
284 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
16 Accept all default values on the Settings tab. For more information, see the Designer
Service Development online help for your release. See “About this Guide” for specific
document titles.
17 Select File > Save.
Note: To create additional adapter service nodes, repeat this procedure, selecting the
appropriate function names, such as Withdraw or Transfer.
Field Value
User ID uid1
PIN pin1
5 Enter data in the fields of the Add Row pop-up menu that appears as follows, and
click OK.
Field Value
Deposit To Account 1
Deposit Amount 10
Check Number 0
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 285
D Using the Sample Adapter
286 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
Property Description
pollingName The event to poll in the Sample Server.
inputParameterNames The fully qualified input parameter names, including all
the record structures and array indicators.
inputFieldValues Unlike adapter services, polling notifications accept no
run-time input data, other than the configured property
values specified here.
inputFieldTypes The input parameter data types, including all the array
indicators.
outputParameterNames The fully qualified output parameter names, including all
the record structures and array indicators.
outputFieldNames The fully qualified suggested output parameter signature
names, including all the record structures and array
indicators. You cannot change these names.
outputFieldTypes The output parameter data types, including all the array
indicators.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 287
D Using the Sample Adapter
Class Revision
WmSampleAdapterConstants Added string constants for the polling
property names.
WmSampleAdapterResourceBundle Added entries for the polling property
configuration.
288 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
Class Revision
WmSampleConnection In the registerResourceDomain method, the
adapter code now registers all the resource
domains declared by the MessagePolling class.
In the adapterResourceDomainLookup
method, the adapter code now includes
resource domain lookup code to request the
polling metadata from Sample Server
repository.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 289
D Using the Sample Adapter
Field Value
Package WmART
Version *.*
Click OK.
7 Click to add an additional row and specify values for the following fields:
Field Value
Package WmSampleAdapter4
Version *.*
Click OK.
8 Click OK.
290 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
Field Value
User ID suid (the "super user" ID)
PIN spin (the "super user" PIN)
Account Number 0 (enables polling against all accounts)
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 291
D Using the Sample Adapter
6 On the Select the Source Type screen, select Empty Flow and click Finish.
7 Click to insert a flow step.
8 Navigate to the pub.flow:savePipelineToFile service in the WmPublic package and click
OK.
Note: The savePipelineToFile service saves the polling notification event (the contents
of the pipeline) to the file that you specify in the fileName parameter.
Click OK.
292 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
Note: The adapter code uses the savePipelineToFile service to save the polling
notification event to a file. A new polling notification event of the same type will
overwrite the contents of the corresponding log file.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 293
D Using the Sample Adapter
294 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
Property Description
eventName The event notification type name.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 295
D Using the Sample Adapter
Property Description
outputParameterNames The fully qualified output parameter names, including all
the record structures and array indicators.
outputFieldNames The fully qualified suggested output parameter signature
names, including all the record structures and array
indicators.
outputFieldTypes The output parameter data types, including all the array
indicators.
Class Revision
WmSampleAdapterConstants Added string constants for the polling property
names.
WmSampleAdapterResourceBundle Added entries for the polling property
configuration.
296 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
Class Revision
WmSampleConnection In the registerResourceDomain method, the
sample code now registers all the resource
domains declared by the MessagePolling
template.
In the adapterResourceDomainLookup
method, the sample code now includes
resource domain lookup code to request the
polling metadata from Sample Server
repository.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 297
D Using the Sample Adapter
Field Value
Package WmART
Version *.*
Click OK.
7 Click to add an additional row and specify values for the following fields:
Field Value
Package WmSampleAdapter
Version *.*
Click OK.
8 Click OK.
298 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
7 Complete the Configure Listener Type > Sample Adapter section as follows:
Parameter Description
Package Select the namespace node package TestSampleAdapter. This is
the package in which you will create the listener.
Folder Name Type the folder name listeners. This is the folder in which
you will create the listener.
Listener Name Type the listener name sampleListener.
Connection Select the connection node connections:listenerConnection.
Retry Limit Accept the default value 5, which specifies the number of
times that the system should attempt to start the listener if the
initial attempt fails. Specifically, it specifies how many times
to retry the listenerStartup method before issuing an
AdapterConnectionException. The value 0 means that the
system makes a single attempt.
Retry Backoff Accept the default value 10, which specifies the number of
Timeout seconds the system should wait between each attempt to start
the listener.
Note: Enabling the listener before you configure and enable its corresponding listener
notification node produces a warning.
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 299
D Using the Sample Adapter
Note: The savePipelineToFile service saves the polling notification event (the contents
of the pipeline) to the file that you specify in the fileName parameter.
Click OK.
300 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5
D Using the Sample Adapter
webMethods Adapter Development Kit Installation and User’s Guide Version 6.5 301
D Using the Sample Adapter
Field Value
User ID uid1
PIN pin1
Click OK.
e Specify values for the fields of the Add Row screen as follows.
Field Value
Deposit To Account 1
Deposit Amount 10
Check Number 1
Click OK.
The data you entered is displayed in the Results tab.
2 Search the checkDepositListener.log file in the Integration Server_directory\pipeline
directory for the check deposit notification message. (This is the file you specified as
the value of the fileName parameter in “Creating the Flow Service for the
checkDepositListener Notification Node” on page 300.)
Note: The adapter's code uses the savePipelineToFile service to save the notification event
to a file. A new notification event of the same type will overwrite the contents of the
corresponding log file.
302 webMethods Adapter Development Kit Installation and User’s Guide Version 6.5