Module: Cheri::JRuby

Defined in:
lib/cheri/jruby/explorer/common.rb,
lib/cheri/jruby/explorer/splash.rb,
lib/cheri/jruby/explorer/viewer.rb,
lib/cheri/jruby/explorer/dialogs.rb,
lib/cheri/jruby/explorer/dialogs-old.rb,
lib/cheri/jruby/jruby.rb

Defined Under Namespace

Modules: Explorer

Constant Summary collapse

JU =

:stopdoc:

JavaUtilities
JC =
::Java::JavaClass
RObj =
'org.jruby.RubyObject'

Class Method Summary collapse

Class Method Details

.get_class(name, proxy = true) ⇒ Object

call-seq:

get_class(class_name [,proxy=true]) -> class/interface proxy or JavaClass

Returns the proxy for the specified class or interface if proxy=true (the default); otherwise, returns the corresponding JavaClass. Getting a proxy class can be expensive (the first time it is referenced; subsequent calls retrieve it from cache). The proxy=false option is therefore provided so we can get the JavaClass, a much less expensive operation. The JavaClass cannot be instantiated, but is used in Cheri (Cheri::Swing and Cheri::AWT) for assignable_from? tests.



58
59
60
# File 'lib/cheri/jruby/jruby.rb', line 58

def get_class(name,proxy=true)
  proxy ? JU.get_proxy_class(name) : @unproxied[name] ||= JC.for_name(name)
end

.object_space?Boolean

Returns true if ObjectSpace is enabled.

Returns:

  • (Boolean)


68
69
70
# File 'lib/cheri/jruby/jruby.rb', line 68

def object_space?
  runtime.object_space_enabled?  
end

.runtimeObject

:nodoc:



61
62
63
# File 'lib/cheri/jruby/jruby.rb', line 61

def runtime #:nodoc:
  @runtime ||= ::JRuby.runtime
end

.start_timeObject

:nodoc:



64
65
66
# File 'lib/cheri/jruby/jruby.rb', line 64

def start_time #:nodoc:
  runtime.start_time  
end