Take a look at JRubyClassLoader and consumers of it. Basically if you
want to load raw bytecode, either from disk or in-memory, you need
your own ClassLoader subclass that exposes the defineClass(byte[] ...)
methods. From there, you can get Class instances and then construct
objects, etc, etc.

On Thu, May 13, 2010 at 9:10 PM, Davide Poletti <[email protected]> wrote:
> Hi,
>
> I'm a university student and I'm working to a project not really related to 
> JRuby
> and Ruby language but I'm still interested in some details about the JRuby 
> internal design.
>
> In particual I would like to understand how the JRuby interpreter loads the
> external java classes stored as bytecode and used them during the evaluation 
> of the rest of
> the code.
>
> I tried to look at the source code (of version 1.4) shoortly by myself and I 
> figure
> out that the code that manages this kind of operations should be located
> in the javasupport package.
>
> For what I could understand, in order to load an external java class the
> interpreter simply uses a dynamic class loader and the reflection
> package provided by the standard Java API.
> The loaded class is wrap in a proxy to interact with the other ruby
> modules.
>
> Could you please give me some more information about this specic JRuby 
> implementation aspect.
> Maybe just some hints to help me in the exploration of the source code.
>
> Thank you very much.
>
> Davide Poletti.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to