The module processor controls the message flow between the messaging service and the JCA adapter.
The processor calls all modules defined in the channel in the predefined sequence. The Adapter Framework contains some modules that must be contained in every module chain, for example, the CallSapAdapter module for sender channels.
For more information about the modules that are provided by SAP, see Modules.
A module is a session ejb that also implements the Adapter Framework module interface. An Adapter Framework module should be stateless, that is, not persist any data. In a file system or database, it is not possible to have a joint transaction with Adapter Framework message processing. Inconsistencies could occur in error situations.
The Adapter Framework contains the example module ConvertCRLFfromToLF.
More information: Example Module from Adapter Development
Interface Overview
Characteristic |
Value |
Name |
AF module interface |
Purpose |
Writes adapter-specific or general Adapter Framework modules. |
Type |
Library in the facade com.sap.aii.af.lib.facade |
Technical name |
com.sap.aii.af.lib.mp.module and com.sap.aii.af.lib.mp.processor |
Certification |
Optional |
Syntax |
Javadoc package com.sap.aii.af.mp.module |
In the message flow to the receiver the messaging service calls the module processor.
In the message flow from the sender it is called by the adapter (or an adapter Enterprise JavaBean).
● The main task of the module processor is to call the modules in the module chain in the sequence in which they are defined in the Integration Directory/PCK. The output of module n is the input for module n+1.
More information: Adding Modules in the Module Processor
● The module processor provides all modules with context information (for example, the current ID for the communication channel) or access to the configuration data of the module.
● The Adapter Framework modules must implement stateless message operations, for example, technical conversions.
● The Adapter Framework module Application Programming Interface consists of the following classes and interfaces:
Classes and Interfaces
Class or Interface |
Use |
ModuleProcessorFactory |
Factory for generating a module processor object |
ModuleProcessor |
Module processor instance for transferring a message from the adapter to the Adapter Framework in the sender channel |
ModuleProcessorException |
Exception of the Adapter Framework module processor |
Modules |
The module interface implemented by the module processor |
ModuleData |
The data container that transports the message (main data) and the additional objects (additional data) between the modules does not have a type. |
ModuleContext |
The module processor gives the module configuration to the module. Therefore, the module does not have to use the Adapter Framework configuration API. |
ModuleException |
A module must output a module exception and should save the triggering exception under cause. |
For a detailed description of the classes and interfaces, see the Javadoc documentation.
The following default modules are shipped with the Adapter Framework:
● ModuleProcessorExitBean
If you use the recommended Adapter Framework CCI interface in the receiver direction, this module must be the last in the module chain. It recognizes the following parameters:
○ JNDIName, for example, deployedAdapters/sample_ra/sharable/sample_ra is the JNDI name of the deployed JCA adapter
○ username, for example, administrator, technical account that requests the CCI connection
○ pwd, for example, sap, account password
● CallSapAdapter
In the sender direction, this module must be called in the module chain. It does not use any configuration parameters.
The example module ConvertCRLFfromToLF is shipped with the Adapter Framework. It shows the processing of text payloads in which carriage return line feed (CRLF) line breaks are converted to line feed (LF) or the other way around.
This module is installed with the Adapter Framework and you use it as follows:
...
1. Select a communication channel with Direction Receiver and Adapter Type JCA example adapter.
2. Select the Module tab page, choose (Switch Between Display and Edit Modes), and add a line in the Processing Sequence.
3. Make the following entries:
a. Module Name: SAP XI Sample/ConvertCRLFfromToLF
b. Type: L
c. Use the module key, or specify a key of your choice.
d. Confirm your entries with RETURN.
4. In the module configuration, add a new line and specify the following:
a. Select the module key.
b. Parameter Name: mode
c. Parameter Value: CRLFtoLF
d. Confirm your entries with RETURN.
The ConvertCRLFfromToLF module must be the first in the module chain in the receiver channel or the penultimate module before CallSAPAdapter in the sender channel. The convert parameter can have the following values:
● CRLFtoLF: All CRLF is replaced by LF
● LFtoCRLF: All LF is replaced by CRLF
● None: No conversion (for test purposes)
More information: Example Adapter and Example Module