Package org.apache.activemq.util

Examples of org.apache.activemq.util.IdGenerator


import org.apache.activemq.util.IdGenerator;

public class DestinationMapTempDestinationTest extends TestCase {

    public void testtestTempDestinations() throws Exception {
        ConnectionId id = new ConnectionId(new IdGenerator().generateId());
        DestinationMap map = new DestinationMap();
        Object value = new Object();
        int count = 1000;
        for (int i = 0; i < count; i++) {
            ActiveMQTempQueue queue = new ActiveMQTempQueue(id, i);
View Full Code Here


            factory = new ActiveMQConnectionFactory(broker.getVmConnectorURI());
            factory.setConnectionIDPrefix(broker.getBrokerName());
            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

          // 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

import org.apache.activemq.util.IdGenerator;

public class DestinationMapTempDestinationTest extends TestCase {
   
    public void testtestTempDestinations() throws Exception {
        ConnectionId id = new ConnectionId(new IdGenerator().generateId());
        DestinationMap map = new DestinationMap();
        Object value = new Object();
        int count = 1000;
        for (int i = 0; i < count; i++) {
            ActiveMQTempQueue queue = new ActiveMQTempQueue(id, i);
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

     * 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));
        }
        List<String> windowList = list.subList(list.size() -1 -audit.getAuditDepth(), list.size() -1);
        for (String id : windowList) {
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

    }

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

        cf.setServiceName(getService());
        if (getEndpoint() != null) {
            cf.setEndpointName(new QName(getService().getNamespaceURI(), getEndpoint()));
        }
        cf.setServiceClass(type);
        cf.setAddress("jbi://" + new IdGenerator().generateSanitizedId());
        if (isUseJBIWrapper()) {
            cf.setBindingId(org.apache.cxf.binding.jbi.JBIConstants.NS_JBI_BINDING);
        }
        Bus bus = BusFactory.getDefaultBus();
        JBITransportFactory jbiTransportFactory = (JBITransportFactory) bus
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.