Top Description Inners Fields Constructors Methods
org.jruby

public Class RubyInstanceConfig

extends Object
Class Inheritance
Imports
jnr.posix.util.Platform, org.jruby.common.RubyWarnings, org.jruby.exceptions.MainExitException, org.jruby.runtime.Constants, org.jruby.runtime.backtrace.TraceType, org.jruby.runtime.load.LoadService, org.jruby.runtime.profile.builtin.ProfileOutput, org.jruby.util.ClassesLoader, .ClasspathLauncher, .FileResource, .Loader, .InputStreamMarkCursor, .JRubyFile, .KCode, .SafePropertyAccessor, .StringSupport, .UriLikePathHelper, org.jruby.util.cli.ArgumentProcessor, .Options, .OutputStrings, org.objectweb.asm.Opcodes, java.io.*, java.nio.charset.StandardCharsets, java.util.ArrayList, .Collection, .Collections, .EnumSet, .HashMap, .HashSet, .LinkedHashSet, .List, .Map, .Set, java.util.concurrent.CopyOnWriteArrayList, java.util.regex.Pattern

A structure used to configure new JRuby instances. All publicly-tweakable aspects of Ruby can be modified here, including those settable by command- line options, those available through JVM properties, and those suitable for embedding.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
public static interface
public static enum
public static enum

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
_nativeEnabled

Whether native code is enabled for this configuration.

private boolean
private String[]
private boolean
private boolean
private boolean
private boolean
private Integer
private boolean
public static final boolean
CAN_SET_ACCESSIBLE

Deprecated
public static final boolean
CEXT_ENABLED

Deprecated
public static final int
public static final int
CHAINED_COMPILE_LINE_COUNT_DEFAULT

Deprecated
Default size for chained compilation.
public static final String
COMPILE_EXCLUDE

Comma-separated list of methods to exclude from JIT compilation.

private RubyInstanceConfig.CompileMode
public static final boolean
CONSISTENT_HASHING_ENABLED

Whether to calculate consistent hashes across JVM instances, or to ensure un-predicatable hash values using SecureRandom.

public static final boolean
COROUTINE_FIBERS

Deprecated
private RubyInstanceConfig.LoadServiceCreator
private String
private boolean
public static final boolean
DEBUG_LAUNCHING

Turn on debugging of subprocess launching.

public static final boolean
DEBUG_LOAD_SERVICE

Turn on debugging of the load service (requires and loads).

public static final boolean
DEBUG_LOAD_TIMINGS

Turn on timings of the load service (requires and loads).

public static final boolean
public static final boolean
DEBUG_SCRIPT_RESOLUTION

Turn on debugging of script resolution with "-S".

private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private Map<String, String>
environment

Environment variables; defaults to System.getenv() in constructor

public static final boolean
private PrintStream
private Set<String>
private String
private final List<String>
private final List<Loader>
private final List<String>
public static boolean
public static final boolean
public static final boolean
public static boolean
public static final int
FIBER_POOL_TTL

Fiber thread pool time-to-live in seconds.

private boolean
private Boolean
public static boolean
FULL_TRACE_ENABLED

Enable tracing of method calls.

private boolean
globalRequireLock

Deprecated
private boolean
private boolean
private boolean
private boolean
hasShebangLine

Indicates whether the script has a shebang line or not

private final StringBuffer
private String
private InputStream
private String
public static final boolean
private String
private final boolean
public static boolean
public static final String
public static boolean
public static final String
public static final boolean
public static String
public static final String
public static String
public static final boolean
public static final boolean
public static final boolean
public static final boolean
public static final boolean
public static final boolean
public static final boolean
private final boolean
public static final int
JAVA_VERSION

The version to use for generated classes.

public static final boolean
JIT_CACHE_ENABLED

Deprecated
public static final String
JIT_CODE_CACHE

Deprecated
public static final boolean
JIT_LOADING_DEBUG

Deprecated
public static final int
JIT_MAX_METHODS_LIMIT

Deprecated
The max count of active methods eligible for JIT-compilation.
public static final int
JIT_MAX_SIZE_LIMIT

Deprecated
The max size of JIT-compiled methods (full class size) allowed.
public static final int
JIT_THRESHOLD

Deprecated
The JIT threshold to the specified method invocation count.
private boolean
private final boolean
jitDumping

Deprecated
private int
private final boolean
private final boolean
private int
private int
private int
private String
public static final boolean
private KCode
private boolean
private static volatile boolean
private ClassLoader
private boolean
private List<String>
public static final boolean
public static final boolean
public static final boolean
public static final boolean
private boolean
public static final boolean
NATIVE_ENABLED

Indicates the global default for whether native code is enabled.

public static final boolean
public static final boolean
nativeEnabled

Deprecated
public static final boolean
public static boolean
private boolean
private final Map<String, String>
private PrintStream
private boolean
public static final boolean
PEEPHOLE_OPTZ

Deprecated
public static final int
POOL_MAX

Maximum thread pool size (integer, default Integer.MAX_VALUE).

public static final int
POOL_MIN

Minimum thread pool size (integer, default 0).

public static final int
POOL_TTL

Thread pool time-to-live in seconds.

public static final boolean
POOLING_ENABLED

Enable a thread pool.

private boolean
private Profile
private int
private ProfileOutput
private RubyInstanceConfig.ProfilingMode
private String
public static boolean
private String
public static final boolean
REFLECTED_HANDLES

Deprecated
public static final boolean
REIFY_LOG_ERRORS

Log errors that occur during reification.

public static final boolean
REIFY_RUBY_CLASSES

Whether to reify (pre-compile and generate) a Java class per Ruby class.

private final Collection<String>
private static final Pattern
private boolean
runRubyInProcess

Deprecated
private String
public static final boolean
private transient boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private String
private boolean
public static final boolean
private String
threadDumpSignal

Deprecated
public static boolean
private TraceType
private boolean
public static final boolean
private RubyInstanceConfig.Verbosity
private final Set<RubyWarnings.Category>
private boolean
xFlag

Indicates whether the script must be extracted from script source

Constructor Summary

AccessConstructor and Description
public
public
RubyInstanceConfig(boolean isSecurityRestricted)

public
public
RubyInstanceConfig(final InputStream in, final PrintStream out, final PrintStream err)

Method Summary

Modifier and TypeMethod and Description
public void
addLoader(ClassLoader loader)

adds a given ClassLoader to jruby.

public void
addLoader(Loader bundle)

adds a given "bundle" to jruby.

private String
public LoadService
public static ClassLoader
public String
private void
private static InputStream
public boolean
getAllowUppercasePackageNames()

get whether uppercase package names will be honored

public String[]
public boolean
getBacktraceColor()

True if colorized backtraces are enabled.

public Integer
public boolean

Returns:

true if masking; false otherwise
getBacktraceMask
()

Whether to mask .java lines in the Ruby backtrace, as MRI does for C calls.

public String
getBasicUsageHelp()
Deprecated

public RubyInstanceConfig.CompileMode
public String
getCopyrightString()
Deprecated

public String
public ClassLoader
public Map<String, String>
public PrintStream
public Set<String>
public String
getExtendedHelp()
Deprecated

public String
public List<String>
public List<Loader>
public List<String>
public boolean
public StringBuffer
public String
public String
public InputStream
public String
public String
public boolean

Returns:

whether the JIT compiler will run in a background thread
getJitBackground
()

Get whether the JIT compiler will run in a background thread.

public int
public int
public int
public int
public String
public KCode
public boolean
getKernelGsubDefined()

Get Kernel#gsub is defined or not

public ClassLoader
public boolean
getLoadGemfile()

Whether to load and setup bundler on startup.

public List<String>
public RubyInstanceConfig.LoadServiceCreator
public Map<String, String>
public PrintStream
public boolean
public Profile
public int
getProfileMaxMethods()

Get the maximum number of methods to consider when profiling.

public ProfileOutput
public RubyInstanceConfig.ProfilingMode
public String
public String
getPropertyHelp()
Deprecated

public String
public Collection<String>
public int
public String
public InputStream
public boolean
public boolean
public boolean
public boolean
public String
public String
getThreadDumpSignal()
Deprecated

public TraceType
public Boolean
getVerbose()
Deprecated

public RubyInstanceConfig.Verbosity
public String
getVersionString()
Deprecated

public Set<RubyWarnings.Category>

Returns:

the set of enabled warning categories
getWarningCategories
()

Get the set of enabled warning categories.

public boolean
public static boolean
public boolean
private void
private static int
public byte[]
public boolean
public boolean
public boolean
public boolean
isBenchmarking()
Deprecated

public boolean
isCextEnabled()
Deprecated

public boolean

Returns:

true if self-first classloader is used; false otherwise.
isClassloaderDelegate
()

Get whether to use the self-first jruby classloader.

public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
isForceStdin()

True if we are only using source from stdin and not from a -e or file argument.

public Boolean
public boolean
isGlobalRequireLock()
Deprecated

public boolean
public boolean
public boolean
public boolean
isJitDumping()
Deprecated

public boolean

Returns:

true if JIT compilation is enabled
isJitEnabled
()

public boolean
public boolean
public boolean
public boolean

Returns:

true if native code is enabled; false otherwise.
isNativeEnabled
()

Get whether native code is enabled for this config.

public boolean
public boolean
public boolean
public boolean
public boolean
protected static boolean
public boolean
public boolean
isSamplingEnabled()
Deprecated

private boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
isUpdateNativeENVEnabled()

Indicates whether the JVM process' native environment will be updated when ENV[...] is set from Ruby.

public boolean
public boolean
public boolean
isxFlag()
Deprecated

public List<String>
loadPaths()
Deprecated

public String[]
parseShebangOptions(InputStream in)

The intent here is to gather up any options that might have been specified in the shebang line and return them so they can be merged into the ones specified on the command-line.

public void
processArguments(String[] arguments)

public void
public Collection<String>
requiredLibraries()
Deprecated

private void
public void
setAllowUppercasePackageNames(boolean allow)

set whether uppercase package names will be honored

public void
setArgv(String[] argv)

public void
setArgvGlobalsOn(boolean argvGlobalsOn)

public void
setAssumeLoop(boolean assumeLoop)

public void
setAssumePrinting(boolean assumePrinting)

public void
setBacktraceColor(boolean backtraceColor)

Set to true to enable colorized backtraces.

public void
public void
setBacktraceMask(boolean
true to mask; false otherwise
backtraceMask
)

Set whether to mask .java lines in the Ruby backtrace.

public void
setBenchmarking(boolean benchmarking)
Deprecated

public void
setCextEnabled(boolean b)
Deprecated

public void
setClassloaderDelegate(boolean
new value indicating whether self-first classloader is used
b
)

Set whether to use the self-first jruby classloader.

public void
public void
setCurrentDirectory(String newCurrentDirectory)

public void
setDebug(boolean debug)

public void
setDebuggingFrozenStringLiteral(boolean debuggingFrozenStringLiteral)

public void
setDisableDidYouMean(boolean ddym)

public void
public void
setDisableGems(boolean dg)

public void
setDisableRUBYOPT(boolean dr)

public void
public void
setEnvironment(Map<String, String> newEnvironment)

public void
public void
setExternalEncoding(String externalEncoding)

public void
setForceStdin(boolean forceStdin)

Set whether we should only look at stdin for source.

public void
setFrozenStringLiteral(boolean frozenStringLiteral)

public void
setGlobalRequireLock(boolean globalRequireLock)
Deprecated

public void
setHardExit(boolean hardExit)

public void
setHasInlineScript(boolean hasInlineScript)

public void
setHasScriptArgv(boolean argvRemains)

public void
setHasShebangLine(boolean hasShebangLine)

public void
setInPlaceBackupExtension(String inPlaceBackupExtension)

public void
public void
setInputFieldSeparator(String inputFieldSeparator)

public void
setInternalEncoding(String internalEncoding)

public void
setJitBackground(boolean
whether to run the JIT compiler in a background thread
jitBackground
)

Set whether the JIT compiler should run in a background thread (Executor-based).

public void
setJitLogEvery(int jitLogEvery)

public void
setJitMax(int jitMax)

public void
setJitMaxSize(int jitMaxSize)

public void
setJitThreshold(int jitThreshold)

public void
public void
setKCode(KCode kcode)

public void
setKernelGsubDefined(boolean setDefineKernelGsub)

Set whether Kernel#gsub should be defined

public static void
setLoadedNativeExtensions(boolean loadedNativeExtensions)

public void
public void
setLoadGemfile(boolean loadGemfile)

Set whether to load and setup bundler on startup.

public void
setLoadPaths(List<String> loadPaths)

public void
public void
setNativeEnabled(boolean
new value indicating whether native code is enabled
b
)

Set whether native code is enabled for this config.

public void
setObjectSpaceEnabled(boolean newObjectSpaceEnabled)

public void
public void
setParserDebug(boolean parserDebug)

public void
setProcessLineEnds(boolean processLineEnds)

public void
setProfile(Profile newProfile)

public void
setProfileMaxMethods(int profileMaxMethods)

Set the maximum number of methods to consider when profiling.

public void
public void
public void
public void
setRecordSeparator(String recordSeparator)

public void
setRunRubyInProcess(boolean flag)

public void
setSafeLevel(int safeLevel)
Deprecated

public void
setScriptFileName(String scriptFileName)

public void
setShouldCheckSyntax(boolean shouldSetSyntax)

public void
setShouldPrintProperties(boolean shouldPrintProperties)

public void
setShouldPrintUsage(boolean shouldPrintUsage)

public void
setShouldRunInterpreter(boolean shouldRunInterpreter)

public void
setShowBytecode(boolean showBytecode)

public void
setShowCopyright(boolean showCopyright)

public void
setShowVersion(boolean showVersion)

public void
setSiphashEnabled(boolean newSiphashEnabled)

public void
setSourceEncoding(String sourceEncoding)

public void
setSplit(boolean split)

public void
public void
setUpdateNativeENVEnabled(boolean updateNativeENVEnabled)

Ensure that the JVM process' native environment will be updated when ENV is modified .

public void
public void
setXFlag(boolean xFlag)

public boolean
shouldPrintProperties()
Deprecated

public boolean
shouldPrintUsage()
Deprecated

public boolean
shouldRunInterpreter()
Deprecated

private boolean
public void
private static String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait