3 <link rel="stylesheet" type="text/css" href="doc.css">
7 <a name="Overview.of.AFB-DAEMON"></a>
8 <h1>Overview of AFB-DAEMON</h1>
16 <li><a href="#Overview.of.AFB-DAEMON">Overview of AFB-DAEMON</a>
18 <li><a href="#Roles.of.afb-daemon">Roles of afb-daemon</a></li>
19 <li><a href="#Use.cases.of.the.binder.afb-daemon">Use cases of the binder afb-daemon</a>
21 <li><a href="#Remotely.running.application">Remotely running application</a></li>
22 <li><a href="#Adding.native.features.to.HTML5.QML.applications">Adding native features to HTML5/QML applications</a></li>
23 <li><a href="#Offering.services.to.the.system">Offering services to the system</a></li>
26 <li><a href="#The.plugins.of.the.binder.afb-daemon">The plugins of the binder afb-daemon</a></li>
27 <li><a href="#Launching.the.binder.afb-daemon">Launching the binder afb-daemon</a></li>
28 <li><a href="#Future.development.of.afb-daemon">Future development of afb-daemon</a></li>
33 <a name="Roles.of.afb-daemon"></a>
34 <h2>Roles of afb-daemon</h2>
36 <p>The name <strong>afb-daemon</strong> stands for <em>Application
37 Framework Binder Daemon</em>. That is why afb-daemon
38 is also named <strong><em>the binder</em></strong>.</p>
40 <p><strong>Afb-daemon</strong> is in charge to bind one instance of
41 an application to the AGL framework and AGL system.</p>
43 <p>On the following figure, you can use a typical use
46 <p><a id="binder-fig-basis"><h4>Figure: binder afb-daemon, basis</h4></a></p>
48 <pre><code>. . . . . . . . . . . . . . . . . . . . . . . . . .
49 . Isolated security context .
51 . +------------------------------+ .
53 . | A P P L I C A T I O N | .
55 . +--------------+---------------+ .
58 . +-------------------+----------------------+ .
61 . | A F B - D A E M O N : PLUGINS | .
63 . +-------------------+----------------------+ .
65 . . . . . . . . . . . . | . . . . . . . . . . . . .
71 <p>The application and its companion binder run in secured and isolated
72 environment set for them. Applications are intended to access to AGL
73 system through the binder.</p>
75 <p>The binder afb-daemon serves multiple purposes:</p>
78 <li><p>It acts as a gateway for the application to access the system;</p></li>
79 <li><p>It acts as an HTTP server for serving files to HTML5 applications;</p></li>
80 <li><p>It allows HTML5 applications to have native extensions subject
81 to security enforcement for accessing hardware ressources or
82 for speeding parts of algorithm.</p></li>
86 <a name="Use.cases.of.the.binder.afb-daemon"></a>
87 <h2>Use cases of the binder afb-daemon</h2>
89 <p>This section tries to give a better understanding of the binder
90 usage through several use cases.</p>
92 <a name="Remotely.running.application"></a>
93 <h3>Remotely running application</h3>
95 <p>One of the most interresting aspect of using the binder afb-daemon
96 is the ability to run applications remotely. This feature is
97 possible because the binder afb-daemon implements native web
100 <p>So the <a href="#binder-fig-1">figure binder, basis</a> would become
101 when the application is run remotely:</p>
103 <p><a id="binder-fig-remote"><h4>Figure: binder afb-daemon and remotely running application</h4></a></p>
105 <pre><code> +------------------------------+
107 | A P P L I C A T I O N |
109 +--------------+---------------+
115 . . . . . . . . . . . . . . | . . . . . . . . . . . . . .
116 . Isolated security | .
119 . . . . . . . . . . . . . . . . . . . . . . . . . .
121 . . F I R E W A L L . .
123 . . . . . . . . . . . . . . . . . . . . . . . . . .
125 . +-------------------+----------------------+ .
127 . | A F B - D A E M O N : PLUGINS | .
129 . +-------------------+----------------------+ .
131 . . . . . . . . . . . . . . | . . . . . . . . . . . . . .
137 <a name="Adding.native.features.to.HTML5.QML.applications"></a>
138 <h3>Adding native features to HTML5/QML applications</h3>
140 <p>Applications can provide with their packaged delivery a plugin.
141 That plugin will be instanciated for each application instance.
142 The methods of the plugin will be accessible by applications and
143 will be excuted within the security context.</p>
145 <a name="Offering.services.to.the.system"></a>
146 <h3>Offering services to the system</h3>
148 <p>It is possible to run the binder afb-daemon as a daemon that provides the
149 API of its plugins.</p>
151 <p>This will be used for:</p>
154 <li><p>offering common APIs</p></li>
155 <li><p>provide application’s services (services provided as application)</p></li>
159 <p>In that case, the figure showing the whole aspects is</p>
161 <p><a id="binder-fig-remote"><h4>Figure: binder afb-daemon for services</h4></a></p>
163 <pre><code>. . . . . . . . . . . . . . . . . . . . . .
164 . Isolated security context application .
166 . +------------------------------+ .
168 . | A P P L I C A T I O N | .
170 . +--------------+---------------+ . . . . . . . . . . . . . . . . . . . . . . .
171 . | . . Isolated security context A .
173 . +-----------------+------------------+ . . +------------------------------------+ .
175 . | b i n d e r : | . . | b i n d e r : service | .
176 . | A F B - D A E M O N : PLUGINS | . . | A F B - D A E M O N : PLUGINS | .
177 . | : | . . | : A | .
178 . +-----------------+------------------+ . . +-----------------+------------------+ .
180 . . . . . . . . . . | . . . . . . . . . . . . . . . . . . . . . | . . . . . . . . . . .
183 ================================================================================
184 D - B U S & C Y N A R A
185 ================================================================================
188 . . . . . . . . . . | . . . . . . . . . . . . . . . . . . . . . | . . . . . . . . . . .
190 . +-----------------+------------------+ . . +-----------------+------------------+ .
192 . | b i n d e r : service | . . | b i n d e r : service | .
193 . | A F B - D A E M O N : PLUGINS | . . | A F B - D A E M O N : PLUGINS | .
194 . | : B | . . | : C | .
195 . +------------------------------------+ . . +------------------------------------+ .
197 . Isolated security context B . . Isolated security context C .
198 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
201 <a name="The.plugins.of.the.binder.afb-daemon"></a>
202 <h2>The plugins of the binder afb-daemon</h2>
204 <p>The binder can instanciate plugins. The primary use of plugins
205 is to add native methods that can be accessed by applications
206 written with any language through web technologies ala JSON RPC.</p>
208 <p>This simple idea is declined to serves multiple purposes:</p>
211 <li><p>add native feature to applications</p></li>
212 <li><p>add common API available by any applications</p></li>
213 <li><p>provide customers services</p></li>
217 <p>A specific document shows</p>
219 <a name="Launching.the.binder.afb-daemon"></a>
220 <h2>Launching the binder afb-daemon</h2>
222 <p>The launch options for binder <strong>afb-daemon</strong> are:</p>
226 Prints help with available options
230 Display version and copyright
234 Increases the verbosity, can be repeated
238 HTTP listening TCP port [default 1234]
242 HTTP Root Directory [default $AFBDIR or else $HOME/.AFB]
246 Angular Base Root URL [default /opa]
248 This is used for any application of kind OPA (one page application).
249 When set, any missing document whose url has the form /opa/zzz
250 is translated to /opa/#!zzz
254 HTML Root API URL [default /api]
256 The plugins are available within that url.
260 Maps a path located anywhere in the file system to the
261 a subdirectory. The syntax for mapping a PATH to the
262 subdirectory NAME is: --alias=/NAME:PATH.
264 Example: --alias=/icons:/usr/share/icons maps the
265 content of /usr/share/icons within the subpath /icons.
267 This option can be repeated.
271 Plugin API timeout in seconds [default 20]
273 Defines how many seconds maximum a method is allowed to run.
278 Client Session Timeout in seconds [default 3600]
282 Client cache end of live [default 100000 that is 27,7 hours]
286 Sessions file path [default rootdir/sessions]
290 Maximum count of simultaneous sessions [default 10]
294 Load Plugins from given paths separated by colons
295 as for dir1:dir2:plugin1.so:... [default = $libdir/afb]
297 You can mix path to directories and to plugins.
298 The sub-directories of the given directories are searched
301 The plugins are the files terminated by '.so' (the extension
302 so denotes shared object) that contain the public entry symbol.
306 Load the plugin of given path.
310 Initial Secret token to authenticate.
312 If not set, no client can authenticate.
314 If set to the empty string, then any initial token is accepted.
318 Set the mode: either local, remote or global.
320 The mode indicate if the application is run locally on the host
321 or remotely through network.
325 Set the #fd to signal when ready
327 If set, the binder afb-daemon will write "READY=1\n" on the file
328 descriptor whose number if given (/proc/self/fd/xxx).
332 Transparent binding to a binder afb-daemon service through dbus.
334 It creates an API of name xxxx that is implemented remotely
335 and queried via DBUS.
339 Provides a binder afb-daemon service through dbus.
341 The name xxxx must be the name of an API defined by a plugin.
342 This API is exported through DBUS.
346 Get all in foreground mode (default)
350 Get all in background mode
353 <a name="Future.development.of.afb-daemon"></a>
354 <h2>Future development of afb-daemon</h2>
357 <li><p>The binder afb-daemon would launch the applications directly.</p></li>
358 <li><p>The current setting of mode (local/remote/global) might be reworked to a
359 mechanism for querying configuration variables.</p></li>
360 <li><p>Implements “one-shot” initial token. It means that after its first
361 authenticated use, the initial token is removed and no client can connect
363 <li><p>Creates some intrinsic APIs.</p></li>
364 <li><p>Make the service connection using WebSocket not DBUS.</p></li>
365 <li><p>Management of targetted events.</p></li>
366 <li><p>Securisation of LOA.</p></li>
367 <li><p>Integration of the protocol JSON-RPC for the websockets.</p></li>