org.jruby.embed
Enum LocalContextScope

java.lang.Object
  extended by java.lang.Enum<LocalContextScope>
      extended by org.jruby.embed.LocalContextScope
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<LocalContextScope>

public enum LocalContextScope
extends java.lang.Enum<LocalContextScope>

LocalContextState defines three scopes to maintain LocalContext.

Author:
Yoko Harada

Enum Constant Summary
CONCURRENT
          Specifies that an instance of Ruby runtime is a singleton and LocalContext is a thread local.
SINGLETHREAD
          Specifies that LocalContext is a thread indifferent instance.
SINGLETON
          Specifies that LocalContext is a singleton.
THREADSAFE
          Specifies that an instance of LocalContext is a thread local.
 
Method Summary
static LocalContextScope valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static LocalContextScope[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SINGLETON

public static final LocalContextScope SINGLETON
Specifies that LocalContext is a singleton.


SINGLETHREAD

public static final LocalContextScope SINGLETHREAD
Specifies that LocalContext is a thread indifferent instance. Users are responsible to thread safety.


THREADSAFE

public static final LocalContextScope THREADSAFE
Specifies that an instance of LocalContext is a thread local.


CONCURRENT

public static final LocalContextScope CONCURRENT
Specifies that an instance of Ruby runtime is a singleton and LocalContext is a thread local.

Method Detail

values

public static LocalContextScope[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (LocalContextScope c : LocalContextScope.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static LocalContextScope valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null


Copyright © 2002-2009 JRuby Team. All Rights Reserved.