3 The ***binder*** provides the way to connect applications to
4 the services that it needs.
6 It provides a fast way to securely offer APIs to applications
7 written in any language and running almost anywhere.
9 - The ***binder*** is developed for AGL.
10 - The ***binder*** is the usual name.
11 - The binary is named **afb-daemon**.
12 - The name **afb-daemon** stands for ***Application Framework Binder Daemon***.
14 The word *daemon*, here, denote the fact that the ***binder*** makes witchcraft to
15 connect applications to their expected services.
16 (note: that usually the term of daemon denotes background process but not here).
18 Each ***binder*** **afb-daemon** is in charge to bind one instance of
19 an application or service to the rest of the system, applications and services.
20 Within AGL, the connection between services and/or applications
21 is tuned by the AGL framework and the AGL system.
23 ## The basis of the binder
25 The following figure shows main concepts linked to the ***binder***.
27 <a id="fig-binder-basis"></a>
28 ![Figure: binder basis](pictures/basis.svg)
30 The shown elements are:
32 - The SECURITY CONTEXT
34 The primary intend of any ***binder*** is to provide
35 a secured environment for any application.
36 On AGL, the **security context** is ensured by [Smack]
37 , the security context of the application or service.
41 This is the central element.
42 It makes possible to run HTML5 applications and provides
43 the unified access to APIs provided by the ***bindings***.
45 Running a pure HTML5 application doesn't require any ***binding***.
46 In that case , the ***binder*** acts as a simple HTTP server for
51 A ***binding*** adds one **API** to the ***binder***.
53 An **API** is a set of **verbs** that can be called
54 using either REST over HTTP or a kind of JSON RPC.
56 ***bindings*** are either:
58 - dynamically loaded libraries in the ***binder*** process
59 - remote service running on the same host
60 - remote service running on other hosts
62 When acting as an HTTP server, the binder treats the language
63 settings of the HTTP requests to provide internationalized
64 content as specified by
65 [widget specifications](https://www.w3.org/TR/widgets/#internationalization-and-localization).
68 An ***application*** connects to the binder to get access to
69 the **API** that it provides or to get its HTTP services to access
74 ## Interconnection of binders
76 The AGL framework interprets the **widget/application** manifests
77 to setup the ***bindings*** configuration of the ***binders***.
79 The figure below shows that ***binders*** are interconnected.
81 <a id="fig-binder-interconnection"></a>
82 ![Figure: binder interconnection](pictures/interconnection.svg)
84 The figure shows 4 several **application/service**: **A**, **B**,
87 The application **A** might use an **API** that is shown as a
88 local ***binding*** but that in reality runs within the context
91 The framework AGL takes care of making the plumbing working.