Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 12515 invoked from network); 18 Aug 2009 05:38:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Aug 2009 05:38:30 -0000 Received: (qmail 22169 invoked by uid 500); 18 Aug 2009 05:38:49 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 22106 invoked by uid 500); 18 Aug 2009 05:38:49 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 22095 invoked by uid 99); 18 Aug 2009 05:38:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Aug 2009 05:38:49 +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 (athena.apache.org: domain of tian.galaxy@gmail.com designates 209.85.217.213 as permitted sender) Received: from [209.85.217.213] (HELO mail-gx0-f213.google.com) (209.85.217.213) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Aug 2009 05:38:41 +0000 Received: by gxk9 with SMTP id 9so4139967gxk.13 for ; Mon, 17 Aug 2009 22:38:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=c4mGxHM2WlVFh6tRMAcc/2qec3TeWd2qnzdpk8z5tTA=; b=fsugRJ+0Lxpsx0mKeouV3hLFBMX7psD2jMwxcmYAaEKf09p3p/X12YtDHllmPzCKsN 6SLoK3F2WmFbsq60XqNaSCcf6uaIoN6ERq37OxtWCw0zUkWy8vMJDyMaU7bv74qZhEJg 1pe5eMTEiq9NhgT3oX+uyesQwTXSpDQY46Hew= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=WNZonFcc28auHYhLXvsJPqRL9ua1Jc10ZUBVL1i6wUCLB+zjt472x35LPcx6Av1J/i MhlojhuU/eO1/hcwDAzMugDbkhIUpyM7MzGDMBTXE10lLQ2syiRV2YuIQtlsizzHA3Og ctmrujfNZSeqaV8Zf+6Q5s2jxzxW/1urpRzKE= MIME-Version: 1.0 Received: by 10.231.34.3 with SMTP id j3mr2830562ibd.43.1250573899523; Mon, 17 Aug 2009 22:38:19 -0700 (PDT) In-Reply-To: <5c8e69f0908172223u32d22782j4bf1938f5bcf5b7e@mail.gmail.com> References: <9623c9a50908160121n3191cec2kcb4324afd7d9daf0@mail.gmail.com> <795657be0908160247s23a55f98kb3ac12f7ec8a8d25@mail.gmail.com> <795657be0908160407y10640baav9a183386fdf1a53@mail.gmail.com> <5c8e69f0908172223u32d22782j4bf1938f5bcf5b7e@mail.gmail.com> Date: Tue, 18 Aug 2009 13:38:19 +0800 Message-ID: Subject: Re: The OSGi-Harmony Runtime From: galaxy To: dev@harmony.apache.org Content-Type: multipart/alternative; boundary=00221532cda40be7b2047163ed4d X-Virus-Checked: Checked by ClamAV on apache.org --00221532cda40be7b2047163ed4d Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 2009/8/18 Jimmy,Jing Lv > Hi, > > I've create a new page on Wiki: > http://wiki.apache.org/harmony/OSGi-Harmony_Runtime , everyone can refine > it > at any time. > And TianYu, I see your new JIRAs on the JIRA system, I will check and > apply it. > > BTW TianYu, just a suggestion, if you add "[GSoC]" before the mail/ji= ra > title, it may be more clear to find and read :) > OK ,thanks > > 2009/8/16 galaxy > > > Hi Mingjian, > > Maybe I am not clear enough in the introduction :) > > > > The main theme of the work is to let some of the modules to be governed > by > > the OSGi framework and then > > make the whole " jre + felix + osgi bundles (modules) " a working > runtime > > of java ,could run the java applications > > in the normal way .The transparency from the user side I think. > > > > > > 2009/8/16 Jin Mingjian > > > > > galaxy, still good work:) I am not the man to evaluate your work:) > > > > > > your work =3D mini Harmony jre + Felix? > > > > > > such as one question: > > > how your runtime works? > > > > I think the best outcome is that it can work the same as a normal JRE > from > > the user's point of view > > > > > Does it support mixed jar usage?(seem your "For B"? > > > A bundle jar can be seen as a bundle or a pure application jar depend= ed > > on > > > the context. there are some interesting things happened here) > > > > the classloading mechanism I listed in the review determines that > classes > > in the osgi > > bundle will come before app , so if the same jar files acts as a bundle > and > > at the same time a app jar , the app jar file is useless I think. > > > > > > > > > > > > > > > > > > > > 2009/8/16 galaxy > > > > > > > I'm sorry but I think you should have missed some thing in the revi= ew > > > .the > > > > OSGi framework I use is Felix, and all the security and dynamic com= es > > > from > > > > it and built in with it, > > > > if you want to find the osgi-ed security and dynamic > > > > does this answer your question ? > > > > > > > > 2009/8/16 Jin Mingjian > > > > > > > > > interesting. I'd like to mainly examine the dynamic and security = of > > > > > your OSGi-Harmony runtime when the codes is ready. > > > > > > > > > > 2009/8/16 Xiao-Feng Li > > > > > > > > > > > Good work! How much is the size of the minimum OSGi-ed JRE? > > > > > > > > > > > > Thanks, > > > > > > xiaofeng > > > > > > > > > > > > On Sun, Aug 16, 2009 at 3:22 PM, galaxy > > > wrote: > > > > > > > Hi all > > > > > > > Now the code for OSGi-ed Runtime of Harmony is almost > complete > > , > > > > I'd > > > > > > > like to give a review of > > > > > > > the work so far.The code and usage will be uploaded together > soon > > > > > > > > > > > > > > Introduction To OSGi-ed JRE > > > > > > > > > > > > > > > > > > > > > > > > > > > > 1 : The main purpose > > > > > > > > > > > > > > OSGi has become one of the best ways to govern the jar files = in > a > > > > > number > > > > > > of > > > > > > > applications Such as the power it exhibits in eclipse .And as > we > > > all > > > > > know > > > > > > > ,the Harmony runtime is a modularized one and each module , > with > > > its > > > > > > > manifest file , is just like one bundle in the OSGi framework > .So > > > we > > > > > are > > > > > > > think of governing the modules in Harmony runtime in a OSGi-e= d > > way. > > > > > > > > > > > > > > > > > > > > > > > > > > > > 2 : Ways to meet the main purpose > > > > > > > > > > > > > > Naturally, there are two ways to meet this purpose: > > > > > > > > > > > > > > A Implementing the OSGi framework in VM in C/C++ to govern a= ll > > the > > > > > java > > > > > > > modules > > > > > > > > > > > > > > B Using one of the OSGi-ed framework implemented in java to > > > > > implemented > > > > > > a > > > > > > > half OSGi-ed JRE. > > > > > > > > > > > > > > Finally I picked the plan B with the well known OSGi > > > framework > > > > > > :Felix > > > > > > > .And the reasons are as follows > > > > > > > > > > > > > > First : Implementing a OSGi-ed framework from scratch in c/c+= + > in > > > the > > > > > vm > > > > > > is > > > > > > > difficult and time-consuming . > > > > > > > > > > > > > > Second : Plan A suffers from the facts that implementations > > differs > > > > > huge > > > > > > > from VM to VM .Plan B won=92t have this kind of problem as lo= ng > as > > > the > > > > > > modules > > > > > > > comply with the OSGi specifications and we have a adapted > > java.exe > > > , > > > > > the > > > > > > > rest is nearly the same. > > > > > > > > > > > > > > Third : Beside the framework ,each OSGi implementation has a > lot > > of > > > > > > add-ons > > > > > > > .This will facilitate future development of new features and > > > > utilities > > > > > > .For > > > > > > > example : the could use the bundle fileinstall to install all > the > > > jar > > > > > > files > > > > > > > lies in a folder ,very helpful in certain circumstances.This > > could > > > be > > > > > > done > > > > > > > rapidly if we choose plan B . > > > > > > > > > > > > > > > > > > > > > > > > > > > > 3 : Problems and fixes > > > > > > > > > > > > > > The difficulties ,or the main tasks ,of this project are as > > follows > > > > > > > > > > > > > > A Find the minimum working environment of OSGi-framework > and > > > > modify > > > > > > the > > > > > > > rest modules in Harmony ,mainly the manifest file ,to resolve > the > > > > > > coupling > > > > > > > > > > > > > > B Modify the classloading mechanism and booting of the jr= e > to > > > be > > > > > able > > > > > > > run normal java applications > > > > > > > > > > > > > > And the fixes are > > > > > > > > > > > > > > For A: > > > > > > > > > > > > > > Harmony is a modularized runtime .So determine the minimum > > working > > > > > > > environment is no more than choose the right module to stay > with > > > the > > > > VM > > > > > > > .However ,although the coupling is little , it does exist . S= o > a > > > > > > > modification of the module is necessary ,mainly the manifest > file > > > > .And > > > > > as > > > > > > I > > > > > > > want to remain the original structure of Harmony as largely = as > > > > > possible > > > > > > > ,more contents (classes ) will be included in the minimum > > > environment > > > > > > other > > > > > > > than splitting the modules apart .The final jre include the > > > following > > > > > > > component : > > > > > > > > > > > > > > > > > > > > > > > > > > > > luni.jar > > > > > > > > > > > > > > annotation.jar > > > > > > > > > > > > > > security.jar > > > > > > > > > > > > > > math.jar > > > > > > > > > > > > > > text.jar > > > > > > > > > > > > > > regex.jar > > > > > > > > > > > > > > noi_char.jar > > > > > > > > > > > > > > nio.jar > > > > > > > > > > > > > > logging.jar > > > > > > > > > > > > > > concurrent.jar > > > > > > > > > > > > > > archive.jar > > > > > > > > > > > > > > the ICU4J folder. > > > > > > > > > > > > > > > > > > > > > > > > > > > > The remaining jars are governed by the OSGi framework to > handle. > > > One > > > > > more > > > > > > > thing to mention is the two classes > > > > > > > > > > > > ,=94java.beans.PropertyChangelinstener=94,=94java.beans.PropertyChangeEve= nt=94 > > > > > > has > > > > > > > to be moved out of beans.jar .This is because of the coupling > of > > > > > > beans.jar > > > > > > > with other modules in the minimum runtime .Well the good thin= g > is > > > > these > > > > > > two > > > > > > > classes havn=92t imports any other classes in the modules > governed > > by > > > > the > > > > > > OSGi > > > > > > > framework .I think we could include them in any modules lie i= n > > the > > > > > > minimum > > > > > > > runtime as long as the VM could find them . > > > > > > > > > > > > > > > > > > > > > > > > > > > > For B: > > > > > > > > > > > > > > I added one extra sphere between the VM and the main class to > run > > > > > > > .org.apache.osgi.FelixStarter. , the following is done in thi= s > > > class > > > > > > > > > > > > > > First: Loading the configurations and Start Felix ,the OSGi > > > framework > > > > > we > > > > > > use > > > > > > > > > > > > > > Second: Initializing the class org.apache.osgi.OsgiClassLoade= r > > > ,this > > > > > > class > > > > > > > will load the main class and subsequently all the classes use= d > in > > > the > > > > > > main > > > > > > > class > > > > > > > > > > > > > > Third: Transfer the arguments to the =93real =93 main class ,= invoke > > the > > > > > main > > > > > > > method . > > > > > > > > > > > > > > > > > > > > > > > > > > > > The sequence of class loading is as follows : > > > > > > > > > > > > > > > > > > > > > > > > > > > > First : Check the class name to determine whether it should b= e > > > loaded > > > > > by > > > > > > the > > > > > > > parent class loader .This work is done by specifying the > > > > > > > =93org.osgi.framework.bootdelegation=94 property to include a= ll the > > > > package > > > > > > > names in the modules stays in the VM . > > > > > > > > > > > > > > Second : load the classes in the bundle governed by the > framework > > > .I > > > > > will > > > > > > > examine each bundle's export and import property to search fo= r > > the > > > > > class > > > > > > > name ; > > > > > > > > > > > > > > Third : the classes in the application=92s class path . > > > > > > > > > > > > > > Finally : we could not find the class and a > > ClassNotFoundException > > > > will > > > > > > be > > > > > > > thrown . > > > > > > > > > > > > > > > > > > > > > > > > > > > > Both the OSGi framework and the Harmony do not allow the defi= ne > , > > > > > imports > > > > > > or > > > > > > > exports of java.* classes and packages ,so a lot of examines > has > > > been > > > > > > > removed to facilitate our purpose . > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > regards > > > > > > > Tian > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > http://people.apache.org/~xli > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > regards > > > > Tian > > > > > > > > > > > > > > > -- > > regards > > Tian > > > > > > -- > > Best Regards! > > Jimmy, Jing Lv > China Software Development Lab, IBM > --=20 regards Tian --00221532cda40be7b2047163ed4d--