Package org.jruby.ext.jruby
Class JRubyLibrary
java.lang.Object
org.jruby.ext.jruby.JRubyLibrary
- All Implemented Interfaces:
Library
Native part of require 'jruby', e.g. provides methods for swapping between the normal Ruby reference to an
object and the Java-integration-wrapped reference.
Parts of JRuby name-space are loaded even without
require 'jruby'
, those live under JRuby::Util.- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IRubyObject
compile
(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) static IRubyObject
compile_ir
(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) static IRubyObject
dereference
(ThreadContext context, IRubyObject recv, IRubyObject obj) Unwrap the given Java-integration-wrapped object, returning the unwrapped object.static IRubyObject
identity_hash
(ThreadContext context, IRubyObject recv, IRubyObject obj) Provide the "identity" hash code that System.identityHashCode would produce.static RubyBoolean
Deprecated.static RubyBoolean
is_security_restricted
(ThreadContext context, IRubyObject recv) void
static IRubyObject
load_string_ext
(ThreadContext context, IRubyObject recv) Deprecated.static IRubyObject
parse
(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) static IRubyObject
parse_result
(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) static IRubyObject
reference
(ThreadContext context, IRubyObject recv, IRubyObject obj) Wrap the given object as in Java integration and return the wrapper.static IRubyObject
reference0
(ThreadContext context, IRubyObject recv, IRubyObject obj) Wrap the given object as in Java integration and return the wrapper.static IRubyObject
runtime
(ThreadContext context, IRubyObject recv) static IRubyObject
set_context_class_loader
(ThreadContext context, IRubyObject recv, IRubyObject[] args) static IRubyObject
set_security_restricted
(IRubyObject recv, IRubyObject arg) static IRubyObject
subclasses
(ThreadContext context, IRubyObject recv, IRubyObject arg) static IRubyObject
subclasses
(ThreadContext context, IRubyObject recv, IRubyObject arg, IRubyObject opts) static IRubyObject
with_current_runtime_as_global
(ThreadContext context, IRubyObject recv, Block block) Run the provided (required) block with the "global runtime" set to the current runtime, for libraries that expect to operate against the global runtime.
-
Constructor Details
-
JRubyLibrary
public JRubyLibrary()
-
-
Method Details
-
load
-
reference
Wrap the given object as in Java integration and return the wrapper. This version uses ObjectProxyCache to guarantee the same wrapper is returned as long as it is in use somewhere. -
reference0
Wrap the given object as in Java integration and return the wrapper. This version does not use ObjectProxyCache. -
runtime
-
dereference
Unwrap the given Java-integration-wrapped object, returning the unwrapped object. If the wrapped object is not a Ruby object, an error will raise. -
with_current_runtime_as_global
public static IRubyObject with_current_runtime_as_global(ThreadContext context, IRubyObject recv, Block block) Run the provided (required) block with the "global runtime" set to the current runtime, for libraries that expect to operate against the global runtime. -
set_context_class_loader
public static IRubyObject set_context_class_loader(ThreadContext context, IRubyObject recv, IRubyObject[] args) -
is_security_restricted
-
is_security_restricted
Deprecated. -
set_security_restricted
-
identity_hash
Provide the "identity" hash code that System.identityHashCode would produce. Added here as an extension because calling System.identityHashCode (and other Java-integration-related mechanisms) will cause some core types to coerce to Java types, losing their proper identity. -
parse
public static IRubyObject parse(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) -
parse_result
public static IRubyObject parse_result(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) -
compile_ir
public static IRubyObject compile_ir(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) -
compile
public static IRubyObject compile(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) -
load_string_ext
Deprecated. -
subclasses
-
subclasses
public static IRubyObject subclasses(ThreadContext context, IRubyObject recv, IRubyObject arg, IRubyObject opts)
-