Package com.hazelcast.core

Examples of com.hazelcast.core.IQueue.offer()


    @Test
    public void testRemove() throws IOException {

        final IQueue q = getQueue();
        q.offer("item1");
        q.offer("item2");
        q.offer("item3");

        final SimpleClient client = getClient();
        client.send(new RemoveRequest(queueName, ss.toData("item2")));
View Full Code Here


    @Test
    public void testRemove() throws IOException {

        final IQueue q = getQueue();
        q.offer("item1");
        q.offer("item2");
        q.offer("item3");

        final SimpleClient client = getClient();
        client.send(new RemoveRequest(queueName, ss.toData("item2")));
        Boolean result = (Boolean) client.receive();
View Full Code Here

    public void testRemove() throws IOException {

        final IQueue q = getQueue();
        q.offer("item1");
        q.offer("item2");
        q.offer("item3");

        final SimpleClient client = getClient();
        client.send(new RemoveRequest(queueName, ss.toData("item2")));
        Boolean result = (Boolean) client.receive();
        assertTrue(result);
View Full Code Here

    }

    @Test
    public void testSize() throws IOException {
        final IQueue q = getQueue();
        q.offer("item1");
        q.offer("item2");
        q.offer("item3");

        final SimpleClient client = getClient();
        client.send(new SizeRequest(queueName));
View Full Code Here

    @Test
    public void testSize() throws IOException {
        final IQueue q = getQueue();
        q.offer("item1");
        q.offer("item2");
        q.offer("item3");

        final SimpleClient client = getClient();
        client.send(new SizeRequest(queueName));
        int result = (Integer) client.receive();
View Full Code Here

    @Test
    public void testSize() throws IOException {
        final IQueue q = getQueue();
        q.offer("item1");
        q.offer("item2");
        q.offer("item3");

        final SimpleClient client = getClient();
        client.send(new SizeRequest(queueName));
        int result = (Integer) client.receive();
        assertEquals(result, q.size());
View Full Code Here

    @Test
    public void testRemainingCapacity() throws IOException {
        createConfig();
        IQueue queue = getQueue();
        queue.offer("item1");
        queue.offer("item2");

        final SimpleClient client = getClient();
        client.send(new RemainingCapacityRequest(queueName));
        int result = (Integer) client.receive();
View Full Code Here

    @Test
    public void testRemainingCapacity() throws IOException {
        createConfig();
        IQueue queue = getQueue();
        queue.offer("item1");
        queue.offer("item2");

        final SimpleClient client = getClient();
        client.send(new RemainingCapacityRequest(queueName));
        int result = (Integer) client.receive();
        assertEquals(4, result);
View Full Code Here

        final SimpleClient client = getClient();
        client.send(new RemoveListenerRequest(queueName, registrationId));
        boolean result = (Boolean) client.receive();

        assertTrue(result);
        queue.offer("item3");
        assertSizeEventually(3, queue);
        assertNotEquals(3, addCounter.get());
    }

    private static class TestListener implements ItemListener {
View Full Code Here

            public void itemRemoved(ItemEvent itemEvent) {
            }
        };
        q.addItemListener(ql, false);
        q.offer(1);
        Thread.sleep(sleep);
        q.destroy();
        q = instance.getQueue(name);
        String id = q.addItemListener(ql, false);
        q.offer(2);
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.