Writing Monitors for the Event Monitoring Service (December 1999)

80 Chapter3
Creating a Resource Monitor
Processing a Subclass Request Event
Processing a Subclass Request Event
The Subclass Request is a message that a client sends to get the
definition of a particular resource class or instance.
The Subclass Request Event is specified by a return_type of
RM_SUBCLASS_REQUEST_EVENT from rm_get_next_event().
Include in the reply information that describes the resource, plus the
names of any subclasses that exist below the resource.
If the subclass event is for a resource class, provide subclasses.
If the subclass event is for a resource instance, provide the instance
type and other instance information. For example, if the resource
instance is an enumerated type, provide enumerations.
Replying to Subclass Events
To write a subclass event for your resource monitor, include the following
information.
Check that the resource (class or instance) requested is one we
support.
If the monitor cannot respond immediately with its resource, it can
reply with RmResourceType=RM_NOT_READY. This should only be done
for temporary delays.
Check the subclass filter. For example:
If the request is for asynchronous resources but the monitor has
only state resources, no resources satisfy the filtered request. Set
RmResourceType to RM_ERROR_TYPE, and send the reply.
If the request allows for both asynchronous and state type
resources and the monitor only has state type resources, set the
RmStateType to RM_STATE.
If the monitor is for a resource class, provide the subclasses.
If the monitor is for a resource instance, set RmResourceType:
If the type is enumerated, set the RmStateObject field.
If the type is enumerated and is an RM_OV_ENUMERATION, set the