Package org.apache.activemq.util

Examples of org.apache.activemq.util.IdGenerator


    }
   
    protected synchronized IdGenerator getClientIdGenerator() {
        if (clientIdGenerator == null) {
            if (clientIDPrefix != null) {
                clientIdGenerator = new IdGenerator(clientIDPrefix);
            }
            else {
                clientIdGenerator = new IdGenerator();
            }
        }
        return clientIdGenerator;
    }
View Full Code Here


            // Fill in the remote broker's information now.
            remoteBrokerPath[0] = remoteBrokerId;
            remoteBrokerName = remoteBrokerInfo.getBrokerName();
            if (configuration.isUseBrokerNamesAsIdSeed()) {
                idGenerator = new IdGenerator(brokerService.getBrokerName() + "->" + remoteBrokerName);
            }
        } catch (Throwable e) {
            serviceLocalException(e);
        }
    }
View Full Code Here

    }

    protected synchronized IdGenerator getClientIdGenerator() {
        if (clientIdGenerator == null) {
            if (clientIDPrefix != null) {
                clientIdGenerator = new IdGenerator(clientIDPrefix);
            } else {
                clientIdGenerator = new IdGenerator();
            }
        }
        return clientIdGenerator;
    }
View Full Code Here

    }

    protected synchronized IdGenerator getConnectionIdGenerator() {
        if (connectionIdGenerator == null) {
            if (connectionIDPrefix != null) {
                connectionIdGenerator = new IdGenerator(connectionIDPrefix);
            } else {
                connectionIdGenerator = new IdGenerator();
            }
        }
        return connectionIdGenerator;
    }
View Full Code Here

        try {

            // Send the remove request
            Message remove = session.createMessage();
            remove.setStringProperty(ScheduledMessage.AMQ_SCHEDULER_ACTION, ScheduledMessage.AMQ_SCHEDULER_ACTION_REMOVEALL);
            remove.setStringProperty(ScheduledMessage.AMQ_SCHEDULED_ID, new IdGenerator().generateId());
            producer.send(remove);
        } catch (Exception e) {
            fail("Caught unexpected exception during remove of unscheduled message.");
        }
    }
View Full Code Here

     * test case for isDuplicate
     */
    public void testIsDuplicateString() {
        int count = 10000;
        ActiveMQMessageAudit audit = new ActiveMQMessageAudit();
        IdGenerator idGen = new IdGenerator();
        // add to a list
        List<String> list = new ArrayList<String>();
        for (int i = 0; i < count; i++) {
            String id = idGen.generateId();
            list.add(id);
            assertFalse(audit.isDuplicate(id));
        }
        for (String id : list) {
            assertTrue(audit.isDuplicate(id));
View Full Code Here

    }
   
    public void testIsInOrderString() {
        int count = 10000;
        ActiveMQMessageAudit audit = new ActiveMQMessageAudit();
        IdGenerator idGen = new IdGenerator();
        // add to a list
        List<String> list = new ArrayList<String>();
        for (int i = 0; i < count; i++) {
            String id = idGen.generateId();
            if (i==0) {
                assertFalse(audit.isDuplicate(id));
                assertTrue(audit.isInOrder(id));
            }
            if (i > 1 && i%2 != 0) {
View Full Code Here

    }

    protected synchronized IdGenerator getClientIdGenerator() {
        if (clientIdGenerator == null) {
            if (clientIDPrefix != null) {
                clientIdGenerator = new IdGenerator(clientIDPrefix);
            } else {
                clientIdGenerator = new IdGenerator();
            }
        }
        return clientIdGenerator;
    }
View Full Code Here

            factory = new ActiveMQConnectionFactory(broker.getVmConnectorURI());
            consumers = Collections.synchronizedMap(new HashMap<MessageConsumer, MessageIdList>());
            connections = Collections.synchronizedList(new ArrayList<Connection>());
            allMessages.setVerbose(verbose);
            id = new IdGenerator(broker.getBrokerName() + ":");
        }
View Full Code Here

    }

    protected synchronized IdGenerator getClientIdGenerator() {
        if (clientIdGenerator == null) {
            if (clientIDPrefix != null) {
                clientIdGenerator = new IdGenerator(clientIDPrefix);
            } else {
                clientIdGenerator = new IdGenerator();
            }
        }
        return clientIdGenerator;
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.util.IdGenerator

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.