Skip to content

Create friendlier API for swapping current thread context classloader #3090

@enebo

Description

@enebo
 java.lang.Thread.currentThread.setContextClassLoader( JRuby.runtime.jruby_classloader )

This works but since we have had 2-3 issues opened and we need to give a fairly complex snippet of code (above snippet) I think we should try and add something simpler to use:

require 'jruby'

JRuby.use_jruby_classloader

where:

def self.use_jruby_classloader(thread=java.lang.Thread.currentThread)
end

I spent about 10 seconds coming up with this so it is mostly just an attempt at getting people to think how we can make this simpler. Also do we need to care about more than context classloaders?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions