Examples of addReadWriteAttribute()


Examples of org.jruby.RubyClass.addReadWriteAttribute()

            }
        });
       
        RubyClass singleton = javaProxy.getSingletonClass();
       
        singleton.addReadWriteAttribute(context, "java_class");
       
        javaProxy.defineAnnotatedMethods(JavaProxy.class);
        javaProxy.includeModule(runtime.fastGetModule("JavaProxyMethods"));
       
        return javaProxy;
View Full Code Here

Examples of org.jruby.RubyClass.addReadWriteAttribute()

        }
        RubyClass rubySubclass = (RubyClass)subclass;
        rubySubclass.getInstanceVariables().fastSetInstanceVariable("@java_proxy_class", runtime.getNil());

        RubyClass subclassSingleton = rubySubclass.getSingletonClass();
        subclassSingleton.addReadWriteAttribute(context, "java_proxy_class");
        subclassSingleton.addMethod("java_interfaces", new JavaMethodZero(subclassSingleton, Visibility.PUBLIC) {
            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name) {
                IRubyObject javaInterfaces = self.getInstanceVariables().fastGetInstanceVariable("@java_interfaces");
                if (javaInterfaces != null) return javaInterfaces.dup();
View Full Code Here

Examples of org.jruby.RubyClass.addReadWriteAttribute()

        }
        RubyClass rubySubclass = (RubyClass)subclass;
        rubySubclass.getInstanceVariables().fastSetInstanceVariable("@java_proxy_class", runtime.getNil());

        RubyClass subclassSingleton = rubySubclass.getSingletonClass();
        subclassSingleton.addReadWriteAttribute(context, "java_proxy_class");
        subclassSingleton.addMethod("java_interfaces", new JavaMethodZero(subclassSingleton, PUBLIC) {
            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name) {
                IRubyObject javaInterfaces = self.getInstanceVariables().fastGetInstanceVariable("@java_interfaces");
                if (javaInterfaces != null) return javaInterfaces.dup();
View Full Code Here

Examples of org.jruby.RubyClass.addReadWriteAttribute()

            }
        });
       
        RubyClass singleton = javaProxy.getSingletonClass();
       
        singleton.addReadWriteAttribute(context, "java_class");
       
        javaProxy.defineAnnotatedMethods(JavaProxy.class);
        javaProxy.includeModule(runtime.fastGetModule("JavaProxyMethods"));
       
        return javaProxy;
View Full Code Here

Examples of org.jruby.RubyClass.addReadWriteAttribute()

    private static RubyObjectAdapter api = JavaEmbedUtils.newObjectAdapter();
   
    public static void createSSLSocket(Ruby runtime, RubyModule mSSL) {
        RubyClass cSSLSocket = mSSL.defineClassUnder("SSLSocket",runtime.getObject(),SSLSOCKET_ALLOCATOR);
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "io");
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "context");
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "sync_close");
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "hostname");
        cSSLSocket.defineAlias("to_io","io");
        cSSLSocket.defineAnnotatedMethods(SSLSocket.class);
View Full Code Here

Examples of org.jruby.RubyClass.addReadWriteAttribute()

    private static RubyObjectAdapter api = JavaEmbedUtils.newObjectAdapter();
   
    public static void createSSLSocket(Ruby runtime, RubyModule mSSL) {
        RubyClass cSSLSocket = mSSL.defineClassUnder("SSLSocket",runtime.getObject(),SSLSOCKET_ALLOCATOR);
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "io");
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "context");
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "sync_close");
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "hostname");
        cSSLSocket.defineAlias("to_io","io");
        cSSLSocket.defineAnnotatedMethods(SSLSocket.class);
    }
View Full Code Here

Examples of org.jruby.RubyClass.addReadWriteAttribute()

   
    public static void createSSLSocket(Ruby runtime, RubyModule mSSL) {
        RubyClass cSSLSocket = mSSL.defineClassUnder("SSLSocket",runtime.getObject(),SSLSOCKET_ALLOCATOR);
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "io");
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "context");
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "sync_close");
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "hostname");
        cSSLSocket.defineAlias("to_io","io");
        cSSLSocket.defineAnnotatedMethods(SSLSocket.class);
    }
View Full Code Here

Examples of org.jruby.RubyClass.addReadWriteAttribute()

    public static void createSSLSocket(Ruby runtime, RubyModule mSSL) {
        RubyClass cSSLSocket = mSSL.defineClassUnder("SSLSocket",runtime.getObject(),SSLSOCKET_ALLOCATOR);
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "io");
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "context");
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "sync_close");
        cSSLSocket.addReadWriteAttribute(runtime.getCurrentContext(), "hostname");
        cSSLSocket.defineAlias("to_io","io");
        cSSLSocket.defineAnnotatedMethods(SSLSocket.class);
    }

    public SSLSocket(Ruby runtime, RubyClass type) {
View Full Code Here

Examples of org.jruby.RubyClass.addReadWriteAttribute()

        // Subclasses of Java classes can safely use ivars, so we set this to silence warnings
        rubySubclass.setCacheProxy(true);

        RubyClass subclassSingleton = rubySubclass.getSingletonClass();
        subclassSingleton.addReadWriteAttribute(context, "java_proxy_class");
        subclassSingleton.addMethod("java_interfaces", new JavaMethodZero(subclassSingleton, PUBLIC) {
            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name) {
                IRubyObject javaInterfaces = self.getInstanceVariables().getInstanceVariable("@java_interfaces");
                if (javaInterfaces != null) return javaInterfaces.dup();
View Full Code Here

Examples of org.jruby.RubyClass.addReadWriteAttribute()

    };
   
    public static void createSSLContext(Ruby runtime, RubyModule mSSL) {
        RubyClass cSSLContext = mSSL.defineClassUnder("SSLContext",runtime.getObject(),SSLCONTEXT_ALLOCATOR);
        for(int i=0;i<ctx_attrs.length;i++) {
            cSSLContext.addReadWriteAttribute(runtime.getCurrentContext(), ctx_attrs[i]);
        }

        cSSLContext.defineAnnotatedMethods(SSLContext.class);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.