This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: dynamic library loading?


On Jun 23, 1999, Tom Tromey <tromey@cygnus.com> wrote:

>>>>>> "Alexandre" == Alexandre Oliva <oliva@dcc.unicamp.br> writes:
Alexandre> In a sense, all gcj methods are native, it seems to me that
Alexandre> it would make sense to use System.loadLibrary to load them.
Alexandre> I'm quite aware that loading a class is more than just
Alexandre> loading in its methods, but it appears to be a natural
Alexandre> extension to me.

> I disagree.  I think changing System.loadLibrary would be a mistake --
> we would be changing the semantics of the method.

Absolutely!  The semantics of the method cannot be specified, because
a shared library may have arbitrary initialization code.  Any shared
library's initializer could tell the system class loader to define a
couple of classes.  That's exactly what I'm suggesting it could do in
libgcj.

> Instead I think we should implement a ClassLoader which knows how to
> load shared libraries and define classes based on the contents.

I'm not sure I understand how you'd tell this ClassLoader to load the
classes of a particular shared library.  In fact, I don't understand
why you'd need adifferent ClassLoader at all.

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
{oliva,Alexandre.Oliva}@dcc.unicamp.br  aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
*** E-mail about software projects will be forwarded to mailing lists


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]