Examples of allocate()


Examples of org.jruby.RubyClass.allocate()

                    @Override
                    public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) {
                        assert self instanceof RubyClass : "new defined on non-class";

                        RubyClass clazzSelf = (RubyClass)self;
                        IRubyObject newObj = clazzSelf.allocate();
                        RuntimeHelpers.invoke(context, newObj, "__jcreate!", args, block);
                        RuntimeHelpers.invoke(context, newObj, "initialize", args, block);

                        return newObj;
                    }
View Full Code Here

Examples of org.jruby.RubyClass.allocate()

            @Override
            public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) {
                assert self instanceof RubyClass : "InterfaceJavaProxy.new defined on non-class ";
                RubyClass rubyClass = (RubyClass)self;

                IRubyObject proxy = rubyClass.allocate();
                JavaClass javaClass = (JavaClass)RuntimeHelpers.invoke(context, proxy.getMetaClass(), "java_class");
                IRubyObject proxyInstance = Java.new_proxy_instance2(
                        self,
                        self,
                        RubyArray.newArray(context.getRuntime(), javaClass),
View Full Code Here

Examples of org.jruby.RubyClass.allocate()

    }

    private IRubyObject userNewUnmarshal() throws IOException {
        String className = unmarshalObject().asJavaString();
        RubyClass classInstance = findClass(className);
        IRubyObject result = classInstance.allocate();
        registerLinkTarget(result);
        IRubyObject marshaled = unmarshalObject();
        result.callMethod(getRuntime().getCurrentContext(),"marshal_load", marshaled);
        return result;
    }
View Full Code Here

Examples of org.jruby.runtime.ObjectAllocator.allocate()

                // The replacement "new" allocates and inits the Ruby object as before, but
                // also instantiates our proxified Java object by calling __jcreate!
                final ObjectAllocator proxyAllocator = clazz.getAllocator();
                clazz.setAllocator(new ObjectAllocator() {
                    public IRubyObject allocate(Ruby runtime, RubyClass klazz) {
                        IRubyObject newObj = proxyAllocator.allocate(runtime, klazz);
                        RuntimeHelpers.invoke(runtime.getCurrentContext(), newObj, "__jcreate!");
                        return newObj;
                    }
                });
View Full Code Here

Examples of org.libreplan.business.planner.entities.SpecificResourceAllocation.allocate()

        givenWorker(8);
        resourceAllocation.setResource(this.worker);
        assertTrue(resourceAllocation.getResource() != null);

        resourceAllocation.allocate(ResourcesPerDay.amount(1));
        assertThat(resourceAllocation.getAssignments().size(), equalTo(5));
        assertThat(resourceAllocation.getAssignments(), haveHours(8, 8, 8, 8, 8));

        assertThat(task.getAssignedHours(), equalTo(0));
        task.addResourceAllocation(resourceAllocation);
View Full Code Here

Examples of org.pdf4j.saxon.om.NamePool.allocate()

     */

    protected void openDocument() throws XPathException {
        NamePool pool = getPipelineConfiguration().getConfiguration().getNamePool();
        for (int i=0; i<emptyTagNames.length; i++) {
            emptyTags.add(pool.allocate("", NamespaceConstant.XHTML, emptyTagNames[i]) & NamePool.FP_MASK);
        }
        super.openDocument();
    }

    /**
 
View Full Code Here

Examples of org.snmp4j.agent.agentx.master.index.AgentXIndexRegistry.IndexRegistryEntry.allocate()

        return status;
      }
      return AgentXProtocol.AGENTX_SUCCESS;
    }
    else {
      return oldEntry.allocate(sessionID, vb.getVariable(), testOnly);
    }
  }

  public int release(int sessionID,
                     OctetString context, VariableBinding vb,
View Full Code Here

Examples of org.tmatesoft.sqljet.core.internal.ISqlJetMemoryBuffer.allocate()

                buffer = new SqlJetDirectByteBuffer();
                break;
            default:
                buffer = new SqlJetByteArrayBuffer();
            }
            buffer.allocate(size);
            return buffer;
        } else {
            return null;
        }
    }
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.