Sun WBEM SDK Developer's Guide

CIM Indication Classes

Providers generate indications of CIM events by creating instances of subclasses of the CIM_Indication class.

The following table lists the intrinsic CIM events that a provider should generate.

Table 6–4 CIM Events Indication Classes

Event Class 

Description 

CIM_InstCreation

Notifies when a new instance is created.  

CIM_InstDeletion

Notifies when an existing instance is deleted. 

CIM_InstModification

Notifies when an instance is modified. The indication must include a copy of the previous instance whose change generated the indication. 

How to Generate an Event Indication
  1. Implement the EventProvider interface. For example:

    public class sampleEventProvider implements 
            InstanceProvider EventProvider{
    
        // Reference for provider to contact the CIM Object Manager
        private ProviderCIMOMHandle cimom;
       }

  2. Execute each of the methods listed in Table 6–3 for each instance indication that the provider handles.

  3. Create an indication listed in Table 6–4 for each create, modify, and delete instance event type. For example, in the createInstance method:

    public CIMObjectPath createInstance(CIMObjectPath op, 
            CIMInstance ci)
        throws CIMException {
            CIMObjectpath newop = ip.createInstance(op, ci);
            CIMInstance indication = new CIMInstance();
            indication.setClassName("CIM_InstCreation");
            CIMProperty cp = new CIMProperty();
            cp.setName("SourceInstance");
            cp.setValue(new CIMValue(ci));
            Vector v = new Vector();
            v.addElement(cp);
            indication.setProperties(v);
            ...
        }

  4. Deliver the event indication to the CIM Object Manager. For example:

    cimom.deliverEvent(op.getNameSpace(), indication);
            return newop;