core/src/main/java/org/jruby/javasupport/proxy/JavaProxyClass.java
public static JavaProxyClass newProxyClass(final Ruby runtime, Class superClass,
        Class[] interfaces, Set<String> names, Map<String, Class> field, Map<String, Class[]> extraMethods, RubyClass clazz) throws InvocationTargetException {

        if (superClass == null) superClass = Object.class;
        if (interfaces == null) interfaces = EMPTY_CLASS_ARRAY;
        if (names == null) names = Collections.EMPTY_SET; // so we can assume names != null

        // NOTE: currently we regenerate proxy classes when a Ruby method is added on the type
        JavaSupport.ProxyClassKey classKey = JavaSupport.ProxyClassKey.getInstance(superClass, interfaces, names);
        JavaProxyClass proxyClass = JavaSupportImpl.fetchJavaProxyClass(runtime, classKey);
        if ( proxyClass != null ) return proxyClass;

        final ClassLoader loader = runtime.getJRubyClassLoader();
        proxyClass = runtime.getJavaProxyClassFactory().genProxyClass(runtime, (ClassDefiningClassLoader) loader, null, superClass, interfaces, names, field, extraMethods, clazz);
        return JavaSupportImpl.saveJavaProxyClass(runtime, classKey, proxyClass);
    }
/**
     * Returns a new (generated) proxy class based on arguments.
     * @param runtime
     * @param superClass
     * @param interfaces
     * @param names
     * @param field 
     * @param extraMethods 
     * @param clazz 
     * @return proxy class
     * @throws InvocationTargetException
     */
Returns a new (generated) proxy class based on arguments.
Returns a new ( generated ) proxy class based on arguments .
public static JavaProxyClass newProxyClass(final Ruby runtime, Class superClass,
        Class[] interfaces, Set<String> names, Map<String, Class> field, Map<String, Class[]> extraMethods, RubyClass clazz) throws InvocationTargetException {
        if (superClass == null) superClass = Object.class;
        if (interfaces == null) interfaces = EMPTY_CLASS_ARRAY;
        if (names == null) names = Collections.EMPTY_SET; 
        JavaSupport.ProxyClassKey classKey = JavaSupport.ProxyClassKey.getInstance(superClass, interfaces, names);
        JavaProxyClass proxyClass = JavaSupportImpl.fetchJavaProxyClass(runtime, classKey);
        if ( proxyClass != null ) return proxyClass;
        final ClassLoader loader = runtime.getJRubyClassLoader();
        proxyClass = runtime.getJavaProxyClassFactory().genProxyClass(runtime, (ClassDefiningClassLoader) loader, null, superClass, interfaces, names, field, extraMethods, clazz);
        return JavaSupportImpl.saveJavaProxyClass(runtime, classKey, proxyClass);
    }
public static JavaProxyClass newProxyClass ( final Ruby runtime , Class superClass , Class [ ] interfaces , Set < String > names , Map < String , Class > field , Map < String , Class [ ] > extraMethods , RubyClass clazz ) throws InvocationTargetException { if ( superClass == null ) superClass = Object . class ; if ( interfaces == null ) interfaces = EMPTY_CLASS_ARRAY ; if ( names == null ) names = Collections . EMPTY_SET ; JavaSupport . ProxyClassKey classKey = JavaSupport . ProxyClassKey . getInstance ( superClass , interfaces , names ) ; JavaProxyClass proxyClass = JavaSupportImpl . fetchJavaProxyClass ( runtime , classKey ) ; if ( proxyClass != null ) return proxyClass ; final ClassLoader loader = runtime . getJRubyClassLoader ( ) ; proxyClass = runtime . getJavaProxyClassFactory ( ) . genProxyClass ( runtime , ( ClassDefiningClassLoader ) loader , null , superClass , interfaces , names , field , extraMethods , clazz ) ; return JavaSupportImpl . saveJavaProxyClass ( runtime , classKey , proxyClass ) ; }
Returns a new (generated) proxy class based on arguments.
Returns a new ( generated ) proxy class based on arguments .
// so we can assume names != null // NOTE: currently we regenerate proxy classes when a Ruby method is added on the type