TorqueBox 3.1.2

org.torquebox.core.runtime
Class RubyRuntimeMetaData

java.lang.Object
  extended by org.torquebox.core.runtime.RubyRuntimeMetaData

public class RubyRuntimeMetaData
extends Object

Root configuration for a Ruby interpreter.

A Ruby interpreter is configured with basic information, such as a baseDir to describe the working directory for execution, a RuntimeInitializer for performing an interpreter initialization, and a set of load paths to augment the default Ruby LOAD_PATH.

Author:
Bob McWhirter
See Also:
RubyLoadPathMetaData

Nested Class Summary
static class RubyRuntimeMetaData.CompileMode
           
static class RubyRuntimeMetaData.RuntimeType
           
static class RubyRuntimeMetaData.Version
           
 
Field Summary
static org.jboss.as.server.deployment.AttachmentKey<RubyRuntimeMetaData> ATTACHMENT_KEY
           
static RubyRuntimeMetaData.Version DEFAULT_VERSION
           
 
Constructor Summary
RubyRuntimeMetaData()
          Construct.
 
Method Summary
 void appendLoadPath(RubyLoadPathMetaData loadPath)
          Append an element to the LOAD_PATH.
 void appendLoadPath(String loadPath)
          Append an element to the LOAD_PATH relative to the baseDir.
 File getBaseDir()
          Retrieve the base working directory.
 RubyRuntimeMetaData.CompileMode getCompileMode()
          Retrieve the compileMode of the Ruby interpreter.
 Map<String,String> getEnvironment()
          Retrieve the interpreter-specific environment variables.
 List<RubyLoadPathMetaData> getLoadPaths()
          Retrieve the list of LOAD_PATH elements.
 RuntimeInitializer getRuntimeInitializer()
          Retrieve the interpreter initializer.
 RuntimePreparer getRuntimePreparer()
          Retrieve the interpreter preparer.
 RubyRuntimeMetaData.RuntimeType getRuntimeType()
           
 RubyRuntimeMetaData.Version getVersion()
          Retrieve the version of the Ruby interpreter.
 RubyRuntimeMetaData.Version getVersionOrDefault()
          Retrieve the version of the Ruby interpreter, or the default version if none is set.
 boolean isDebug()
           
 boolean isInteractive()
           
 boolean isProfileApi()
           
 void prependLoadPath(RubyLoadPathMetaData loadPath)
          Prepend an element to the LOAD_PATH.
 void setBaseDir(File baseDir)
          Set the base working directory.
 void setCompileMode(RubyRuntimeMetaData.CompileMode compileMode)
          Set the compileMode of the Ruby interpreter.
 void setDebug(boolean debug)
           
 void setEnvironment(Map<String,String> environment)
          Set interpreter-specific environment variables.
 void setInteractive(boolean interactive)
           
 void setProfileApi(boolean profiling)
           
 void setRuntimeInitializer(RuntimeInitializer initializer)
          Set the interpreter initializer.
 void setRuntimePreparer(RuntimePreparer preparer)
          Set the interpreter preparer.
 void setRuntimeType(RubyRuntimeMetaData.RuntimeType type)
           
 void setVersion(RubyRuntimeMetaData.Version version)
          Set the version of the Ruby interpreter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTACHMENT_KEY

public static final org.jboss.as.server.deployment.AttachmentKey<RubyRuntimeMetaData> ATTACHMENT_KEY

DEFAULT_VERSION

public static final RubyRuntimeMetaData.Version DEFAULT_VERSION
Constructor Detail

RubyRuntimeMetaData

public RubyRuntimeMetaData()
Construct.

Method Detail

setBaseDir

public void setBaseDir(File baseDir)
Set the base working directory.

Parameters:
baseDir - The base working directory.

getBaseDir

public File getBaseDir()
Retrieve the base working directory.

Returns:
The base working directory.

setRuntimeInitializer

public void setRuntimeInitializer(RuntimeInitializer initializer)
Set the interpreter initializer.

Parameters:
initializer - The initializer.

getRuntimeInitializer

public RuntimeInitializer getRuntimeInitializer()
Retrieve the interpreter initializer.

Returns:
The interpreter initializer.

setRuntimePreparer

public void setRuntimePreparer(RuntimePreparer preparer)
Set the interpreter preparer.

Parameters:
preparer - The preparer.

getRuntimePreparer

public RuntimePreparer getRuntimePreparer()
Retrieve the interpreter preparer.

Returns:
The interpreter preparer.

prependLoadPath

public void prependLoadPath(RubyLoadPathMetaData loadPath)
Prepend an element to the LOAD_PATH.

Parameters:
loadPath - The path element to prepend.

appendLoadPath

public void appendLoadPath(RubyLoadPathMetaData loadPath)
Append an element to the LOAD_PATH.

Parameters:
loadPath - The path element to append.

appendLoadPath

public void appendLoadPath(String loadPath)
                    throws MalformedURLException
Append an element to the LOAD_PATH relative to the baseDir.

Parameters:
loadPath - The relative path element to append
Throws:
MalformedURLException

getLoadPaths

public List<RubyLoadPathMetaData> getLoadPaths()
Retrieve the list of LOAD_PATH elements.

Returns:
The list of path elements.

setEnvironment

public void setEnvironment(Map<String,String> environment)
Set interpreter-specific environment variables.

Parameters:
environment - The environment variables.

getEnvironment

public Map<String,String> getEnvironment()
Retrieve the interpreter-specific environment variables.

Returns:
The environment variables.

setVersion

public void setVersion(RubyRuntimeMetaData.Version version)
Set the version of the Ruby interpreter.

Parameters:
version - The version.

getVersion

public RubyRuntimeMetaData.Version getVersion()
Retrieve the version of the Ruby interpreter.

Returns:
The version.

getVersionOrDefault

public RubyRuntimeMetaData.Version getVersionOrDefault()
Retrieve the version of the Ruby interpreter, or the default version if none is set.

Returns:
The version.

setCompileMode

public void setCompileMode(RubyRuntimeMetaData.CompileMode compileMode)
Set the compileMode of the Ruby interpreter.

Parameters:
compileMode - The compileMode.

getCompileMode

public RubyRuntimeMetaData.CompileMode getCompileMode()
Retrieve the compileMode of the Ruby interpreter.

Returns:
The compileMode.

setRuntimeType

public void setRuntimeType(RubyRuntimeMetaData.RuntimeType type)

getRuntimeType

public RubyRuntimeMetaData.RuntimeType getRuntimeType()

setDebug

public void setDebug(boolean debug)

isDebug

public boolean isDebug()

setInteractive

public void setInteractive(boolean interactive)

isInteractive

public boolean isInteractive()

isProfileApi

public boolean isProfileApi()

setProfileApi

public void setProfileApi(boolean profiling)

TorqueBox 3.1.2

Copyright © 2015 JBoss by Red Hat. All Rights Reserved.