Return-Path: Delivered-To: apmail-incubator-ace-dev-archive@minotaur.apache.org Received: (qmail 45671 invoked from network); 16 Sep 2010 12:08:05 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Sep 2010 12:08:05 -0000 Received: (qmail 52216 invoked by uid 500); 16 Sep 2010 12:08:04 -0000 Delivered-To: apmail-incubator-ace-dev-archive@incubator.apache.org Received: (qmail 52170 invoked by uid 500); 16 Sep 2010 12:08:03 -0000 Mailing-List: contact ace-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ace-dev@incubator.apache.org Delivered-To: mailing list ace-dev@incubator.apache.org Received: (qmail 52162 invoked by uid 99); 16 Sep 2010 12:08:02 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Sep 2010 12:08:02 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [147.228.57.19] (HELO fred.zcu.cz) (147.228.57.19) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Sep 2010 12:07:38 +0000 Received: from [147.228.64.44] (uk409nb2-kiv.fav.zcu.cz [147.228.64.44]) (Authenticated sender: brada) by fred.zcu.cz (Postfix) with ESMTPSA id 9AD5BA0C1A8E; Thu, 16 Sep 2010 14:07:13 +0200 (CEST) Message-ID: <4C92086C.1090505@kiv.zcu.cz> Date: Thu, 16 Sep 2010 14:07:08 +0200 From: Premek Brada Reply-To: brada@kiv.zcu.cz Organization: University of West Bohemia, Pilsen, CZ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.12) Gecko/20100824 Thunderbird/3.0.7 MIME-Version: 1.0 To: ace-dev@incubator.apache.org Subject: proposal: a versioning repository Content-Type: multipart/mixed; boundary="------------020507030200050307040106" X-ZCU-MailScanner-ID: 9AD5BA0C1A8E.AF440 X-ZCU-MailScanner: Found to be clean X-ZCU-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-102.899, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90, HTML_MESSAGE 0.00, USER_IN_WHITELIST -100.00) X-ZCU-MailScanner-From: brada@kiv.zcu.cz X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No --------------020507030200050307040106 Content-Type: multipart/alternative; boundary="------------050302010302080603020401" --------------050302010302080603020401 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello all, I am a researcher and software engineering lecturer at University of West Bohemia, Czech Republic. In my team we have been researching component compatibility methods and their applications to industrial technologies, in particular OSGi. Some time ago I came to know the Apache ACE project, through Marcel Offermans. During our discussions, the idea came up that an automated mechanism of assigning version numbers to bundles and their exported packages, which we came up with, could be useful for ACE. To cut a long story short, we are now able to reliably generate semantic versions (as per the recent OSGi Technical Whitepaper) when a bundle is newly stored in ACE repository. The versions are stored/updated in the appropriate bundle manifest headers. This effectively ensures version-implementation consistency across all bundles managed by the given ACE repo instance, in other words, no nasty runtime errors / exceptions due to type mismatches in wired bundles obtained from such a repository. Also, it means the bundle programmer can be lazy and leave versioning chores to the repository ;-) Now then, I have a couple of questions to the community here: - First, is the explanation clear enough? - Does this sound interesting? (To me, it certainly does :-) Why yes/no? - [if yes] How would you imagine/suggest such a thing should be integrated into ACE? We of course have an implementation, it extends the plain org.apache.ace.obr.storage.BundleStore interface to include versioning -- see the attached pieces of code to get an idea how it works (there is about 0.5MB of libraries hidden behind this small interface). However, this is our first cut and by no means an ideal solution. I would be therefore very much interested in any thoughts and ideas you may have about this versioning ACE repository. Best, Premek PS: A sort of advertisement: we have a bundle versioning service at http://osgi.kiv.zcu.cz/obvs/ - you are invited to give it a try, I would be interested in any feedback. -- Premek Brada (Ing et MSc, PhD) Lecturer in Software enginering, Erasmus coordinator, Webmaster Department of Computer Science and Engineering University of West Bohemia, Pilsen, CZ << brada at kiv.zcu.cz | www.kiv.zcu.cz/~brada/ | +420-377-63-2435>> --------------050302010302080603020401 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello all,

I am a researcher and software engineering lecturer at University of West
Bohemia, Czech Republic.  In my team we have been researching component
compatibility methods and their applications to industrial technologies,
in particular OSGi.

Some time ago I came to know the Apache ACE project, through Marcel Offermans.
During our discussions, the idea came up that an automated mechanism of
assigning version numbers to bundles and their exported packages, which we
came up with, could be useful for ACE.  To cut a long story short, we are now able
to reliably generate semantic versions (as per the recent OSGi Technical Whitepaper)
when a bundle is newly stored in ACE repository. The versions are stored/updated in
the appropriate bundle manifest headers.

This effectively ensures version-implementation consistency across all bundles managed
by the given ACE repo instance, in other words, no nasty runtime errors / exceptions due
to type mismatches in wired bundles obtained from such a repository. Also, it means
the bundle programmer can be lazy and leave versioning chores to the repository ;-)

Now then, I have a couple of questions to the community here:
- First, is the explanation clear enough?
- Does this sound interesting? (To me, it certainly does :-) Why yes/no?
- [if yes] How would you imagine/suggest such a thing should be integrated
  into ACE?

We of course have an implementation, it extends the plain
org.apache.ace.obr.storage.BundleStore interface to include versioning --
see the attached pieces of code to get an idea how it works (there is
about 0.5MB of libraries hidden behind this small interface). However,
this is our first cut and by no means an ideal solution.

I would be therefore very much interested in any thoughts and ideas
you may have about this versioning ACE repository.

Best,
Premek

PS: A sort of advertisement: we have a bundle versioning service at
http://osgi.kiv.zcu.cz/obvs/ - you are invited to give it a try, I would be interested in any feedback.


-- 
Premek Brada (Ing et MSc, PhD)
  Lecturer in Software enginering, Erasmus coordinator, Webmaster
  Department of Computer Science and Engineering
  University of West Bohemia, Pilsen, CZ
  << brada at kiv.zcu.cz | www.kiv.zcu.cz/~brada/ | +420-377-63-2435 >>

--------------050302010302080603020401-- --------------020507030200050307040106 Content-Type: text/plain; name="VersionedBundleStore.java" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="VersionedBundleStore.java" /** * This is OSGi Bundle Compatibility Checker (OBCC) -- a toolset to verify * bundle compatibility using type checking on exported and imported * features. * * Copyright (c) 2007-2010 Department of Computer Science and Engineering, * University of West Bohemia, Pilsen, CZ * * This software and this file is available under the Creative Commons * Attribution-Noncommercial-Share Alike license. You may obtain a copy * of the License at http://creativecommons.org/licenses/ . * * This software is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License * for the specific language governing permissions and limitations. */ package org.apache.ace.obr.storage.versioning; import java.io.IOException; import java.io.InputStream; import org.apache.ace.obr.storage.BundleStore; /** * Extends the @see BundleStore by ability to store a bundle that is versioned along the way. * * @author Premek Brada * */ public interface VersionedBundleStore extends BundleStore { /** * Take the bundle from the provided data, update its version metadata by * comparing it with the latest revision of equally-named bundle in the repository, * create correct filename (symbolic name + updated bundle version), store result * in the repository via BundleStore.put(). Leaves and uses bundle version untouched * if this is the first revision of the bundle. * * @see org.apache.ace.obr.storage.BundleStore * * @param bundleData * Stream with the bundle content * @return The filename given to the bundle by the repository, null if not stored * * @throws IllegalArgumentException * When the data provided is not a valid bundle archive */ public String put(InputStream bundleData) throws IOException, IllegalArgumentException; } --------------020507030200050307040106 Content-Type: text/plain; name="Demo.java" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Demo.java" import org.apache.ace.obr.storage.versioning.VersionedBundleStore; /** * A simple standalone command line app to demonstrate the versioning interface * to ACE OBR file repository. * * @author Premek Brada * */ public class Demo { static String REPO_DIR_NAME = "repo"; private static int BUFFER_SIZE = 8 * 1024; @SuppressWarnings("deprecation") public static void main(String[] args) throws Exception { /* * repo needs data as InputStream, so create this from bundle .jar and then * work with it as if it was provided by higher level layer */ InputStream data = createBundleDataStream(args[0]); /* * versioned bundle store initialized manually (instead of properties injection) * for demonstration purposes, so BundleFileStore was modified by adding setters */ VersionedBundleStore store = setupBundleStore("." + File.separator + REPO_DIR_NAME); // store in the versioning repo String generatedFileName = null; try { generatedFileName = store.put(data); // argument is InputStream data; } catch (IllegalArgumentException e) { System.err.println("Exception on storing: " + e); } // observe the result if (generatedFileName != null) { System.out.println("File successfully stored with name '" + generatedFileName + "'"); } else { System.out.println("Error while storing file '" + args[0] + "'"); } } /* * ... private helper methods omitted */ } --------------020507030200050307040106--