Top Description Fields Constructors Methods
org.jruby.runtime.profile

public Class ProfilingServiceLookup

extends Object
Class Inheritance
Imports
org.jruby.Ruby, .RubyInstanceConfig, org.jruby.runtime.profile.builtin.BuiltinProfilingService, java.lang.reflect.InvocationTargetException

This helper is used to get the configured org.jruby.runtime.profile.ProfilingService for the current Ruby instance. Each Ruby instance has a org.jruby.runtime.profile.ProfilingServiceLookup property.
Author
Andre Kullmann

Field Summary

Modifier and TypeField and Description
private final Ruby
private ProfilingService
service

The service which is configured.

Constructor Summary

AccessConstructor and Description
public
ProfilingServiceLookup(final Ruby
the ruby instance this instance belongs to
runtime
)

Method Summary

Modifier and TypeMethod and Description
private RubyInstanceConfig
getConfig()

Getter to avoid direct property access.

private RubyInstanceConfig.ProfilingMode
getProfilingMode()

Getter to avoid direct property access.

private Ruby
getRuntime()

Getter to avoid direct property access.

public ProfilingService

Returns:

the configured org.jruby.runtime.profile.ProfilingService for the runtime.
getService
()

Returns runtime.

private String
getServiceClassName()

Getter to avoid direct property access.

private Class<? extends ProfilingService>
private synchronized ProfilingService

Returns:

The service instance which should be used.
newProfiler
()

Creates a new instance of the configured org.jruby.runtime.profile.ProfilingService instance.

private ProfilingService

Returns:

new instance created by reflection
newServiceInstance
()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

runtimeback to summary
private final Ruby runtime
serviceback to summary
private ProfilingService service

The service which is configured. Will be lazy loaded, and never changed.

Constructor Detail

ProfilingServiceLookupback to summary
public ProfilingServiceLookup(final Ruby runtime)
Parameters
runtime:Ruby

the ruby instance this instance belongs to

Exceptions
IllegalArgumentException:
if given runtime is null

Method Detail

getConfigback to summary
private RubyInstanceConfig getConfig()

Getter to avoid direct property access.

getProfilingModeback to summary
private RubyInstanceConfig.ProfilingMode getProfilingMode()

Getter to avoid direct property access.

getRuntimeback to summary
private Ruby getRuntime()

Getter to avoid direct property access.

getServiceback to summary
public ProfilingService getService()

Returns runtime. At first invocation newProfiler() is called to create a new instance of the configured org.jruby.runtime.profile.ProfilingService instance.

Returns:ProfilingService

the configured org.jruby.runtime.profile.ProfilingService for the runtime.

getServiceClassNameback to summary
private String getServiceClassName()

Getter to avoid direct property access.

loadServiceClassback to summary
private Class<? extends ProfilingService> loadServiceClass()
Returns:Class<? extends ProfilingService>

the configured org.jruby.runtime.profile.ProfilingService class.

Annotations
@SuppressWarnings:unchecked
newProfilerback to summary
private synchronized ProfilingService newProfiler()

Creates a new instance of the configured org.jruby.runtime.profile.ProfilingService instance.

Returns:ProfilingService

The service instance which should be used.

newServiceInstanceback to summary
private ProfilingService newServiceInstance()
Returns:ProfilingService

new instance created by reflection