(Noticed it on second read) BTW, getClassLoader() _may_ return null
for bootstrap class loader. AFAIR, IBM's VME provides Java class
loader instance for bootstrap class loader.
The other thing is that for all classes that belongs to class library
a call to getClassLoader must return the same value (either null or
real class loader instance). If it's an instance it may then delegate
to corresponding bundle loaders based on package or class name, but
the implementation have to make sure that a call to getClassLoader
returns this top level instance but not the bundle loader to which
real loading was delegated.
Pavel.
On Tue, Jun 2, 2009 at 12:27 PM, Pavel Pervov <pmcfirst@gmail.com> wrote:
> Carlos,
>
> AFAIU, the idea was to move harmony class library to use OSGi style
> (perbundle) loading. That's why it is necessary to stuff it into
> DRLVM.
>
> WBR,
> Pavel.
>
> 2009/6/2 Carlos Torrão <carlos.torrao@gmail.com>:
>> The eclipse equinox implements the OSGi Framework only in Java, since the
>> file comes in .jar file and can run in every JVM.
>>
>> I tried to start the OSGi implementation of equinox with Harmony and it
>> worked fine.
>>
>> java jar org.eclipse.osgi_3.4.0.v200806051900 console
>>
>> Don't understand why do you need to change this JVM to implement OSGi...
>>
>> Best regards,
>> Carlos Torrão
>>
>>
>> 2009/5/20 Pavel Pervov <pmcfirst@gmail.com>
>>
>>> Sure. I've posted from mobile, and my multitap betrayed me. Thanks, Mark.
>>>
>>> 2009/5/20, Mark Hindess <mark.hindess@googlemail.com>:
>>> >
>>> > In message <e0f125db0905190627l72e6894fuc6904e92f37c27d4@mail.gmail.com
>>> >,
>>> > Pavel Pervov writes:
>>> >>
>>> >> Please, read this nice presentation [1] on osgi vs classic class
>>> loading.
>>> >> [1]
>>> >>
>>> http://www.martinliqert.com/events/WJAX2008ClassloadingTypeVisibilityOSGi.pdf
>>> >
>>> > I assume you mean:
>>> >
>>> >
>>> >
>>> http://www.martinlippert.org/events/WJAX2008ClassloadingTypeVisibilityOSGi.pdf
>>> >
>>> > Mark.
>>> >
>>> >> 2009/5/19, tian galaxy <harmonymail.ty@gmail.com>:
>>> >> > XiaoFeng , Mark
>>> >> > Thanks for your help ,very valuable to me.
>>> >> > I think I need to research more on this .Much more complex than
I
>>> >> > thought
>>> >> > previously.
>>> >> >
>>> >> >
>>> >> > Regard
>>> >> > Tian
>>> >> >
>>> >> > 2009/5/19 XiaoFeng Li <xiaofeng.li@gmail.com>
>>> >> >
>>> >> >> On Tue, May 19, 2009 at 6:41 PM, Mark Hindess
>>> >> >> <mark.hindess@googlemail.com> wrote:
>>> >> >> >
>>> >> >> > In message
>>> >> >> > <dff214c70905190147x57135ef3hf26cbf6a93ae2255@mail.gmail.com>,
>>> >> >> tian
>>> >> >> > galaxy writes:
>>> >> >> >>
>>> >> >> >> Hindess .Thanks for the help ! I realized that this
far more
>>> complex
>>> >> >> than I
>>> >> >> >> thought before .
>>> >> >> >> So I think I need a deeper look into both osgi and
harmony .
>>> >> >> >> Here are several things I don't qiute understand and
I noted them
>>> >> >> below.May
>>> >> >> >> be it's because I am not quite familiar with the low
level ,
>>> >> >> classloading
>>> >> >> >> details .
>>> >> >> >> thanks!
>>> >> >> >>
>>> >> >> >> 2009/5/19 Mark Hindess <mark.hindess@googlemail.com>
>>> >> >> >> >
>>> >> >> >> > In message <
>>> >> >> dff214c70905180610w407e3bd4h5baa319729c1fc55@mail.gmail.com>,
>>> >> >> >> > tian galaxy writes:
>>> >> >> >> > >
>>> >> >> >> > > OK ,thanks .Seems the minimal class set
has been defined by
>>> the
>>> >> >> osgi.
>>> >> >> >> >
>>> >> >> >> > Not sure how this helps though. The OSGi Minimum
Execution
>>> >> >> Environment
>>> >> >> >> > says what is theoretically the minimum required
to run OSGi.
>>> What
>>> >> >> >> > we
>>> >> >> >> > need to concern ourselves with is the *practical*
minimum and
>>> that
>>> >> >> >> > really depends on our implementation details.
>>> >> >> >> >
>>> >> >> >> > I don't think that we should implement OSGi in
the VM. Instead
>>> >> >> >> > the
>>> >> >> >> > existing bootstrap classloader should load the
OSGi framework
>>> >> >> >> > (with
>>> >> >> >> > a unique classloader)
>>> >> >> >>
>>> >> >> >> If we load the osgi with the bootstrap class loader
, why comes a
>>> >> >> >> unique
>>> >> >> >> class loader?
>>> >> >> >
>>> >> >> > It isn't necessary but I think it is useful to use a separate
>>> >> >> > classloader for the OSGi framework so that we can isolate
the
>>> classes
>>> >> >> > use by the VM's OSGi framework and avoid polluting the
namespace.
>>> >> >> >
>>> >> >> >> Do you mean the bootstrap class loader should delegate
the loading
>>> >> >> >> to
>>> >> >> >> the 'unique class loader '?
>>> >> >> >
>>> >> >> > Yes.
>>> >> >> >
>>> >> >> >> > and the system classes (with a "temporary" classloader).
>>> >> >> >>
>>> >> >> >> Again ,the relation between temporary and bootstrap
classloder?
>>> And
>>> >> >> >> why temporary ?
>>> >> >> >
>>> >> >> > Temporary because until the OSGi framework is up you wont
know
>>> which
>>> >> >> > bundle the classes belong to and thus wont know which
bundle
>>> >> >> > classloader
>>> >> >> > the classes should belong to. Alternatively, I suppose
you could
>>> >> >> > implement minimal support for reading OSGi headers from
manifests
>>> >> >> > in the VM so that you could assign classes to what would
become a
>>> >> >> > bundle
>>> >> >> > classloader when the framework is up.
>>> >> >> >
>>> >> >> > Mark.
>>> >> >>
>>> >> >>
>>> >> >> This makes sense to me. The VM simply grabs in all the stuff
"as
>>> >> >> usual" including the OSGi framework, then sort them out according
to
>>> >> >> the bundles' definitions.
>>> >> >>
>>> >> >> It could be VMneutral, because it is the VM's own business
to take
>>> >> >> care of its loaded classes. A callback interface OSGI_ready()
can
>>> >> >> inform the VM to tidy up the classes loaded for OSGi (or before
it is
>>> >> >> ready).
>>> >> >>
>>> >> >> Thanks,
>>> >> >> xiaofeng
>>> >> >>
>>> >> >>
>>> >> >> >> > Once the OSGi framework is configured the system
classes need
>>> to
>>> >> >> >> > be
>>> >> >> >> > moved to the correct classloader for the OSGi
bundle to which
>>> they
>>> >> >> >> > belong.
>>> >> >> >> >
>>> >> >> >> > This means that during the initial startingOSGiframework
phase
>>> >> >> >> > the OSGi bundle import/exports will not be enforced
but, other
>>> >> >> >> > than
>>> >> >> >> > implementing OSGi in the VM, I don't see how
to avoid this.
>>> >> >> >> >
>>> >> >> >> > The multiplicity of bootstrap classloaders still
needs to be
>>> >> >> >> > hidden
>>> >> >> >> > since the API demands that getClassLoader should
return null for
>>> >> >> >> > the
>>> >> >> >> > bootstrap classloader(s).
>>> >> >> >> >
>>> >> >> >> > The biggest problem is probably how to implement
this as
>>> >> >> VMindependent
>>> >> >> >> > API such that a VM wanting to implement OSGi
had to provide only
>>> a
>>> >> >> >> > minimal C/Java interface in order to gain OSGi
support.
>>> >> >> >> >
>>> >> >> >> > Regards,
>>> >> >> >> > Mark.
>>> >> >> >> >
>>> >> >> >> > > I will look more closely on this problems
and let you know if
>>> >> >> >> > > there
>>> >> >> some
>>> >> >> >> > > progresses made.
>>> >> >> >> > > Thanks a lot !
>>> >> >> >> >
>>> >> >> >> > > 2009/5/18 Pavel Pervov <pmcfirst@gmail.com>
>>> >> >> >> > >
>>> >> >> >> > > > I do not know osgi model in detail,
but what minimal set of
>>> >> >> classes is
>>> >> >> >> > > > needed to start osgi model itself?
Then we could delegate to
>>> >> >> "system"
>>> >> >> >> > > > bundle loader from bootstrap classloader.
>>> >> >> >> > > >
>>> >> >> >> > > > 2009/5/18, tian galaxy <harmonymail.ty@gmail.com>:
>>> >> >> >> > > > > Yes , implement osgi loading model
in there is too
>>> complex.
>>> >> >> >> > > > >
>>> >> >> >> > > > > We know some modules are more
important than others ,
>>> >> >> >> > > > > performing
>>> >> >> some
>>> >> >> >> > > > > fundamental , basic functions
.
>>> >> >> >> > > > > Is it possible to only load these
more" basic " modules
>>> with
>>> >> >> >> > bootstrap
>>> >> >> >> > > > class
>>> >> >> >> > > > > loader and make the other modules
work the osgi bundle?
>>> >> >> >> > > > > Actually I don't quite understand
why system classes could
>>> >> >> >> > > > > only
>>> >> >> be
>>> >> >> >> > loaded
>>> >> >> >> > > > by
>>> >> >> >> > > > > bootstrap class loader?I noticed
that there are some
>>> safety
>>> >> >> concerns
>>> >> >> >> > > > > ,is there any reasons other than
that?
>>> >> >> >> > > > > Thanks !
>>> >> >> >> > > > >
>>> >> >> >> > > > >
>>> >> >> >> > > > > 2009/5/18 Pavel Pervov <pmcfirst@gmail.com>
>>> >> >> >> > > > >
>>> >> >> >> > > > >> Short answer is "no". You'll
have to implement osgi
>>> loading
>>> >> >> model
>>> >> >> >> > > > >> inside bootstrap classloader.
Is it too complex?
>>> >> >> >> > > > >>
>>> >> >> >> > > > >> 2009/5/18, tian galaxy <harmonymail.ty@gmail.com>:
>>> >> >> >> > > > >> > Hi Pavel.
>>> >> >> >> > > > >> >
>>> >> >> >> > > > >> > Thanks.
>>> >> >> >> > > > >> > Yes ,that's right .My
question is whether there is a
>>> way
>>> >> >> >> > > > >> > to
>>> >> >> load
>>> >> >> >> > the
>>> >> >> >> > > > >> system
>>> >> >> >> > > > >> > class by class loader
other than the bootstrap class
>>> >> >> >> > > > >> > loader
>>> >> >> ?
>>> >> >> >> > > > >> > If we could load the
system class by different loaders
>>> >> >> >> > > > >> > other
>>> >> >> than
>>> >> >> >> > the
>>> >> >> >> > > > >> > bootstrap class loader
then there is a chance to make
>>> the
>>> >> >> harmony
>>> >> >> >> > > > >> > runtime
>>> >> >> >> > > > >> to
>>> >> >> >> > > > >> > be osgied.
>>> >> >> >> > > > >> > I trying to work on this
problem . Do you have any
>>> >> >> suggestions ?
>>> >> >> >> > > > >> >
>>> >> >> >> > > > >> >
>>> >> >> >> > > > >> > 2009/5/18 Pavel Pervov
<pmcfirst@gmail.com>
>>> >> >> >> > > > >> >
>>> >> >> >> > > > >> >> Tian,
>>> >> >> >> > > > >> >> System classes are
all loaded with bootstrap
>>> >> >> >> > > > >> >> classloader.
>>> >> >> >> > > > >> >> It
>>> >> >> is
>>> >> >> >> > > > >> >> written in C++ and
is located in
>>> >> >> >> > > > >> >> working_vm/vm/vmcore/src/class_support/classloader.cpp
>>> >> >> >> > > > >> >>
>>> >> >> >> > > > >> >> 2009/5/17, tian galaxy
<harmonymail.ty@gmail.com>:
>>> >> >> >> > > > >> >> > Hi all
>>> >> >> >> > > > >> >> > I have a question
about the classloading in the
>>> drlvm.
>>> >> >> >> > > > >> >> >
>>> >> >> >> > > > >> >> > I know that
there are kernel library inside the
>>> drlvm
>>> >> >> >> > > > >> >> > such
>>> >> >> as
>>> >> >> >> > > > >> >> > java.lang.classloader,
which enclose the the
>>> >> >> systemclassloader.
>>> >> >> >> > And
>>> >> >> >> > > > >> this
>>> >> >> >> > > > >> >> > class is loaded
and used in the process of creating
>>> VM
>>> >> >> >> > > > >> >> > .
>>> >> >> >> > > > >> >> > While the systemclassloader
is a subtype of
>>> >> >> >> > > > >> >> > urlclassloader
>>> >> >> >> > which is
>>> >> >> >> > > > >> >> > in
>>> >> >> >> > > > >> >> the
>>> >> >> >> > > > >> >> > "luni" module.So
does the JNI_CreateJavaVM
>>> >> >> >> > > > >> >> > also load the
urlclassloader in the boot procedure
>>> of
>>> >> >> >> > > > >> >> > vm
>>> >> >> ?(I
>>> >> >> >> > failed
>>> >> >> >> > > > >> >> > to
>>> >> >> >> > > > >> >> > search related
code in the source code of drlvm).
>>> >> >> >> > > > >> >> > If so , when
?Before or after the jni available ?
>>> >> >> >> > > > >> >> > Since I am trying
to implement the osgi on harmony
>>> and
>>> >> >> >> > > > >> >> > the
>>> >> >> osgi
>>> >> >> >> > > > works
>>> >> >> >> > > > >> >> with
>>> >> >> >> > > > >> >> > bundles (modules)
, I think I need to know the
>>> >> >> >> > > > >> >> > procedure
>>> >> >> of
>>> >> >> >> > booting
>>> >> >> >> > > > >> and
>>> >> >> >> > > > >> >> > loading of class
from different modules at the start
>>> >> >> >> > > > >> >> > up
>>> >> >> time.
>>> >> >> >> > > > >> >> > Any clue about
this ?Thanks
>>> >> >> >> > > > >> >> >
>>> >> >> >> > > > >> >> > plus,do we have
the source code of java.exe ?Where?
>>> >> >> >
>>> >> >> >
>>> >> >> >
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >> 
>>> >> >> http://people.apache.org/~xli <http://people.apache.org/%7Exli>
>>> >> >>
>>> >> >
>>> >> >
>>> >> >
>>> >> > 
>>> >> > Regards
>>> >> > Michael Tian
>>> >> >
>>> >>
>>> >
>>> >
>>> >
>>>
>>
>
