Package org.jruby.runtime.profile
Class ProfilingServiceLookup
java.lang.Object
org.jruby.runtime.profile.ProfilingServiceLookup
This helper is used to get the configured
ProfilingService for the current Ruby instance.
Each Ruby instance has a ProfilingServiceLookup property.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Rubyprivate ProfilingServiceThe service which is configured. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate RubyInstanceConfigGetter to avoid direct property access.private RubyInstanceConfig.ProfilingModeGetter to avoid direct property access.private RubyGetter to avoid direct property access.Returnsruntime.private StringGetter to avoid direct property access.private Class<? extends ProfilingService>private ProfilingServiceCreates a new instance of the configuredProfilingServiceinstance.private ProfilingService
-
Field Details
-
runtime
-
service
The service which is configured. Will be lazy loaded, and never changed.
-
-
Constructor Details
-
ProfilingServiceLookup
- Parameters:
runtime- the ruby instance this instance belongs to- Throws:
IllegalArgumentException- if given runtime is null
-
-
Method Details
-
getService
Returnsruntime. At first invocationnewProfiler()is called to create a new instance of the configuredProfilingServiceinstance.- Returns:
- the configured
ProfilingServicefor theruntime.
-
getRuntime
Getter to avoid direct property access. -
getConfig
Getter to avoid direct property access. -
getProfilingMode
Getter to avoid direct property access. -
getServiceClassName
Getter to avoid direct property access. -
newProfiler
Creates a new instance of the configuredProfilingServiceinstance.- Returns:
- The service instance which should be used.
-
newServiceInstance
- Returns:
- new instance created by reflection
-
loadServiceClass
- Returns:
- the configured
ProfilingServiceclass.
-