Package com.kenai.jffi

Examples of com.kenai.jffi.HeapInvocationBuffer$Encoder$SingletonHolder


            this.marshallers = marshallers;
        }

        public final Object invoke(Object self, Object[] parameters) {
            InvocationSession session = new InvocationSession();
            HeapInvocationBuffer buffer = new HeapInvocationBuffer(function.getCallContext());
            try {
                if (parameters != null) for (int i = 0; i < parameters.length; ++i) {
                    marshallers[i].marshal(session, buffer, parameters[i]);
                }
View Full Code Here


        }

        Invocation invocation = new Invocation(context);
        Function function = new Function(address.getAddress(), returnType, ffiParamTypes, convention);
        try {
            HeapInvocationBuffer args = new HeapInvocationBuffer(function);
            for (int i = 0; i < marshallers.length; ++i) {
                marshallers[i].marshal(invocation, args, params[i]);
            }

            return functionInvoker.invoke(context, function, args);
View Full Code Here

            }
        }
        this.postInvokeCount = piCount;
        this.referenceCount = refCount;
        this.needsInvocationSession = piCount > 0 || refCount > 0;
        this.dummyBuffer = new HeapInvocationBuffer(function);
    }
View Full Code Here

    public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name) {
        return functionInvoker.invoke(context, function, dummyBuffer);
    }
   
    public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject arg1) {
        HeapInvocationBuffer buffer = new HeapInvocationBuffer(function);
       
        if (needsInvocationSession) {
            Invocation invocation = new Invocation(context, postInvokeCount, referenceCount);
            try {
                parameterMarshallers[0].marshal(invocation, buffer, arg1);
View Full Code Here

        }
    }
   
    public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name,
                            IRubyObject arg1, IRubyObject arg2) {
        HeapInvocationBuffer buffer = new HeapInvocationBuffer(function);
        if (needsInvocationSession) {
            Invocation invocation = new Invocation(context, postInvokeCount, referenceCount);
            try {
                parameterMarshallers[0].marshal(invocation, buffer, arg1);
                parameterMarshallers[1].marshal(invocation, buffer, arg2);
View Full Code Here

        }
    }
   
    public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name,
                            IRubyObject arg1, IRubyObject arg2, IRubyObject arg3) {
        HeapInvocationBuffer buffer = new HeapInvocationBuffer(function);
        if (needsInvocationSession) {
            Invocation invocation = new Invocation(context, postInvokeCount, referenceCount);
            try {
                parameterMarshallers[0].marshal(invocation, buffer, arg1);
                parameterMarshallers[1].marshal(invocation, buffer, arg2);
View Full Code Here

    }


    public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args) {
       
        HeapInvocationBuffer buffer = new HeapInvocationBuffer(function);

        if (needsInvocationSession) {
            Invocation invocation = new Invocation(context, postInvokeCount, referenceCount);
            try {
                for (int i = 0; i < args.length; ++i) {
View Full Code Here

            this.arity = marshallers.length;
        }

        final HeapInvocationBuffer convertArguments(PyObject[] args) {
            checkArity(args);
            HeapInvocationBuffer buffer = new HeapInvocationBuffer(jffiFunction);

            for (int i = 0; i < marshallers.length; ++i) {
                marshallers[i].marshal(buffer, args[i]);
            }
View Full Code Here

            this.marshallers = marshallers;
        }

        public final Object invoke(Object self, Object[] parameters) {
            InvocationSession session = new InvocationSession();
            HeapInvocationBuffer buffer = new HeapInvocationBuffer(function.getCallContext());
            try {
                if (parameters != null) for (int i = 0; i < parameters.length; ++i) {
                    marshallers[i].marshal(session, buffer, parameters[i]);
                }
View Full Code Here

  {
    CommandMessage commandMessage = new CommandMessage();
    commandMessage.setOperation( CommandMessage.LOGIN_OPERATION );

    String credString = username + ":" + password;
    Encoder encoder = new Encoder( credString.length() );
    encoder.encode( credString.getBytes() );

    commandMessage.setBody( encoder.drain() );
    commandMessage.setDestination( DESTINATION );
    return commandMessage;
  }
View Full Code Here

TOP

Related Classes of com.kenai.jffi.HeapInvocationBuffer$Encoder$SingletonHolder

Copyright © 2018 www.massapicom. 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.