Registering as a Temporary Consumer

[This is preliminary documentation and subject to change.]

One of the following IWbemServices methods are called to register as a temporary event consumer:

Both of these methods require a query that specifies the event type and the conditions under which a notification is delivered. The asynchronous version of the call also specifies the sink, the object to receive the notifications as they arrive. The sink is an implementation of the IWbemObjectSink interface.

Do not call IWbemServices::ExecNotificationQueryAsync multiple times with the same sink. Use a separate sink for each class of registered event. Having a dedicated sink simplifies processing and aids in maintenance, making it possible to cancel one registration without affecting the others.

Temporary consumers that perform separate tasks after notification of a particular event type need to make separate calls to ExecNotificationQuery or ExecNotificationQueryAsync for each event type. For example, a consumer might be interested in instance modification events for a specific class of device and security violation events. The tasks to be performed upon receiving the instance modification event notification are much different than those to be performed upon receiving the security violation event. The consumer makes one call to the IWbemServices method of choice to register for the instance modification event and another call to register for the security violation event.

Make each query as specific as possible. The goal of registration is to register to receive only wanted notifications. Receiving superfluous notifications wastes processing and delivery time and does not use CIMOM's filtering ability to its fullest potential.