1 | <chapter id="architecture"> |
---|
2 | <title>Bonobo Activation Architecture</title> |
---|
3 | |
---|
4 | <sect1 id="oaf-daemon"> |
---|
5 | <title>The Bonobo Activation daemon</title> |
---|
6 | <para> |
---|
7 | Bonobo Activation is nothing but a daemon implementing a set of |
---|
8 | CORBA interfaces. These CORBA interfaces implement a Name service |
---|
9 | for the set of CORBA servers installed on your system. Basically, |
---|
10 | OAF knows about all the CORBA servers of your system, running or not. |
---|
11 | The OAF daemon will activate those servers if you ask for them. |
---|
12 | </para> |
---|
13 | |
---|
14 | <para> |
---|
15 | The Bonobo Activation daemon features a powerful query langage which |
---|
16 | allows you to ask for certain services rather than for certain applications. |
---|
17 | </para> |
---|
18 | |
---|
19 | <para> |
---|
20 | C programmers who wish to access these services do not need to make |
---|
21 | raw CORBA calls: they can use a set of convenience functions implemented |
---|
22 | in the liboaf library. This library acts as a wrapper on top of the CORBA |
---|
23 | server. The API documentation for the liboaf library is available there. |
---|
24 | (XXX: add pointer to the API ref). |
---|
25 | </para> |
---|
26 | |
---|
27 | </sect1> |
---|
28 | |
---|
29 | <sect1 id="server-arch"> |
---|
30 | <title>Server architecture</title> |
---|
31 | |
---|
32 | <para> |
---|
33 | The OAF server is split in 2 parts: the <classname>ObjectDirectory</classname> which contains the list |
---|
34 | of all servers on a given machine, and the <classname>ActivationContext</classname> which contains the |
---|
35 | list of all ObjectDirectories. It contains by default the local ObjectDirectory |
---|
36 | and you can add inside other distant ObjectDirectories. |
---|
37 | </para> |
---|
38 | |
---|
39 | <para> |
---|
40 | Each server is described by its .server file which contains among others |
---|
41 | the IDL interfaces this server implements, some specific properties and |
---|
42 | an <emphasis>IID</emphasis> (Implementation ID). Each IID has to be unique. |
---|
43 | Its format is pretty simple: |
---|
44 | <programlisting> |
---|
45 | OAFIID:program_name:UUID |
---|
46 | </programlisting> |
---|
47 | The UUID is supposed to be generated by the <emphasis>uuidgen</emphasis> |
---|
48 | program. <emphasis>program_name</emphasis> has to be an ASCII string without |
---|
49 | comma (','), square bracket ('[]'), or forward slash ('/') characters. |
---|
50 | </para> |
---|
51 | |
---|
52 | <para> |
---|
53 | Each CORBA server on a given machine is thus identified in a unique way. |
---|
54 | CORBA servers on different machines are uniquely identified through the |
---|
55 | <emphasis>AID</emphasis> (Activation ID). The AID format is also pretty |
---|
56 | simple: |
---|
57 | <programlisting> |
---|
58 | OAFAID:[IID,user,host,domain] |
---|
59 | </programlisting> |
---|
60 | <emphasis>user</emphasis> is the user unix login. |
---|
61 | <emphasis>host</emphasis> is a DNS domain name or stringified IP |
---|
62 | address. |
---|
63 | <emphasis>domain</emphasis> is is a string describing what use |
---|
64 | area the object has. |
---|
65 | </para> |
---|
66 | |
---|
67 | <para> |
---|
68 | One important thing to understand about these AID and IID is that the |
---|
69 | <classname>ObjectDirectory</classname> deals exclusively with IIDs (it is stritcly local) and |
---|
70 | the <classname>ActivationContext</classname> deals with AIDs since it can associate a set of |
---|
71 | <emphasis>user</emphasis>, <emphasis>host</emphasis> and |
---|
72 | <emphasis>domain</emphasis> to each IID it gets from one of its |
---|
73 | <classname>ObjectDirectory</classname>. |
---|
74 | </para> |
---|
75 | |
---|
76 | <para> |
---|
77 | As a result of this architecture, activation requests should go to the |
---|
78 | <classname>ActivationContext</classname> and |
---|
79 | registrations to the <classname>ObjectDirectory</classname>. |
---|
80 | <figure> |
---|
81 | <title>OAF architecture</title> |
---|
82 | <graphic fileref="oaf.png" scale="50"></graphic> |
---|
83 | </figure> |
---|
84 | The idea behind this is that when you make a request on the ActivationContext (like query), |
---|
85 | it will: |
---|
86 | <itemizedlist> |
---|
87 | <listitem><para>make sure it has an up-to-date list of all the Servers with a call to |
---|
88 | <function>ObjectDirectory::get_servers</function> for each of its ObjectDirectory. |
---|
89 | </para></listitem> |
---|
90 | <listitem><para>loop through this list to try to satisfy the query with the |
---|
91 | given requirements and sort-order. |
---|
92 | </para></listitem> |
---|
93 | <listitem><para>activate the corresponding object with |
---|
94 | <function>ObjectDirectory::activate</function> (this is not exactly what happens |
---|
95 | since there are optimizations to save this call but the general idea is right). |
---|
96 | </para></listitem> |
---|
97 | </itemizedlist> |
---|
98 | </para> |
---|
99 | |
---|
100 | </sect1> |
---|
101 | |
---|
102 | <sect1 id="async-activation"> |
---|
103 | <title>Async Activation</title> |
---|
104 | |
---|
105 | <para> |
---|
106 | OAF also has a set of asynchronous activation interfaces so that you do not need to block |
---|
107 | on activation calls. The CORBA level is pretty simple: the activation context has a set of |
---|
108 | <function>_async</function> calls: <function>OAF_ACtivationContext_activate_async</function> |
---|
109 | and <function>OAF_ACtivationContext_activate_from_id_async</function>. Both of those calls |
---|
110 | take an OAFActivationCallback CORBA object as parameter. This object, which is supposed to |
---|
111 | be implemented by client applications (it is actually implemented in liboaf) will receive |
---|
112 | CORBA calls when the activation is finished: |
---|
113 | <programlisting> |
---|
114 | module OAF { |
---|
115 | interface ActivationCallback { |
---|
116 | oneway void report_activation_failed (in string reason); |
---|
117 | oneway void report_activation_succeeded (in ActivationResult result); |
---|
118 | }; |
---|
119 | }; |
---|
120 | </programlisting> |
---|
121 | </para> |
---|
122 | |
---|
123 | <para> |
---|
124 | Of course, liboaf provides comvenient wrappers for those CORBA functions. Those are named |
---|
125 | <function>bonobo_activation_activate_async</function> and |
---|
126 | <function>bonobo_activation_activate_from_id_async</function>. |
---|
127 | </para> |
---|
128 | |
---|
129 | </sect1> |
---|
130 | |
---|
131 | </chapter> |
---|