Extending GCM and Fscript for the Distributed Reconfiguration
Extending GCM and Fscript for the Distributed Reconfiguration of Components Boutheina Bennour, Ludovic Henrio, Marcela Rivera {bbennour, lhenrio, mrivera}@sophia. inria. fr December 2008 SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS
Agenda n Context n Distributed Reconfiguration n Execution Context n Experimentation n Conclusion and Perspectives SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 2
Agenda n Context n Distributed Reconfiguration n Execution Context n Experimentation n Conclusion and Perspectives SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 3
Component Model n n Fractal its distributed extension: GCM Component Provided interface q q q Encapsulation Composition Hierarchical binding Required interface Primitive component = business code Composite component SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 4
GCM/Pro. Active n Distributed components q q n Deployed over several nodes Components abstract away distribution Implementation: Pro. Active q q q SAFA’ 08 Active objects Asynchronous communication Futures INRIA – Univ Nice Sophia Antipolis - CNRS 5
GCM/Pro. Active: Distribution and Communication JVM 1 (Host A) JVM 2 (Host B) JVM 3 (Host B) Asynchronous remote method invocation SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 6
Reconfiguration, adaptation n Dynamic reconfiguration q q q SAFA’ 08 Architectural modification during execution Change of functional/non-functional behaviour Adaptation to context and requirements INRIA – Univ Nice Sophia Antipolis - CNRS 7
Component Models and reconfiguration Component Model Composition Distribution Management of non functional code CCM Hierarchical Specified Separation of concerns CCA Flat Specified Separation of concerns SCA Hierarchical Non specified Implementation Fractal Hierarchical Non specified Membrane GCM Hierarchical Specified Membrane SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 8
GCM API for Reconfiguration n Life-cycle controller string get. Fc. State (); void start. Fc () throws Illegal. Life. Cycle. Exception; void stop. Fc () throws Illegal. Life. Cycle. Exception; n Binding controller string[] list. Fc (); any lookup. Fc (string client. Itf. Name) throws No. Such. Interface. Exception; void bind. Fc (string client. Itf. Name, any server. Itf) throws. . . void unbind. Fc (string client. Itf. Name) throws. . . n Content Controller any[] get. Fc. Internal. Interfaces (); any get. Fc. Internal. Interface (string itf. Name) throws. . . Component[] get. Fc. Sub. Components (); void add. Fc. Sub. Component (Component c) throws. . . void remove. Fc. Sub. Component (Component c) throws. . . SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 9
FScript n n n A Scripting reconfiguration language Dedicated to Fractal components Expressions, actions, control structures (exceptions) FPath expressions: navigate and select elements in the components architecture One primitive by method of the Fractal API A language dedicated to reconfiguration of Fractal components SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 10
Example n Add the component given_child to the composite given_parent given_child FScript: Add($given_parent, $given_parent/child: : given_child) Fractal API: try { Content. Controller cc = (Content. Controller) try { cc. add. Fc. Sub. Component(given. Child); } catch (Illegal. Life. Cycle. Exception ilce) { /* Handle error */ } catch (Illegal. Content. Exception ice) { /* Handle error */ } } catch (No. Such. Interface. Exception nsie) { /* Handle error */ } SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS given. Parent. get. Fc. Interface("content-controller"); 11
Objective: A distributed reconfiguration n Distributed reconfiguration language q q n Allow a component/node to interpret a reconfiguration script Actions can be executed in parallel Extension of the FScript language to q q SAFA’ 08 Trigger distributed reconfiguration Handle the distributed execution INRIA – Univ Nice Sophia Antipolis - CNRS 12
Agenda n Context n Distributed Reconfiguration n Execution Context n Experimentation n Conclusion and Perspectives SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 13
A Controller for Reconfigurations n n n Manages and allows the invocation of the script interpreter Is collocated with the component Exposes methods for reconfiguration q q q set. Interpreter(interpreter. Class. Name) load. Script(script. File. Name) execute. Action(action. Name, arguments. . . ) Reconfiguration interface Interpreter Membrane SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 14
Triggering Distributed Reconfigurations in the Scripting Language A primitive for the distributed script interpretation remote_call(target_component, action_name, parameters, . . . ); q q Triggers the action_name by the interpreter located in target_component Receives action arguments as parameter Precondition (Reconfigurability) n The target component must have a reconfiguration controller, i. e. it must expose the RC interface Reconfiguration interface action(arguments) Interpreter q target_component SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 15
Example n Add the component given_child to the composite given_parent given_child remote_call($given_parent, ‘add’, ‘$given_parent’, ‘given_child’); SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 16
Example RC 2 definition action 1 Reconfiguration interface . . . remote_call(C 2, ’action 2’) remote_call(C 11, ’action 11’) remote_call(C 12, ’action 12’) Reconfiguration scripts C 2 . . . definition action 12 RC 1 . . . remote_call(C 121, ’action 121’) Interpreter . . . RC 11 Membrane RC 12 C 11 RC 121 C 12 C 1 SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 17
Example RC 2 definition action 1 Reconfiguration interface . . . remote_call(C 2, ’action 2’) remote_call(C 11, ’action 11’) remote_call(C 12, ’action 12’). . . Reconfiguration scripts C 2 action 1( ) definition action 12 RC 1 . . . remote_call(C 121, ’action 121’) Interpreter . . . RC 11 Membrane RC 12 C 11 RC 121 C 12 C 1 SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 18
Example RC 2 definition action 1 Reconfiguration interface . . . remote_call(C 2, ’action 2’) remote_call(C 11, ’action 11’) remote_call(C 12, ’action 12’). . . Reconfiguration scripts action 1( ) definition action 12 C 2 action 2( ) RC 1 . . . remote_call(C 121, ’action 121’) Interpreter . . . action 11( ) Membrane action 12( ) RC 11 RC 121 C 12 C 1 SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 19
Example RC 2 definition action 1 Reconfiguration interface . . . remote_call(C 2, ’action 2’) remote_call(C 11, ’action 11’) remote_call(C 12, ’action 12’). . . Reconfiguration scripts action 1( ) definition action 12 C 2 action 2( ) RC 1 . . . remote_call(C 121, ’action 121’) Interpreter . . . action 11( ) Membrane action 12( ) RC 11 RC 12 action 121( ) RC 121 C 12 C 1 SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 20
Example RC 2 definition action 1 Reconfiguration interface . . . remote_call(C 2, ’action 2’) remote_call(C 11, ’action 11’) remote_call(C 12, ’action 12’). . . Reconfiguration scripts action 1( ) definition action 12 C 2 action 2( ) RC 1 . . . remote_call(C 121, ’action 121’) Interpreter . . . action 11( ) Membrane action 12( ) RC 11 RC 12 action 121( ) RC 121 Conclusion: The interpretation is parallel and distributed C 121 C 12 C 1 SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 21
Agenda n Context n Distributed Reconfiguration n Execution Context n Experimentation n Conclusion and Perspectives SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 22
Adaptation of FScript to Distributed Interpretation n Provide an access point for the component architecture q q Add a global variable in the interpreter Holds a reference to the component that owns the interpreter void create. Global. Variable(String name, Object reference) n Managing action’s parameters q q SAFA’ 08 Arguments passed to the target interpreter are serialised Make usual arguments (mainly FPath) serializable INRIA – Univ Nice Sophia Antipolis - CNRS 23
Managing Execution Contexts n n Arguments are evaluated by the source interpreter by default It might be more adequate to evaluate them in the target evaluation context q n n especially for Fpath expressions Transmit the FPath expression as a string Add a primitive for the evaluation of Fpath expressions q This primitive can then be called by the action, and evaluated in the target interpreter argument 2 = ’$$C 11_name/parent: : C 1_name/interface: : interface_name’ ; remote_call($$C 1_name/child: : C 11_name, ’action 11’, argument 2) ; . . . evaluate(argument 2) ; SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 24
Agenda n Context n Distributed Reconfiguration n Execution Context n Experimentation n Conclusion and Perspectives SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 25
Implementation n Pro. Active q Add the reconfiguration controller interface in GCM/Pro. Active components n n FScript q n Pro. Active allows the configuration of provided control interfaces when creating a component Definition of the distributed interpretation primitive Experimentation q SAFA’ 08 Reconfiguration of GCM components INRIA – Univ Nice Sophia Antipolis - CNRS 26
Experience Reconfiguration interface Interpreter Membrane Root r r Client s s Server Client. Server r SAFA’ 08 r Client s s Server INRIA – Univ Nice Sophia Antipolis - CNRS 27
Experience Reconfiguration interface Interpreter Membrane Root r r Client s s Server Client. Server r SAFA’ 08 r Client s s Server INRIA – Univ Nice Sophia Antipolis - CNRS 28
Experience: Reconfiguration script action change_client(root) { client = $root/child: : Client; intf-root-r = $root/interface: : r; unbind($client/interface: : s); unbind($intf-root-r); client 2 = new('Client. Impl'); set-name($client 2, "Client 2"); add($root, $client 2); intf-client 2 -r = $client 2/interface: : r; intf-client 2 -s = $client 2/interface: : s; bind($intf-client 2 -s, $root/child: : Server/interface: : s); bind($intf-root-r, $intf-client 2 -r); } action reconfigure_root(root){ change_client($root); remote_call($root/child: : Server, 'change_client', $root/child: : Client. Server); remote_call($root/child: : Client. Server/child: : Server, 'echo', 'Hello World'); start($root); } SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 29
Result n Successfully reconfigured components q q New clients connected and working We check the new configuration thanks to FPath expressions bound($root/child: : Client 2/interface: : r) and bound($root/child: : Client 2/interface: : s) and not(bound($root/child: : Client/interface: : r)) and not(bound($root/child: : Client/interface: : s)) q Evaluated to True Feasibility of our approach and distributed reconfigurability of GCM components SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 30
Agenda n Context n Distributed Reconfiguration n Execution Context n Experimentation n Conclusion and Perspectives SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 31
Conclusion n Extend FScript reconfiguration language n Better reconfigurability of distributed components n Introduced a reconfiguration controller n New primitive for distributed script evaluation n New primitives for better managing the distributed nature of the execution context n Prototype and experimentation SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 32
Perspectives (1) n n Type reconfiguration scripts to validate script relatively to a component structure Reconfiguration atomicity q q SAFA’ 08 Provided by FScript Difficult to implement efficiently in a distributed manner Could provide primitives to choose if a reconfiguration is atomic or tools to know if a reconfiguration succeeded and take adequate decisions INRIA – Univ Nice Sophia Antipolis - CNRS 33
Perspectives (2) Reconfiguration Primitives for structural changes q q q SAFA’ 08 Duplicate a component Replace a component Migrate a component (of node, or to another composite) Suppress a component Auto-connection INRIA – Univ Nice Sophia Antipolis - CNRS 34
Thanks! SAFA’ 08 INRIA – Univ Nice Sophia Antipolis - CNRS 35
- Slides: 35