Sun WBEM SDK Developer's Guide

Creating an Event Handler

An event handler is an instance of a CIM_IndicationHandler class. The CIM Event MOF defines a CIM_IndicationHandlerXMLHTTP class for describing the destination for indications to be delivered to client applications using the HTTP protocol. Event delivery to HTTP clients is not supported because HTTP delivery for events is not defined yet.

The Solaris Event MOF extends the CIM_IndicationHandler class by creating the Solaris_RMIDelivery class to handle delivery of indications of CIM events to client applications using the RMI protocol. RMI clients must instantiate the Solaris_RMIDelivery class to set up an RMI delivery location.

An application sets the properties in the CIM_IndicationHandler class to uniquely name the handler and identify the UID of its owner.

Table 6–2 Properties in the CIM_IndicationHandler Class

Property 

Description 

Required/Optional 

SystemCreationClassName 

The name of the system on which the creation class for the handler resides or to which it applies. 

Optional. The default for this key property is the name of the creation class for the CIM_System class.

SystemName 

The name of the system on which the handler resides or to which it applies. 

Optional. The default value for this key property is the name of the system on which the CIM Object Manager is running. 

CreationClassName 

The class or subclass used to create the handler. 

Optional. The CIM Object Manager assigns CIM_IndicationFilter as the default for this key property.

Name 

The unique name of the handler. 

Required. The client application must assign a unique name. 

Owner 

The name of the entity that created or maintains this handler. Provider can check this value to determine whether or not to authorize a handler to receive an indication. 

Optional. The default value is the Solaris user name of the user creating the instance. 

The following example shows the code for creating a CIM event handler.


Example 6–2 Creating a CIM Event Handler

// Create an instance of the Solaris_RMIDelivery class.
CIMClass rmidelivery = cc.getClass(new CIMObjectPath
        (“Solaris_RMIDelivery”), false, true, true, null);

CIMInstance ci = rmidelivery.newInstance();

//Create a new instance (delivery) from
//the rmidelivery instance.
CIMObjectPath delivery = cc.createInstance(new CIMObjectPath(), ci);