MateComponent Activation tutorial

What is MateComponent Activation ?
The need for a replacement
Getting started
Checklist
The non-local case

What is MateComponent Activation ?

MateComponent Activation (originally named OAF) was designed as a replacement for the limited libgnorba library used in older MATE released. matecomponent-activation is responsible on MATE 2.x systems for the activation of CORBA objects. matecomponent-activation allows you to browse the available CORBA servers on your system (running or not). It keeps track of the running servers so that if you ask for a server which is already running, you will not start it again but will reuse the already running one.

The need for a replacement

Gnorba works well in a limited number of cases and suffers of a number of design issues. More specifically:

  • It cannot handle the non-local case gracefully. ie: you cannot start a remote CORBA server with matecomponent-activation.

  • It uses evil hacks to keep track of the system's CosNaming service making it unusable on systems where an X server is not running. (for details, read matecomponent-activation code ;-)

  • matecomponent-activation allows you to only request specific servers by their name: you cannot ask for a server which provides a specific service. You have to ask for a server which you know provides a specific service.

MateComponent Activation was designed to address these issues. The remote issue is completely solved by the MateComponent Activation daemon (see MateComponent Activation Architecture), the evil hacks regarding X are part of our past and the grand OAF query langage (see MateComponent Activation Query Langage) gives you the ability to perform arbitrary queries on the database of CORBA servers.

Basically, MateComponent Activation keeps track of all the CORBA servers installed on your machine and can track any other machine's CORBA servers provided you set up MateComponent Activation correctly and allows you to perform queries on the properties of these servers. The following very simple example will make things rather clear:

CORBA_Object o = matecomponent_activation_activate ("repo_ids.has ('IDL:MATE/Graph/Layout:1.0')",
                                             NULL, 0, NULL, &ev);
      

This will ask for a component which supports the MATE/Graph/Layout:1.0 interface. You can also do much more complicated things. MateComponent Activation will find one whcih matches the query and will take all the necessary measures required to get the server running (if it is a shared library progam, it will load the relevant library in memory. If you need a Factory, it will launch the factory and request the factory to create the relevant object).

Getting started

Here follows a very simple-stupid example of what you can do with MateComponent Activation. The complete API description of matecomponent activation, the MateComponent Activation query langage reference and the .server file format reference are included in this document and are recommended readings. Reading MateComponent Activation Architecture is also a good idea.