Accessing Configuration Data at
Runtime
The Adapter Framework configuration Application Programming Interface is part of the Adapter Framework J2EE service. This service manages changes to configuration data in the Integration Directory by providing caching and distribution options. The API itself is implemented as a J2EE library that is deployed together with the Adapter Framework.
Interface Overview
Characteristic |
Value |
Name |
Adapter Framework configuration service |
Purpose |
Reads the configured data and subscribes to events in order to receive changed configuration data. |
Type |
J2EE service |
Technical name |
com.sap.aii.af.service.cpa |
Certification |
Mandatory |
Syntax |
See under path: JavaDoc (.\index.html) package com.sap.aii.af.service.cpa |

Uml_cpa.wmf contains the class diagram in UML format. Open Word and import uml_cpa.wmf as a graphic.
The UML class diagram shows the publicly available classes and interfaces as well as its methods and properties.
· LookupManager, InboundRuntimeLookup, and OutboundRuntimeLookup are the central classes for accessing all Adapter-Framework-related configuration objects such as parties, services, communication channels, and collaboration agreements (bindings).
· You use the NormalizationManager to map local addresses or parts of addresses to external addresses. See also: Converting Addresses Using Header Mapping and Normalization
· The ModuleSequence and ModuleConfig classes are used in the module processor and in the modules.
¡ ModuleSequencedescribes the module chain that a message must pass through for a particular communication channel.
¡ ModuleConfigcontains configuration data for a module in a specific communication channel.
· The other classes are service classes that describe basic configuration data such as the configuration data type or address parts. Configuration data types are classes ending with data. Address parts are classes ending with identifier.
· CallbackController allows registration of a class that implements the CallbackInterface. It is called when configuration data for a communication channel is changed.
You access the configuration data in the modules in the same way in the sender and receiver adapter.
· The module processor makes the configuration information available to the modules. By calling the process (moduleContext, inputModule data), the module receives the moduleContext object, which contains information about the configuration. It is not necessary to use the CPA LookupManager to get the data.
You access the data using the getContextData() method.

Open ConvertCRLFfromToLN.java and search for the character string CS_GETMODDAT.
· If you have to access configuration information in a module, you can use getChannelID(). The adapter also uses this method to get its data.

Open ConvertCRLFfromToLN.java and search for the character string CS_GETCHADAT.
· The CPA Application Programming Interface gives explicit permission to read the module configuration. To do this, use the CPA ModuleConfig and the ModuleConfig(java.lang.String channelId, java.lang.String moduleNamespace, Java.lang.Strin paramName)constructor.
Your adapter should contain the global attribute Adapter Status, with active and inactive as possible variations, in the sender direction and in the receiver direction. Define the following behavior:
· Active
The adapter must forward messages to the external protocol or to the module processor of the Adapter Framework.
· Inactive
The adapter must block all messages in the communication channel that is set to inactive.
