Package com.hazelcast.queue.impl.client

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


            }
        };
        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

        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

Related Classes of com.hazelcast.queue.impl.client.DrainRequest

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.