org.springframework.scripting.jruby
Class JRubyScriptUtils.RubyObjectInvocationHandler

java.lang.Object
  extended by org.springframework.scripting.jruby.JRubyScriptUtils.RubyObjectInvocationHandler
All Implemented Interfaces:
java.lang.reflect.InvocationHandler
Enclosing class:
JRubyScriptUtils

private static class JRubyScriptUtils.RubyObjectInvocationHandler
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

InvocationHandler that invokes a JRuby script method.


Field Summary
private  Ruby ruby
           
private  IRubyObject rubyObject
           
 
Constructor Summary
JRubyScriptUtils.RubyObjectInvocationHandler(IRubyObject rubyObject, Ruby ruby)
           
 
Method Summary
private  java.lang.Object convertFromRuby(IRubyObject rubyResult, java.lang.Class returnType)
           
private  java.lang.Object convertFromRubyArray(IRubyObject[] rubyArray, java.lang.Class returnType)
           
private  IRubyObject[] convertToRuby(java.lang.Object[] javaArgs)
           
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
           
private  boolean isProxyForSameRubyObject(java.lang.Object other)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rubyObject

private final IRubyObject rubyObject

ruby

private final Ruby ruby
Constructor Detail

JRubyScriptUtils.RubyObjectInvocationHandler

public JRubyScriptUtils.RubyObjectInvocationHandler(IRubyObject rubyObject,
                                                    Ruby ruby)
Method Detail

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable

isProxyForSameRubyObject

private boolean isProxyForSameRubyObject(java.lang.Object other)

convertToRuby

private IRubyObject[] convertToRuby(java.lang.Object[] javaArgs)

convertFromRuby

private java.lang.Object convertFromRuby(IRubyObject rubyResult,
                                         java.lang.Class returnType)

convertFromRubyArray

private java.lang.Object convertFromRubyArray(IRubyObject[] rubyArray,
                                              java.lang.Class returnType)