Package org.codehaus.activemq.util

Examples of org.codehaus.activemq.util.IdGenerator.generateId()


                System.out.println("Loading Message Broker from file: " + file);
                factory.setResource(new FileSystemResource(file));
            }

            IdGenerator idgen = new IdGenerator();
            BrokerContainer container = factory.createBrokerContainer(idgen.generateId(), BrokerContext.getInstance());
            container.start();

            // lets wait until we're killed.
            Object lock = new Object();
            synchronized (lock) {
View Full Code Here


    private void createBroker() throws ResourceAdapterInternalException {
        try {
            BrokerContainerFactory brokerContainerFactory = XmlConfigHelper.createBrokerContainerFactory(getBrokerXmlConfig());
            IdGenerator idgen = new IdGenerator();
            container = brokerContainerFactory.createBrokerContainer(idgen.generateId(), BrokerContext.getInstance());
            container.start();
            connectionFactory = new ActiveMQRAConnectionFactory(container, getServerUrl());
        } catch (JMSException e) {
            log.error(e.toString(), e);
            throw new ResourceAdapterInternalException("Failed to startup an embedded broker", e);
View Full Code Here

        IdGenerator idGen = new IdGenerator();
        //add to a list
        List list = new ArrayList();
        for (int i = 0; i < count; i++) {
            String id = idGen.generateId();
            list.add(id);
            assertTrue(audit.isDuplicate(id) == false);
        }
        for (int i = 0; i < count; i++) {
            String id = list.get(i).toString();
View Full Code Here

                                                                                this.getTopic(),
                                                                                this.getEmbeddedBroker());

        if (this.getDurable()) {
            IdGenerator idGenerator = new IdGenerator();
            connection.setClientID(idGenerator.generateId());
        }

        Session session = ServerConnectionFactory.createSession(connection, this.getTransacted());
        Destination destination = ServerConnectionFactory.createDestination(session,
                                                                            subject,
View Full Code Here

                                                                                this.getMQServer(),
                                                                                this.getTopic(),
                                                                                this.getEmbeddedBroker());
        if (this.getDurable()) {
            IdGenerator idGenerator = new IdGenerator();
            connection.setClientID(idGenerator.generateId());
        }
        //start connection before receiving messages.
        connection.start();

        Session session = ServerConnectionFactory.createSession(connection, this.getTransacted());
View Full Code Here

    protected PeerTransportChannel(WireFormat wireFormat, String serviceName) throws JMSException {
        this.wireFormat = wireFormat;
        this.serviceName = serviceName;
        this.discoveryURI = MulticastDiscoveryAgent.DEFAULT_DISCOVERY_URI;
        IdGenerator idGen = new IdGenerator();
        this.brokerName = idGen.generateId();
        this.brokerConnectorURI = DEFAULT_BROKER_CONNECTOR_URI;
        this.doDiscovery = true;
        if (serviceName == null || serviceName.length() == 0) {
            throw new IllegalStateException("No service name specified for peer:// protocol");
        }
View Full Code Here

        IdGenerator idGen = new IdGenerator();
        //add to a list
        List list = new ArrayList();
        for (int i = 0; i < count; i++) {
            String id = idGen.generateId();
            list.add(id);
            assertTrue(audit.isDuplicate(id) == false);
        }
        for (int i = 0; i < count; i++) {
            String id = list.get(i).toString();
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.