The SEESCOA Composer Tool: Using Contracts for Component Composition and Run-Time Monitoring UML 2002 SIVOES-MONA workshop October 1, 2002 Stefan Van Baelen, David Urting, Yolande Berbers K.U.Leuven Department of Computer Science Celestijnenlaan 200 A B-3001 Leuven Belgium http://www.cs.kuleuven.ac.be Outline Components & Collaborations Contracts for Components & Collaborations UML 2002, 01/10/2002 Goals of the SEESCOA Project The SEESCOA CCOM Composer Tool Future Work SIVOES-MONA Workshop The SEESCOA Run-Time Component System ‹#› Goals of the SEESCOA Project Developing applications by hierarchical (de)composition of components Adding QoS specification contracts onto scenarios (resource constraint contracts) UML 2002, 01/10/2002 Enable CBD for RT Embedded Systems Code generation for SEESCOA component system Monitoring resource contracts at run-time Active scheduler based on resource contracts For higher-end embedded systems SIVOES-MONA Workshop Development of a run-time component system supporting loose coupling of component ‹#› Components & Collaborations A logically highly cohesive, lowly coupled, documented software module that can be used as a unit of development, reuse, composition and adaptation. UML 2002, 01/10/2002 What is a SEESCOA component ? It can be instantiated and is statefull at run-time Component blueprint (class-like) vs. instance (object-like) Example a collection of objects accessible through one or more facades, and providing a factory to instantiate them SIVOES-MONA Workshop It provides dedicated functionality through welldefined interfaces. ‹#› SEESCOA component modeling & hierarchical (de)composition is based on ROOM/UML-RT Components = black boxes accessible through ports Component blueprint (class) can define a number of port blueprints (classes) 3 Master control 1 Sampler # Read-out Ports define a bi-directional asynchronous interface to a component Port specification on 3 levels Syntactical level (in/outgoing message names & params) Semantic level (message spec., pre & postconditions) Synchronization level (MSC for the port) SIVOES-MONA Workshop Settings control UML 2002, 01/10/2002 Components & Collaborations ‹#› Synchronization level MSC = extended UML Sequence Diagram Allows specification of loops, alternative & optional messages Allows specification of message hooks Sending time of message (S) Beginning of activation (B) :Sampler :Env start End of activation (E) S R B Return value passing = distinct message E LOOP update S OPT R request R S S resend SIVOES-MONA Workshop Receival time of message (R) UML 2002, 01/10/2002 Components & Collaborations R ‹#› Component instances can have a number of port instances, to which other component/port instances can be connected reader 1 settings control secondary sampler UML 2002, 01/10/2002 Components & Collaborations read-out reader 2 master control MSC’s of connected components must be compliant (MSC conformance checking) Mapping of names (resolving name mismatches) Mapping of LOOP / OPT / ALT blocks “Unified” collaboration MSC as a result SIVOES-MONA Workshop master ‹#› Components & Collaborations c2 env env c1 a a’ LOOP b’ b LOOP c e’ d OPT d’ LOOP c’ e c2 c1 a/a’ b/b’ LOOP d/d’ e/e’ c/c’ Resulting MSC associated with the connector SIVOES-MONA Workshop ALT UML 2002, 01/10/2002 MSC conformance checking ‹#› Components & Collaborations But multi-connectors can also be modeled consumer UML 2002, 01/10/2002 Connectors are mostly binary producer producer mediator OPT LOOP LOOP start send deliver ok consumer SIVOES-MONA Workshop mediator ‹#› Components & Collaborations UML 2002, 01/10/2002 UML SEESCOA Profile Meta-model extension Classifier Instance Port 1 0..n S_Component Instance Connection Port Instance 1 0..n Plus additional restrictions (inheritance, features, …) 2..n 0..1 SIVOES-MONA Workshop S_Component ‹#› Timing contracts on a collection of connectors Memory contracts on a component Can be seen as contract between component & the component system, restricting the dynamic memory usage of the component sampling read-out reader 1 Timing Contract Memory Contract Timing Contract prod MW cons SIVOES-MONA Workshop QoS contracts can be attached to components & connectors UML 2002, 01/10/2002 Contracts for Components & Collaborations ‹#› Contracts for Components & Collaborations UML 2002, 01/10/2002 QoS contracts Based on Real-Time Logic (RTL) Time-stamped events: occurrence relation R(event, occurrence, time) Can make use of message hooks :Sampler Beginning/End of activation msg.B[] - msg.S[] < 10 ms :Env start S R B E LOOP update S OPT R request R S S resend SIVOES-MONA Workshop Sending/Receival of message R ‹#› Contracts for Components & Collaborations Occurrence maps to MSC loop ping.S[i+1] - ping.S[I] <= 50 ms c2 env LOOP ping Nesting of MSC loops supported UML 2002, 01/10/2002 QoS contracts & LOOP / ALT / OPT constructs “*” (all occurrences) response.S[*][1] - request.S[*][1] <= 10 ms LOOP LOOP request response ALT & OPT expressions have meaning if event occurred “-” (any one occurrence) SIVOES-MONA Workshop c2 env ‹#› Contracts for Components & Collaborations Deadline constraints (worst-case duration): b[]-a[] <= t Lower-bound timing constraints: b[]-a[]>= t UML 2002, 01/10/2002 Typical QoS contracts supported by templates SIVOES-MONA Workshop Periodicity constraints: period*(i-1) <b[i]-a[]< period*i ‹#› Components send messages via component system Component system is responsible for starting/stopping/swapping components Component system is responsible for message delivery UML 2002, 01/10/2002 The SEESCOA Run-Time Component System Each component has its own message queue Messages run to completion per component Active components simulated by self-directed messages SIVOES-MONA Workshop No direct component interaction => loose coupling ‹#› QoS constraint monitor layer within component system Gathers timing information of specified events. External RTL checker analyses information UML 2002, 01/10/2002 The SEESCOA Run-Time Component System Restricted intrusion QoS Monitor Layer reader 1 RTL Checker event occurrence reporting SEESCOA Component System SIVOES-MONA Workshop sampling ‹#› The SEESCOA CCOM Composer Tool Specification of connections Specification of timing contracts Code Generation for component connection & interaction UML 2002, 01/10/2002 Specification of components, ports & MSC’s SIVOES-MONA Workshop Code Generation for contract checking (monitor) ‹#› Future Work Based on timing contracts Memory constraints Specification & monitoring UML 2002, 01/10/2002 Active component scheduler Memory resource broker Distributed QoS Monitor SIVOES-MONA Workshop Run-time component system ‹#›