Implement the EventProvider interface.
For example:
public class sampleEventProvider implements InstanceProvider EventProvider{ // Reference for provider to contact the CIM Object Manager private ProviderCIMOMHandle cimom; }
Execute each of the methods listed in Table 6–2 for each instance indication that the provider handles.
Create an indication for 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); ... }
Deliver the event indication to the CIM Object Manager.
cimom.deliverEvent(op.getNameSpace(), indication);