Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] j9 class sharing and CL.getResource

Hi Tom,

this is exactly what I was looking for. A mice simple solution like this. Thanks very much for this. Solves my problem perfectly.

Thanks again very very much!!!
-Martin




Thomas Watson wrote:
I have experienced similar issues, both with a shared classes adaptor and a
jxe adaptor on j9.  In both cases the issue can be worked around by doing
different things with the BundleEntry#getBytes() and
BundleEntry#getInputStream methods.  The getBytes() method is only used by
the classloader to get the byte[] to define the class.  This is where the
"magic bytes" with the identifier used by j9 class sharing should be
returned.  The getInputStream is used by the URLs CL.getResource.  In your
adaptor you can implement getInputStream to read the real bytes out of the
content of the bundle instead of using the shared classes cache bytes.
This should allow you to get the real bytes of the class file.

HTH.

Tom




From: Martin Lippert <lippert@xxxxxxx> To: Equinox Project <equinox-dev@xxxxxxxxxxx> Date: 03/03/2008 03:09 PM Subject: [equinox-dev] j9 class sharing and CL.getResource




Hi!

I have a question regarding J9 class sharing and the adaptor hooks: I
have an adaptor hook that uses specialized bundle file objects to
delegate to the j9 class sharing. This implementation is done for all
path parameters that end with ".class".

Now a library that I use calls CL.getResource for a class file to get
the bytecode of that class. In the case of j9 class sharing this call
returns just some identifier used by j9 class sharing instead of the
real bytecode.

Did you observe similar problems with j9 class sharing? Do you have any
idea how to solve this?

Thanks for your help!!!

Best regards,
-Martin

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev



------------------------------------------------------------------------

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev



Back to the top