Listener scenario: Listener and map connection threads are combined
This is an example scenario in which an adapter requires that all activities related to an input event are carried out within the same thread.
This example describes a scenario where an adapter is requiring that all activities related to an input event are carried out within that same thread (for example, SAP BW).
- A watch is to be added. The Resource Manager sees from the vtable adapter library that bListenThread is TRUE. It gets the listener thread count from the dtx.ini configuration file. (Call this n).
- The Resource Manager calls the ValidateProperties method with watch data.
- The Resource Manager starts n threads, each of which calls the Connect, BeginTransaction, OnNotify (MPIN_LISTEN_START), and Listen methods.
- When a Listen method returns messages in the message collection object, the Resource Manager calls the Launcher passing the connection context.
- The Launcher calls the Resource Manager to initiate the Get method, passing the connection context back to the Resource Manager.
- The Resource Manager communicates with the thread corresponding to the connection context, calling its Get method.
- Possibly, other Get or Put methods are called during the processing of this map.
- The EndTransaction method is called at the appropriate time.
- When the map completes, the Resource Manager first calls the BeginTransaction method and then the Listen method once more on the same thread.