previous Oaf Activation next


Oaf (Object Activation Framework) is a framework that provides a mechanism to locate a remote component by

Capability-based activation allows the user to specify the desired service and get the location of the respective component.

Example:
Oaf can locate a component that handles a certain MIME type (Multi-Purpose Internet Mail Extensions) to render a certain version of HTML (Hyper Text Markup Language).

To do this, we need to install a small XML (eXtensible Markup Language) file in a path where Oaf expects to find it.

A cut-down Oaf file looks like this:

<oaf_info>

  <oaf_server iid="OAFIID:Bonobo_Sample_ControlFactory" type="exe"
     location="bonobo-sample-controls">
        ...
  </oaf_server>

  <oaf_server iid="OAFIID:Bonobo_Sample_Clock" type="factory"
     location="OAFIID:Bonobo_Sample_ControlFactory">

    <oaf_attribute name="repo_ids" type="stringv">
      <item value="IDL:Bonobo/Unknown:1.0"/>
      <item value="IDL:Bonobo/Control:1.0"/>
    </oaf_attribute>

    <oaf_attribute name="name" type="string" value="Clock control"/>
    <oaf_attribute name="description" type="string" value="A sample
Bonobo control which displays a clock."/>

  </oaf_server>

</oaf_info>

Bonobo components are created by factories; consequently we have two server definitions. The factory, which is of type "exe" and located in the executable bonobo-sample-controls, is called Bonobo_Sample_ControlFactory. The object itself, named Bonobo_Sample_Clock, is created by a factory, of name Bonobo_Sample_ControlFactory.

In addition, it's important to notice that the interfaces supported by the component are declared against the control. In this case, only two interfaces are declared: Bonobo/Unknown and Bonobo/Control. And finally, the component is described to allow GUI builders such as Glade to display information about the control.