Examples of DrainRequest


Examples of com.hazelcast.concurrent.semaphore.client.DrainRequest

        Integer result = invoke(request);
        return result;
    }

    public int drainPermits() {
        DrainRequest request = new DrainRequest(name);
        Integer result = invoke(request);
        return result;
    }
View Full Code Here

Examples of com.hazelcast.concurrent.semaphore.client.DrainRequest

        Integer result = invoke(request);
        return result;
    }

    public int drainPermits() {
        DrainRequest request = new DrainRequest(name);
        Integer result = invoke(request);
        return result;
    }
View Full Code Here

Examples of com.hazelcast.queue.client.DrainRequest

    public int drainTo(Collection<? super E> objects) {
        return drainTo(objects, -1);
    }

    public int drainTo(Collection<? super E> c, int maxElements) {
        DrainRequest request = new DrainRequest(name, maxElements);
        PortableCollection result = invoke(request);
        Collection<Data> coll = result.getCollection();
        for (Data data : coll) {
            E e = (E) getContext().getSerializationService().toObject(data);
            c.add(e);
View Full Code Here

Examples of com.hazelcast.queue.client.DrainRequest

            }
        };
        constructors[DRAIN] = new ConstructorFunction<Integer, Portable>() {
            @Override
            public Portable createNew(Integer arg) {
                return new DrainRequest();
            }
        };
        constructors[CONTAINS] = new ConstructorFunction<Integer, Portable>() {
            @Override
            public Portable createNew(Integer arg) {
View Full Code Here

Examples of com.hazelcast.queue.client.DrainRequest

    public int drainTo(Collection<? super E> objects) {
        return drainTo(objects, -1);
    }

    public int drainTo(Collection<? super E> c, int maxElements) {
        DrainRequest request = new DrainRequest(name, maxElements);
        PortableCollection result = invoke(request);
        Collection<Data> coll = result.getCollection();
        for (Data data : coll) {
            E e = getContext().getSerializationService().toObject(data);
            c.add(e);
View Full Code Here

Examples of com.hazelcast.queue.impl.client.DrainRequest

    public int drainTo(Collection<? super E> objects) {
        return drainTo(objects, -1);
    }

    public int drainTo(Collection<? super E> c, int maxElements) {
        DrainRequest request = new DrainRequest(name, maxElements);
        PortableCollection result = invoke(request);
        Collection<Data> coll = result.getCollection();
        for (Data data : coll) {
            E e = getContext().getSerializationService().toObject(data);
            c.add(e);
View Full Code Here

Examples of com.hazelcast.queue.impl.client.DrainRequest

            }
        };
        constructors[DRAIN] = new ConstructorFunction<Integer, Portable>() {
            @Override
            public Portable createNew(Integer arg) {
                return new DrainRequest();
            }
        };
        constructors[CONTAINS] = new ConstructorFunction<Integer, Portable>() {
            @Override
            public Portable createNew(Integer arg) {
View Full Code Here

Examples of com.hazelcast.queue.impl.client.DrainRequest

        q.offer("item3");
        q.offer("item4");
        q.offer("item5");

        final SimpleClient client = getClient();
        client.send(new DrainRequest(queueName, 1));
        PortableCollection result = (PortableCollection) client.receive();
        Collection<Data> coll = result.getCollection();
        assertEquals(1, coll.size());
        assertEquals("item1", ss.toObject(coll.iterator().next()));
        assertEquals(4, q.size());
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.