org.jruby.runtime
Class CallbackFactory

java.lang.Object
  extended by org.jruby.runtime.CallbackFactory
Direct Known Subclasses:
InvocationCallbackFactory, ReflectionCallbackFactory

public abstract class CallbackFactory
extends java.lang.Object

Helper class to build Callback method. This impements method corresponding to the signature of method most often found in the Ruby library, for methods with other signature the appropriate Callback object will need to be explicitly created.


Field Summary
static java.lang.Class[] NULL_CLASS_ARRAY
           
 
Constructor Summary
CallbackFactory()
           
 
Method Summary
abstract  Dispatcher createDispatcher(RubyClass metaClass)
          Deprecated. No longer used.
static CallbackFactory createFactory(Ruby runtime, java.lang.Class type)
           
static CallbackFactory createFactory(Ruby runtime, java.lang.Class type, java.lang.ClassLoader classLoader)
           
abstract  CompiledBlockCallback getBlockCallback(java.lang.String method, java.lang.Object scriptObject)
           
abstract  Callback getBlockMethod(java.lang.String method)
           
abstract  Callback getFastMethod(java.lang.String method)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getFastMethod(java.lang.String method, java.lang.Class arg1)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getFastMethod(java.lang.String method, java.lang.Class arg1, java.lang.Class arg2)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getFastMethod(java.lang.String method, java.lang.Class arg1, java.lang.Class arg2, java.lang.Class arg3)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getFastOptMethod(java.lang.String method)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getFastOptSingletonMethod(java.lang.String method)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getFastSingletonMethod(java.lang.String method)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getFastSingletonMethod(java.lang.String method, java.lang.Class arg1)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getFastSingletonMethod(java.lang.String method, java.lang.Class arg1, java.lang.Class arg2)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getFastSingletonMethod(java.lang.String method, java.lang.Class arg1, java.lang.Class arg2, java.lang.Class arg3)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getMethod(java.lang.String method)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getMethod(java.lang.String method, java.lang.Class arg1)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getMethod(java.lang.String method, java.lang.Class arg1, java.lang.Class arg2)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getMethod(java.lang.String method, java.lang.Class arg1, java.lang.Class arg2, java.lang.Class arg3)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getOptMethod(java.lang.String method)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getOptSingletonMethod(java.lang.String method)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getSingletonMethod(java.lang.String method)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getSingletonMethod(java.lang.String method, java.lang.Class arg1)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getSingletonMethod(java.lang.String method, java.lang.Class arg1, java.lang.Class arg2)
          Deprecated. Callbacks are inefficient; use MethodFactory.
abstract  Callback getSingletonMethod(java.lang.String method, java.lang.Class arg1, java.lang.Class arg2, java.lang.Class arg3)
          Deprecated. Callbacks are inefficient; use MethodFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_CLASS_ARRAY

public static final java.lang.Class[] NULL_CLASS_ARRAY
Constructor Detail

CallbackFactory

public CallbackFactory()
Method Detail

getMethod

public abstract Callback getMethod(java.lang.String method)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets an instance method with no arguments.

Parameters:
method - name of the method
Returns:
a CallBack object corresponding to the appropriate method

getFastMethod

public abstract Callback getFastMethod(java.lang.String method)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets a fast instance method with no arguments.

Parameters:
method - name of the method
Returns:
a CallBack object corresponding to the appropriate method

getMethod

public abstract Callback getMethod(java.lang.String method,
                                   java.lang.Class arg1)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets an instance method with 1 argument.

Parameters:
method - name of the method
arg1 - the class of the only argument for this method
Returns:
a CallBack object corresponding to the appropriate method

getFastMethod

public abstract Callback getFastMethod(java.lang.String method,
                                       java.lang.Class arg1)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets a fast instance method with 1 argument.

Parameters:
method - name of the method
arg1 - the class of the only argument for this method
Returns:
a CallBack object corresponding to the appropriate method

getMethod

public abstract Callback getMethod(java.lang.String method,
                                   java.lang.Class arg1,
                                   java.lang.Class arg2)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets an instance method with two arguments.

Parameters:
method - name of the method
arg1 - the java class of the first argument for this method
arg2 - the java class of the second argument for this method
Returns:
a CallBack object corresponding to the appropriate method

getFastMethod

public abstract Callback getFastMethod(java.lang.String method,
                                       java.lang.Class arg1,
                                       java.lang.Class arg2)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets a fast instance method with two arguments.

Parameters:
method - name of the method
arg1 - the java class of the first argument for this method
arg2 - the java class of the second argument for this method
Returns:
a CallBack object corresponding to the appropriate method

getMethod

public abstract Callback getMethod(java.lang.String method,
                                   java.lang.Class arg1,
                                   java.lang.Class arg2,
                                   java.lang.Class arg3)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets an instance method with two arguments.

Parameters:
method - name of the method
arg1 - the java class of the first argument for this method
arg2 - the java class of the second argument for this method
arg3 - the java class of the second argument for this method
Returns:
a CallBack object corresponding to the appropriate method

getFastMethod

public abstract Callback getFastMethod(java.lang.String method,
                                       java.lang.Class arg1,
                                       java.lang.Class arg2,
                                       java.lang.Class arg3)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets a fast instance method with two arguments.

Parameters:
method - name of the method
arg1 - the java class of the first argument for this method
arg2 - the java class of the second argument for this method
arg3 - the java class of the second argument for this method
Returns:
a CallBack object corresponding to the appropriate method

getSingletonMethod

public abstract Callback getSingletonMethod(java.lang.String method)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets a singleton (class) method without arguments.

Parameters:
method - name of the method
Returns:
a CallBack object corresponding to the appropriate method

getFastSingletonMethod

public abstract Callback getFastSingletonMethod(java.lang.String method)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets a fast singleton (class) method without arguments.

Parameters:
method - name of the method
Returns:
a CallBack object corresponding to the appropriate method

getSingletonMethod

public abstract Callback getSingletonMethod(java.lang.String method,
                                            java.lang.Class arg1)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets a singleton (class) method with 1 argument.

Parameters:
method - name of the method
arg1 - the class of the only argument for this method
Returns:
a CallBack object corresponding to the appropriate method

getFastSingletonMethod

public abstract Callback getFastSingletonMethod(java.lang.String method,
                                                java.lang.Class arg1)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets a fast singleton (class) method with 1 argument.

Parameters:
method - name of the method
arg1 - the class of the only argument for this method
Returns:
a CallBack object corresponding to the appropriate method

getSingletonMethod

public abstract Callback getSingletonMethod(java.lang.String method,
                                            java.lang.Class arg1,
                                            java.lang.Class arg2)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets a singleton (class) method with 2 arguments.

Parameters:
method - name of the method
Returns:
a CallBack object corresponding to the appropriate method

getFastSingletonMethod

public abstract Callback getFastSingletonMethod(java.lang.String method,
                                                java.lang.Class arg1,
                                                java.lang.Class arg2)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets a fast singleton (class) method with 2 arguments.

Parameters:
method - name of the method
Returns:
a CallBack object corresponding to the appropriate method

getSingletonMethod

public abstract Callback getSingletonMethod(java.lang.String method,
                                            java.lang.Class arg1,
                                            java.lang.Class arg2,
                                            java.lang.Class arg3)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets a singleton (class) method with 3 arguments.

Parameters:
method - name of the method
Returns:
a CallBack object corresponding to the appropriate method

getFastSingletonMethod

public abstract Callback getFastSingletonMethod(java.lang.String method,
                                                java.lang.Class arg1,
                                                java.lang.Class arg2,
                                                java.lang.Class arg3)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets a fast singleton (class) method with 3 arguments.

Parameters:
method - name of the method
Returns:
a CallBack object corresponding to the appropriate method

getBlockMethod

public abstract Callback getBlockMethod(java.lang.String method)

getBlockCallback

public abstract CompiledBlockCallback getBlockCallback(java.lang.String method,
                                                       java.lang.Object scriptObject)

getOptSingletonMethod

public abstract Callback getOptSingletonMethod(java.lang.String method)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets a singleton (class) method with no mandatory argument and some optional arguments.

Parameters:
method - name of the method
Returns:
a CallBack object corresponding to the appropriate method

getFastOptSingletonMethod

public abstract Callback getFastOptSingletonMethod(java.lang.String method)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets a fast singleton (class) method with no mandatory argument and some optional arguments.

Parameters:
method - name of the method
Returns:
a CallBack object corresponding to the appropriate method

getOptMethod

public abstract Callback getOptMethod(java.lang.String method)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets an instance method with no mandatory argument and some optional arguments.

Parameters:
method - name of the method
Returns:
a CallBack object corresponding to the appropriate method

getFastOptMethod

public abstract Callback getFastOptMethod(java.lang.String method)
Deprecated. Callbacks are inefficient; use MethodFactory.

gets a fast instance method with no mandatory argument and some optional arguments.

Parameters:
method - name of the method
Returns:
a CallBack object corresponding to the appropriate method

createDispatcher

public abstract Dispatcher createDispatcher(RubyClass metaClass)
Deprecated. No longer used.

Create a fast STI-based (selector table indexing) dispatcher.

Parameters:
metaClass -
Returns:

createFactory

public static CallbackFactory createFactory(Ruby runtime,
                                            java.lang.Class type)

createFactory

public static CallbackFactory createFactory(Ruby runtime,
                                            java.lang.Class type,
                                            java.lang.ClassLoader classLoader)


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