Logo Search packages:      
Sourcecode: jruby1.2 version File versions  Download package

org::jruby::Ruby Class Reference

List of all members.


Detailed Description

The Ruby object represents the top-level of a JRuby "instance" in a given VM. JRuby supports spawning multiple instances in the same JVM. Generally, objects created under these instances are tied to a given runtime, for such details as identity and type, because multiple Ruby instances means there are multiple instances of each class. This means that in multi-runtime mode (or really, multi-VM mode, where each JRuby instance is a ruby "VM"), objects generally can't be transported across runtimes without marshaling.

This class roots everything that makes the JRuby runtime function, and provides a number of utility methods for constructing global types and accessing global runtime structures.

Definition at line 152 of file Ruby.java.


Public Member Functions

void addEventHook (EventHook hook)
void addFinalizer (Finalizable finalizer)
void addInternalFinalizer (Finalizable finalizer)
int allocModuleId ()
int allocSymbolId ()
CallbackFactory callbackFactory (Class<?> type)
void callEventHooks (ThreadContext context, RubyEvent event, String file, int line, String name, IRubyObject type)
void checkSafeString (IRubyObject object)
void compileAndLoadFile (String filename, InputStream in, boolean wrap)
RubyClass defineClass (String name, RubyClass superClass, ObjectAllocator allocator, CallSite[] callSites)
RubyClass defineClass (String name, RubyClass superClass, ObjectAllocator allocator)
RubyClass defineClassUnder (String name, RubyClass superClass, ObjectAllocator allocator, RubyModule parent, CallSite[] callSites)
RubyClass defineClassUnder (String name, RubyClass superClass, ObjectAllocator allocator, RubyModule parent)
void defineGlobalConstant (String name, IRubyObject value)
RubyModule defineModule (String name)
RubyModule defineModuleUnder (String name, RubyModule parent)
void defineReadonlyVariable (String name, IRubyObject value)
void defineVariable (final GlobalVariable variable)
IRubyObject evalScriptlet (String script)
IRubyObject executeScript (String script, String filename)
RubyClass fastGetClass (String internedName)
RubyModule fastGetModule (String internedName)
RubySymbol fastNewSymbol (String internedName)
RubyClass getArgumentError ()
RubyClass getArray ()
RubyClass getBasicObject ()
BeanManager getBeanManager ()
RubyClass getBignum ()
RubyClass getBinding ()
RubyHash getCharsetMap ()
RubyClass getClass (String name)
RubyClass getClassClass ()
RubyModule getClassFromPath (String path)
RubyModule getComparable ()
RubyClass getComplex ()
RubyClass getConcurrencyError ()
int getConstantGeneration ()
RubyClass getContinuation ()
RubyClass getConverter ()
ThreadContext getCurrentContext ()
String getCurrentDirectory ()
IRubyObject getDebug ()
Encoding getDefaultExternalEncoding ()
Encoding getDefaultInternalEncoding ()
RubyThreadGroup getDefaultThreadGroup ()
ChannelDescriptor getDescriptorByFileno (int aFileno)
Map< Integer,
WeakDescriptorReference > 
getDescriptors ()
RubyClass getDir ()
RubyClass getDummy ()
RubyClass getEncoding ()
RubyClass getEncodingCompatibilityError ()
RubyClass getEncodingError ()
EncodingService getEncodingService ()
RubyModule getEnumerable ()
RubyClass getEnumerator ()
RubyClass getEOFError ()
PrintStream getErr ()
RubyModule getErrno ()
RubyClass getErrno (int n)
PrintStream getErrorStream ()
RubyModule getEtc ()
RubyClass getException ()
ExecutorService getExecutor ()
RubyBoolean getFalse ()
RubyClass getFalseClass ()
RubyClass getFatal ()
RubyClass getFile ()
RubyClass getFileStat ()
RubyModule getFileTest ()
RubyClass getFixnum ()
RubyClass getFloat ()
RubyClass getFloatDomainError ()
RubyModule getGC ()
RubyClass getGenerator ()
long getGlobalState ()
GlobalVariables getGlobalVariables ()
IRubyObject getGroupStruct ()
RubyClass getHash ()
InputStream getIn ()
RubyClass getIndexError ()
InputStream getInputStream ()
RubyInstanceConfig getInstanceConfig ()
RubyClass getInteger ()
RubyClass getInterrupt ()
RubyClass getIO ()
RubyClass getIOError ()
JavaSupport getJavaSupport ()
JITCompiler getJITCompiler ()
Set< Script > getJittedMethods ()
synchronized JRubyClassLoader getJRubyClassLoader ()
String getJRubyHome ()
KCode getKCode ()
RubyModule getKernel ()
RubyClass getLoadError ()
LoadService getLoadService ()
RubyClass getLocalJumpError ()
RubyModule getMarshal ()
RubyClass getMatchData ()
RubyModule getMath ()
RubyClass getMethod ()
RubyClass getModule ()
RubyModule getModule (String name)
RubyClass getNameError ()
RubyClass getNameErrorMessage ()
RubyClass getNativeException ()
IRubyObject getNil ()
RubyClass getNilClass ()
IRubyObject[] getNilPrefilledArray ()
RubyClass getNoMemoryError ()
RubyClass getNoMethodError ()
RubyClass getNotImplementedError ()
RubyClass getNumeric ()
RubyClass getObject ()
ObjectSpace getObjectSpace ()
RubyModule getObjectSpaceModule ()
Object getObjectToYamlMethod ()
RubyModule getOrCreateModule (String name)
PrintStream getOut ()
PrintStream getOutputStream ()
Parser getParser ()
IRubyObject getPasswdStruct ()
POSIX getPosix ()
RubyModule getPrecision ()
RubyClass getProc ()
RubyModule getProcess ()
RubyModule getProcGID ()
RubyClass getProcStatus ()
RubyModule getProcSysModule ()
RubyModule getProcUID ()
Profile getProfile ()
Random getRandom ()
long getRandomSeed ()
RubyClass getRange ()
RubyClass getRangeError ()
RubyClass getRational ()
GlobalVariable getRecordSeparatorVar ()
RubyClass getRegexp ()
RubyClass getRegexpError ()
Object getRespondToMethod ()
RubyClass getRuntimeError ()
int getSafeLevel ()
RubyClass getSecurityError ()
RubyClass getSignalException ()
IRubyObject[] getSingleNilArray ()
int getStackTraces ()
RubyClass getStandardError ()
long getStartTime ()
RubyClass getStopIteration ()
RubyClass getString ()
RubyClass getStructClass ()
RubyClass getSymbol ()
RubySymbol.SymbolTable getSymbolTable ()
RubyClass getSyntaxError ()
RubyClass getSystemCallError ()
RubyClass getSystemExit ()
RubyClass getSystemStackError ()
RubyClass getThread ()
RubyClass getThreadError ()
RubyClass getThreadGroup ()
ThreadService getThreadService ()
RubyClass getTime ()
Map< String, DateTimeZone > getTimezoneCache ()
IRubyObject getTmsStruct ()
IRubyObject getTopSelf ()
RubyBoolean getTrue ()
RubyClass getTrueClass ()
RubyClass getTypeError ()
RubyClass getUnboundMethod ()
IRubyObject getVerbose ()
RubyWarnings getWarnings ()
RubyClass getYielder ()
RubyClass getZeroDivisionError ()
boolean hasEventHooks ()
void incGlobalState ()
synchronized void incrementConstantGeneration ()
long incrementRandomSeedSequence ()
boolean is1_9 ()
boolean isClassDefined (String name)
boolean isDoNotReverseLookupEnabled ()
boolean isGlobalAbortOnExceptionEnabled ()
boolean isInspecting (Object obj)
boolean isObjectSpaceEnabled ()
boolean isVerbose ()
void loadConstantSet (RubyModule module, String constantSetName)
void loadFile (String scriptName, InputStream in, boolean wrap)
void loadScript (Script script)
RaiseException newArgumentError (int got, int expected)
RaiseException newArgumentError (String message)
RubyArray newArray (int size)
RubyArray newArray (List< IRubyObject > list)
RubyArray newArray (IRubyObject...objects)
RubyArray newArray (IRubyObject car, IRubyObject cdr)
RubyArray newArray (IRubyObject object)
RubyArray newArray ()
RubyArray newArrayLight ()
RubyArray newArrayNoCopy (IRubyObject...objects)
RubyArray newArrayNoCopyLight (IRubyObject...objects)
RubyBinding newBinding (Binding binding)
RubyBinding newBinding ()
RubyProc newBlockPassProc (Block.Type type, Block block)
RubyBoolean newBoolean (boolean value)
RaiseException newConcurrencyError (String message)
RubyArray newEmptyArray ()
RaiseException newEncodingCompatibilityError (String message)
RaiseException newEncodingError (String message)
RaiseException newEOFError (String message)
RaiseException newEOFError ()
RaiseException newErrnoEACCESError (String message)
RaiseException newErrnoEADDRINUSEError ()
RaiseException newErrnoEAGAINError (String message)
RaiseException newErrnoEBADFError (String message)
RaiseException newErrnoEBADFError ()
RaiseException newErrnoECHILDError ()
RaiseException newErrnoECONNREFUSEDError ()
RaiseException newErrnoECONNRESETError ()
RaiseException newErrnoEDOMError (String message)
RaiseException newErrnoEEXISTError (String message)
RaiseException newErrnoEINVALError (String message)
RaiseException newErrnoEINVALError ()
RaiseException newErrnoEISDirError ()
RaiseException newErrnoEISDirError (String message)
RaiseException newErrnoENOENTError (String message)
RaiseException newErrnoENOENTError ()
RaiseException newErrnoENOPROTOOPTError ()
RaiseException newErrnoENOTDIRError (String message)
RaiseException newErrnoENOTSOCKError (String message)
RaiseException newErrnoEPIPEError ()
RaiseException newErrnoESPIPEError (String message)
RaiseException newErrnoESPIPEError ()
RubyFileStat newFileStat (FileDescriptor descriptor)
RubyFileStat newFileStat (String filename, boolean lstat)
RubyFixnum newFixnum (Constant value)
RubyFixnum newFixnum (int value)
RubyFixnum newFixnum (long value)
RubyFloat newFloat (double value)
RaiseException newFloatDomainError (String message)
RaiseException newFrozenError (String objectType)
RaiseException newIndexError (String message)
RaiseException newInvalidEncoding (String message)
RaiseException newIOError (String message)
RaiseException newIOErrorFromException (IOException ioe)
RaiseException newLoadError (String message)
RaiseException newLocalJumpError (RubyLocalJumpError.Reason reason, IRubyObject exitValue, String message)
RaiseException newLocalJumpErrorNoBlock ()
RaiseException newNameError (String message, String name, Throwable origException, boolean printWhenVerbose)
RaiseException newNameError (String message, String name, Throwable origException)
RaiseException newNameError (String message, String name)
RaiseException newNoMethodError (String message, String name, IRubyObject args)
RaiseException newNotImplementedError (String message)
RubyNumeric newNumeric ()
RubyProc newProc (Block.Type type, Block block)
RaiseException newRangeError (String message)
RaiseException newRedoLocalJumpError ()
RaiseException newRegexpError (String message)
RaiseException newRuntimeError (String message)
RaiseException newSecurityError (String message)
RaiseException newStandardError (String message)
RubyString newString (ByteList byteList)
RubyString newString (String string)
RubyString newString ()
RubyString newStringShared (ByteList byteList)
RubySymbol newSymbol (String name)
RaiseException newSyntaxError (String message)
RaiseException newSystemCallError (String message)
RaiseException newSystemExit (int status)
RaiseException newSystemStackError (String message, StackOverflowError soe)
RaiseException newSystemStackError (String message)
RaiseException newThreadError (String message)
RubyTime newTime (long milliseconds)
RaiseException newTypeError (IRubyObject receivedObject, RubyClass expectedType)
RaiseException newTypeError (String message)
RaiseException newZeroDivisionError ()
Node parse (ByteList content, String file, DynamicScope scope, int lineNumber, boolean extraPositionInformation)
Node parse (String content, String file, DynamicScope scope, int lineNumber, boolean extraPositionInformation)
Node parseEval (ByteList content, String file, DynamicScope scope, int lineNumber)
Node parseEval (String content, String file, DynamicScope scope, int lineNumber)
Node parseFile (InputStream in, String file, DynamicScope scope)
Node parseFile (InputStream in, String file, DynamicScope scope, int lineNumber)
Node parseFromMain (InputStream inputStream, String filename)
Node parseInline (InputStream in, String file, DynamicScope scope)
void printError (RubyException excp)
IRubyObject pushExitBlock (RubyProc proc)
void registerDescriptor (ChannelDescriptor descriptor)
void registerDescriptor (ChannelDescriptor descriptor, boolean isRetained)
void registerInspecting (Object obj)
void removeEventHook (EventHook hook)
void removeFinalizer (Finalizable finalizer)
void removeInternalFinalizer (Finalizable finalizer)
void runFromMain (InputStream inputStream, String filename)
IRubyObject runInterpreter (Node scriptNode)
IRubyObject runNormally (Node scriptNode, boolean yarvCompile)
IRubyObject runWithGetsLoop (Node scriptNode, boolean printing, boolean processLineEnds, boolean split, boolean yarvCompile)
void secure (int level)
void setCurrentDirectory (String dir)
void setDebug (IRubyObject debug)
void setDefaultExternalEncoding (Encoding defaultExternalEncoding)
void setDefaultInternalEncoding (Encoding defaultInternalEncoding)
void setDoNotReverseLookupEnabled (boolean b)
void setEtc (RubyModule etcModule)
void setGlobalAbortOnExceptionEnabled (boolean enable)
void setGlobalVariables (GlobalVariables globalVariables)
void setJRubyHome (String home)
void setKCode (KCode kcode)
void setRandomSeed (long randomSeed)
void setRecordSeparatorVar (GlobalVariable recordSeparatorVar)
void setRespondToMethod (Object rtm)
void setSafeLevel (int safeLevel)
void setStackTraces (int stackTraces)
void setTraceFunction (RubyProc traceFunction)
void setVerbose (IRubyObject verbose)
void tearDown ()
void unregisterDescriptor (int aFileno)
void unregisterInspecting (Object obj)
boolean warningsEnabled ()

Static Public Member Functions

static ClassLoader getClassLoader ()
static Ruby getCurrentInstance ()
static Ruby getDefaultInstance ()
static boolean isSecurityRestricted ()
static Ruby newInstance (InputStream in, PrintStream out, PrintStream err)
static Ruby newInstance (RubyInstanceConfig config)
static Ruby newInstance ()
static void setCurrentInstance (Ruby runtime)
static void setSecurityRestricted (boolean restricted)

Public Attributes

final RubyFixnum[] fixnumCache = new RubyFixnum[256]

Static Public Attributes

static final int NIL_PREFILLED_ARRAY_SIZE = RubyArray.ARRAY_DEFAULT_SIZE * 8

Package Functions

public< E extends Enum< E > > void loadConstantSet (RubyModule module, Class< E > enumClass)
void setArray (RubyClass arrayClass)
void setBignum (RubyClass bignumClass)
void setBinding (RubyClass bindingClass)
void setComparable (RubyModule comparableModule)
void setComplex (RubyClass complexClass)
void setContinuation (RubyClass continuationClass)
void setConverter (RubyClass converterClass)
void setDefaultThreadGroup (RubyThreadGroup defaultThreadGroup)
void setDir (RubyClass dirClass)
void setEncoding (RubyClass encodingClass)
void setEnumerable (RubyModule enumerableModule)
void setEnumerator (RubyClass enumeratorClass)
void setException (RubyClass exceptionClass)
void setFalseClass (RubyClass falseClass)
void setFile (RubyClass fileClass)
void setFileStat (RubyClass fileStatClass)
void setFileTest (RubyModule fileTestModule)
void setFixnum (RubyClass fixnumClass)
void setFloat (RubyClass floatClass)
void setGC (RubyModule gcModule)
void setGenerator (RubyClass generatorClass)
void setGroupStruct (RubyClass groupStruct)
void setHash (RubyClass hashClass)
void setInteger (RubyClass integerClass)
void setIO (RubyClass ioClass)
void setKernel (RubyModule kernelModule)
void setMarshal (RubyModule marshalModule)
void setMatchData (RubyClass matchDataClass)
void setMath (RubyModule mathModule)
void setMethod (RubyClass methodClass)
void setNilClass (RubyClass nilClass)
void setNumeric (RubyClass numericClass)
void setObjectSpaceEnabled (boolean objectSpaceEnabled)
void setObjectSpaceModule (RubyModule objectSpaceModule)
void setObjectToYamlMethod (Object otym)
void setPasswdStruct (RubyClass passwdStruct)
void setPrecision (RubyModule precisionModule)
void setProc (RubyClass procClass)
void setProcess (RubyModule processModule)
void setProcGID (RubyModule procGIDModule)
void setProcStatus (RubyClass procStatusClass)
void setProcSys (RubyModule procSysModule)
void setProcUID (RubyModule procUIDModule)
void setRange (RubyClass rangeClass)
void setRational (RubyClass rationalClass)
void setRegexp (RubyClass regexpClass)
void setString (RubyClass stringClass)
void setStructClass (RubyClass structClass)
void setSymbol (RubyClass symbolClass)
void setThread (RubyClass threadClass)
void setThreadGroup (RubyClass threadGroupClass)
void setTime (RubyClass timeClass)
void setTmsStruct (RubyClass tmsStruct)
void setTrueClass (RubyClass trueClass)
void setUnboundMethod (RubyClass unboundMethodClass)
void setYielder (RubyClass yielderClass)

Static Package Functions

 [static initializer]

Private Member Functions

void addBuiltinIfAllowed (String name, Library lib)
void addLazyBuiltin (String name, String shortName, String className)
void bootstrap ()
void cleanDescriptors ()
void createSysErr (int i, String name)
RubyClass defineClassIfAllowed (String name, RubyClass superClass)
void init ()
void initBuiltins ()
void initCore ()
void initErrno ()
void initExceptions ()
void initRoot ()
RaiseException newRaiseException (RubyClass exceptionClass, String message)
void printErrorPos (ThreadContext context, PrintStream errorStream)
 Ruby (RubyInstanceConfig config)
IRubyObject runScript (Script script)
IRubyObject runYarv (YARVCompiledRunner runner)
Script tryCompile (Node node, JRubyClassLoader classLoader)
Script tryCompile (Node node)
YARVCompiledRunner tryCompileYarv (Node node)

Private Attributes

RubyClass argumentError
RubyClass arrayClass
Stack< RubyProcatExitBlocks = new Stack<RubyProc>()
RubyClass basicObjectClass
BeanManager beanManager
RubyClass bignumClass
RubyClass bindingClass
final CallTraceFuncHook callTraceFuncHook = new CallTraceFuncHook()
RubyHash charsetMap
RubyClass classClass
RubyModule comparableModule
RubyClass complexClass
RubyClass concurrencyError
final RubyInstanceConfig config
volatile int constantGeneration = 1
RubyClass continuationClass
RubyClass converterClass
String currentDirectory
IRubyObject debug
Encoding defaultExternalEncoding
Encoding defaultInternalEncoding
RubyThreadGroup defaultThreadGroup
ReferenceQueue< ChannelDescriptordescriptorQueue = new ReferenceQueue<ChannelDescriptor>()
Map< Integer,
WeakDescriptorReference > 
descriptors = new ConcurrentHashMap<Integer, WeakDescriptorReference>()
RubyClass dirClass
boolean doNotReverseLookupEnabled = false
RubyClass dummyClass
RubyClass encodingClass
RubyClass encodingCompatibilityError
RubyClass encodingError
EncodingService encodingService
RubyModule enumerableModule
RubyClass enumeratorClass
RubyClass eofError
final PrintStream err
RubyModule errnoModule
Map< Integer, RubyClasserrnos = new HashMap<Integer, RubyClass>()
RubyModule etcModule
List< EventHookeventHooks = new Vector<EventHook>()
RubyClass exceptionClass
ExecutorService executor
RubyClass falseClass
RubyBoolean falseObject
RubyClass fatal
RubyClass fileClass
RubyClass fileStatClass
RubyModule fileTestModule
Map< Finalizable, Object > finalizers
final Object finalizersMutex = new Object()
RubyClass fixnumClass
RubyClass floatClass
RubyClass floatDomainError
RubyModule gcModule
RubyClass generatorClass
boolean globalAbortOnExceptionEnabled = false
long globalState = 1
GlobalVariables globalVariables = new GlobalVariables(this)
RubyClass groupStruct
boolean hasEventHooks
RubyClass hashClass
final InputStream in
RubyClass indexError
ThreadLocal< Map< Object,
Object > > 
inspect = new ThreadLocal<Map<Object, Object>>()
RubyClass integerClass
Map< Finalizable, Object > internalFinalizers
final Object internalFinalizersMutex = new Object()
RubyClass interrupt
RubyClass ioClass
RubyClass ioError
final boolean is1_9
boolean isVerbose
JavaSupport javaSupport
final JITCompiler jitCompiler
final Set< Script > jittedMethods = Collections.synchronizedSet(new WeakHashSet<Script>())
JRubyClassLoader jrubyClassLoader
KCode kcode = KCode.NONE
RubyModule kernelModule
RubyClass loadError
LoadService loadService
RubyClass localJumpError
RubyModule marshalModule
RubyClass matchDataClass
RubyModule mathModule
RubyClass methodClass
RubyClass moduleClass
AtomicInteger moduleLastId = new AtomicInteger(0)
RubyClass nameError
RubyClass nameErrorMessage
RubyClass nativeException
RubyClass nilClass
RubyNil nilObject
final IRubyObject nilPrefilledArray [] = new IRubyObject[NIL_PREFILLED_ARRAY_SIZE]
RubyClass noMemoryError
RubyClass noMethodError
RubyClass notImplementedError
RubyClass numericClass
RubyClass objectClass
ObjectSpace objectSpace = new ObjectSpace()
volatile boolean objectSpaceEnabled
RubyModule objectSpaceModule
Object objectToYamlMethod
final PrintStream out
Parser parser = new Parser(this)
ParserStats parserStats
RubyClass passwdStruct
POSIX posix
RubyModule precisionModule
RubyClass procClass
RubyModule processModule
RubyModule procGIDModule
RubyClass procStatusClass
RubyModule procSysModule
RubyModule procUIDModule
Profile profile
Random random = new Random()
long randomSeed = 0
long randomSeedSequence = 0
RubyClass rangeClass
RubyClass rangeError
RubyClass rationalClass
GlobalVariable recordSeparatorVar
RubyClass regexpClass
RubyClass regexpError
Object respondToMethod
Map< Integer, ChannelDescriptorretainedDescriptors = new ConcurrentHashMap<Integer, ChannelDescriptor>()
RubyClass runtimeError
int safeLevel = -1
RubyClass scriptError
RubyClass securityError
RubyClass signalException
IRubyObject[] singleNilArray
int stackTraces = 0
RubyClass standardError
long startTime = System.currentTimeMillis()
RubyClass stopIteration
RubyClass stringClass
RubyClass structClass
RubyClass symbolClass
AtomicInteger symbolLastId = new AtomicInteger(128)
final RubySymbol.SymbolTable symbolTable = new RubySymbol.SymbolTable(this)
RubyClass syntaxError
RubyClass systemCallError
RubyClass systemExit
RubyClass systemStackError
RubyClass threadClass
RubyClass threadError
RubyClass threadGroupClass
final ThreadService threadService
RubyClass timeClass
Map< String, DateTimeZone > timeZoneCache = new HashMap<String,DateTimeZone>()
RubyClass tmsStruct
IRubyObject topSelf
RubyClass trueClass
RubyBoolean trueObject
RubyClass typeError
RubyClass unboundMethodClass
IRubyObject verbose
RubyWarnings warnings = new RubyWarnings(this)
boolean warningsEnabled
RubyClass yielderClass
RubyClass zeroDivisionError

Static Private Attributes

static ThreadLocal< RubycurrentRuntime = new ThreadLocal<Ruby>()
static volatile boolean securityRestricted = false

Classes

class  CallTraceFuncHook
class  WeakDescriptorReference

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index