17

Click here to load reader

EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

Embed Size (px)

DESCRIPTION

Current industry and research organisations invest considerable effort to adopt component based programming which is promising rapid development process. Several issues, however, hinder its wider adoption. One of them is the practical use of extra-functional properties (EFPs) that research community aims at integrating to component composition but for which industrial applications are still rare. When extra-functional properties are not considered or misinterpreted, inconsistencies in application performance, security, reliability, etc. can result at run-time. As a possible solution we have proposed a general extra-functional properties system called EFFCC. In this paper we show how it can be applied to an industrial component model, namely the OSGi framework. This work analyses OSGi from the extra-functional properties viewpoint and shows how it can be enhanced by EFPs, expressed as OSGi capabilities. The proposed benefits of the presented approach are seamless integration of such properties into an existing framework and consistency of their interpretation among different vendors. This should support easier adoption of extra-functional properties in practice.

Citation preview

Page 1: EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

Enhancing OSGi with Explicit, Vendor IndependentExtra-functional Properties

Kamil Ježek Premek Brada Lukáš HolýDepartment of Computer Science and Engineering

University of West BohemiaUniverzitni 8, 30614 Pilsen, Czech Republic

{kjezek|brada|lholy}@kiv.zcu.cz

TOOLS 2012

1 / 17

Page 2: EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

Introduction

Agenda

Component-based programming + Extra-functional propertiesSemantics weak extra-functional properties in OSGiProposed semantic rich extra-functional propertiesApplication to OSGi

2 / 17

Page 3: EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

Component-based Programming Motivation Motivation

Motivation

Development Assembly

From repository

Component deployment

Different vendors

Binding compatibility checks

Component independently developed and deployedDifferent groups of people involvedCompatibility verification more important than beforeExtra-functional properties should be considered

3 / 17

Page 4: EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

Component-based Programming Motivation Extra-functional Properties Overview

What are Extra-functional Properties?

No common understanding:Palladio simulates systems to asses performance and reliabilityProCom defines parametrised valuesPECOS composes Petri-nets to model timing and synchronisation

In this work:An extra-functional property holds measurable values,explicitly provided with a software system, to specify acharacteristic of the system apart from its genuinefunctionality, to enrich client’s understanding of the usage ofthe system, supported by technical [computational] means.

E.g.: System A: Require - network_speed = 10Mb/s

4 / 17

Page 5: EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

OSGi Overview

OSGi Overview

OSGi is:Industrial standard to modularised systems

Modules (components) Java jar files – called BundlesExplicit lifecycle of Bundles from Install and Start to Stop andUninstall

Strong isolation of each Bundle (on classpath level)Communication (among others) via explicitly registered servicesOnly exported packages are accessibleBetter isolation control than Java coarse grained access modifiersProvided and required features explicitly stated in manifest file

5 / 17

Page 6: EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

OSGi Parametrised Binding

OSGi Parametrised Packages

Parametrised packages

Export-Package: cz.zcu.kiv.web.html;version=1.3,html_version=5.0

Import-Package: cz.zcu.kiv.web.html;version=1.3;resolution:=optional,html_version=5.0

version – build-in parameterhtml_version – user defined parameter

Drawbacks:No explicit semantics and unification of user defined parameters(e.g. html_version vs. version_html)Different vendors do not have to even know existence of theseparameters

6 / 17

Page 7: EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

OSGi Parametrised Binding

OSGi Capabilities

Capabilities:

Provide-Capability: cz.zcu.kiv.web.ui;ui_library=Qt

Require-Capability: osgi.ee;filter:="(|(ui_library=GTK)(ui_library=Qt))"

osgi.ee – build-in name-spacecz.zcu.kiv.web.ui – user defined name-space

Drawback:Name-spaces should have proposed semantics, however, notechnical mean to exchange user defined ones among developersis provided

7 / 17

Page 8: EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

OSGi Parametrised Binding

OSGi Parametrised Services

Parametrised services:

HashTable ht = new HashTable();ht.put("network_speed", 10);bundleContext.registerService(Net.class, this, ht);

services = bundleContext.getServiceReferences(Net.class, "(network_speed >= 10)");

Drawback:Developers must study source-code or run bundles to determineservices parameters

Declarative Services:

Services defined in XML filesSolves need to study source-codeSemantics of parameters still weak

8 / 17

Page 9: EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

EFFCC Overview

Proposed Solution

EFFCC – Extra-Functional properties Featured Compatibility Checks

Explicit definitions of properties in repositorySame properties shared by different developers

Properties grouped by application domainSemantics assigned for each domainSub-domains supported

OSGi

EF FCCPowered

Development Assembly

EFPs from repository

Component deployment

Different vendors

Binding compatibility checks

9 / 17

Page 10: EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

EFFCC Example and Formalisation

EFFCC Example and Formalisatione = (n,Ed , γ,V ,M)

GR = (id ,name, {ei})462, Browser: {network_speed,{}, Integer, decreasing, {fast, slow}, "Mb/s", ... }

LR = (id ,GR,name, {LRi},S,D)

463, Intel Dual Core 2.8GHz {network_speed: slow = [1..10), fast = [10..100), ... }

RenderingEngine {Require-Capability : 462.network_speed = 463.slow, ... }

A = F×E×VA,VA = S×D×V×computed

10 / 17

Page 11: EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

Application to OSGi Enriched OSGi Parameters Semantics

Enriched OSGi Parameters Semantics

All properties stored in unified remote repository (J2EE Server)Actually used properties mirrored in XML file, distributed withBundlesXML contains semantic rich propertiesOriginal OSGi parameters, attributes and filters linked with XMLfiles

GR: e1, e

2, ...

LR1: s

1, s

2, … , d

1, d

2, ...

LR2: s

1, s

2, ...

MANIFEST.MF<ds>.XML

Mirror

Repository

LR3: ...

f1: (e

1,(LR

1,s

1))

f2: (e

1, (LR

2,d

2))

f3: (e

1, „value“)

f4: (e

1, ...)

e : propertiess, d : simple, derived valuesf : features

11 / 17

Page 12: EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

Application to OSGi Attributes, Parameters and Filters Format

Attributes, Parameters and Filters Format

New proposed format to write down OSGi attributes and filter:

<gr-id>.<efp>=<lr-id>.<value>

<gr-id> – link to XML domain definitions part<lr-id> – link to XML sub-domain part<value> – value from XML, original OSGi value or formula

E.g.:Original OSGi: network_speed = 10Enriched OSGi: 462.network_speed = 463.slow462.dhtml = 465.computed, true⇔ jsver > 0&htmlver ≥ 4

12 / 17

Page 13: EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

Application to OSGi Enriched OSGi Life-cycle

Enriched OSGi Life-cycle

ResolverHook

FindHook

Packages, Capabilities

Services

13 / 17

Page 14: EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

Application to OSGi Enriched OSGi Life-cycle

Implementation

Two hook methods:

ResolverHook:void filterMatches(BundleRequirement requirement,Collection<BundleCapability> candidates)

It represents set of candidates fulfilling requirement

FindHook:void find(BundleContext context, String name,String filter, boolean allServices,Collection<ServiceReference<?>> references);

It represents set of services fulfilling name and service filter

In both cases, candidates can be removed according to additionalcompatibility checks

14 / 17

Page 15: EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

Application to OSGi Enriched OSGi Life-cycle

Implementation (II)

15 / 17

Page 16: EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

Conclusion

Conclusion

OSGi allows ad-hoc extra-functional properties definitionsPackage export/import allows only comparison to equality(replaceable by capabilities)Limited number of data types (Number, String, Version)

User-defined types may be added. Unfortunately, not implementedin Apache Felix and Equinox (solution: external “manifest”)Problem to evaluate e.g. “slow” vs. “fast” – OSGi compares asStrings

Generic extra-functional properties mechanism proposedMechanism applied to OSGiOSGi extended but not modificationsDeclarative services suggested

16 / 17

Page 17: EnhancingOSGi with Explicit, Vendor Independent Extra-functional Properties

Questions

Thank you for your attention

Contact us:{kjezek|brada|lholy}@kiv.zcu.czResearch group: http://www.kiv.zcu.cz/research/groups/dss/EFFCC project: http://www.assembla.com/spaces/show/efps

17 / 17