CardOnNotify
This method can be called to provide a notification for adapters of key events.
Value | Description |
---|---|
MPIN_ADAPTER_GETSTART | Prior to any get calls for the card |
MPIN_ADAPTER_GETSTOP | After all get calls for the card |
MPIN_ADAPTER_PUTSTART | Prior to any put calls for the card |
MPIN_ADAPTER_PUTSTOP | After all put calls for the card |
MPIN_ADAPTER_LISTENSTART | Prior to any listen calls for the card |
MPIN_ADAPTER_LISTENSTOP | After all listen calls for the card |
MPIN_ADAPTER_LISTENABORT | Called to abort a non-polling listener |
MPIN_ADAPTER_MAPABORT | When a map is cancelled by user action |
MPIN_OBJECT_PREPARE_DESTROY | Called prior to an object being destroyed |
These entry points provide the opportunity for an adapter to initialize or clean up the GET, PUT or LISTEN methods.
For example, the adapter might need to query a queue to find out some properties about the queue. This would be done in the onNotify (*_START) call. If this was done with the GET, PUT,or LISTEN methods and they were called multiple times, unnecessary work would be performed repeatedly.
onNotify is called with *_START prior to any GET, PUT, or LISTEN method and is called with *_STOP after all GET, PUT, or LISTEN calls.
For example, if a map is executing multiple bursts and within each burst, GET is called multiple times to get multiple messages, there will be only one onNotify call with MPIN_GET_START, prior to the first get. Only after all bursts and all gets within a burst, will onNotify be called with MPIN_GET_STOP to allow the adapter to clean up.
If a user cancels a map execution, onNotify will be called with MPIN_ADAPTER_MAPABORT. The GET or PUT methods should be aborted by the adapter as soon as possible after the notification.
The MPIN_ADAPTER_LISTENABORT notification is delivered only to adapters that have defined listenerBlocks as TRUE. In this scenario, onNotify is called on a separate thread from the listen call. For all other notifications, the call is made on the connection thread. When an adapter receives this notification, it should abort the LISTEN method using whatever mechanism or API that is supported by the adapter.