Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 
 package org.jruby.ext.ffi.jffi;
 
 import org.jruby.Ruby;
Common method factory definitions
public abstract class MethodFactory {
    
    public static final DynamicMethod createDynamicMethod(Ruby runtimeRubyModule module,
            com.kenai.jffi.Function functionType returnTypeType[] parameterTypes,
            CallingConvention conventionIRubyObject enumsboolean ignoreErrno) {
        
        final MethodFactory[] factories = new MethodFactory[] { 
            DefaultMethodFactory.getFactory()
            
        };
        
        for (MethodFactory f : factories) {
            if (f.isSupported(returnTypeparameterTypesconvention)) {
                return f.createMethod(modulefunctionreturnTypeparameterTypesconventionenumsignoreErrno);
            }
        }
        
        throw runtime.newRuntimeError("cannot create dynamic method");
    }
    
    abstract boolean isSupported(Type returnTypeType[] parameterTypes
            CallingConvention convention);
    abstract DynamicMethod createMethod(RubyModule modulecom.kenai.jffi.Function function
            Type returnTypeType[] parameterTypesCallingConvention conventionIRubyObject enumsboolean ignoreErrno);
New to GrepCode? Check out our FAQ X