Package org.activemq.util

Examples of org.activemq.util.IdGenerator


  protected ActiveMQConnection(ActiveMQConnectionFactory factory,
      String theUserName, String thePassword) {
    this.factory = factory;
    this.userName = theUserName;
    this.password = thePassword;
    this.clientIdGenerator = new IdGenerator();
    this.packetIdGenerator = new IdGenerator();
    this.handleIdGenerator = new IdGenerator();
    this.sessionIdGenerator = new IdGenerator();
    this.consumerNumberGenerator = new SynchronizedInt(0);
    this.sessions = new CopyOnWriteArrayList();
    this.messageDispatchers = new CopyOnWriteArrayList();
    this.connectionConsumers = new CopyOnWriteArrayList();
    this.connectionMetaData = new ActiveMQConnectionMetaData();
View Full Code Here


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

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

        // Start connection before receiving messages.
        connection.start();
View Full Code Here

        Connection connection = ServerConnectionFactory.createConnectionFactory(this.getURL(),
                                                                                ACTIVEMQ_SERVER,
                                                                                this.getTopic(),
                                                                                this.getEmbeddedBroker());
        if (this.getDurable()) {
            IdGenerator idGenerator = new IdGenerator();
            connection.setClientID(idGenerator.generateId());
        }

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

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

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

        Session session = ServerConnectionFactory.createSession(connection,
                                                                TRANSACTED_FALSE,
                                                                ACTIVEMQ_SERVER,
View Full Code Here

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

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

        }

        // Start connection before receiving messages.
        connection.start();
View Full Code Here

    protected void publish(int x, String subject) throws Exception {
        MessageProducer publisher = null;
        Connection connection = createConnectionFactory(brokerUrl, isEmbeddedBroker);

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

        Session session = createSession(connection, TRANSACTED_FALSE);
        Destination destination = createDestination(session, subject, isTopic);
        publisher = session.createProducer(destination);
View Full Code Here

     */
    protected void subscribe(String subject) throws JMSException {
        Connection connection = createConnectionFactory(brokerUrl, isEmbeddedBroker);

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

        //Start the connection before receiving messages.
        connection.start();
        Session session = createSession(connection, TRANSACTED_FALSE);
View Full Code Here

    private static JmsTemplate createTemplate(String destinationName) {

        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory();
        connectionFactory.setBrokerURL(BROKER_URL);

        IdGenerator idGenerator = new IdGenerator();
        connectionFactory.setClientID(idGenerator.generateId());

        JmsTemplate jt = new JmsTemplate(connectionFactory);
        if (destinationName.startsWith("topic")) {
            jt.setPubSubDomain(true);
        }
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 ActiveMQConnectionFactory(container, getServerUrl());
        } catch (JMSException e) {
            log.error(e.toString(), e);
            throw new ResourceAdapterInternalException("Failed to startup an embedded broker", e);
View Full Code Here

    private Map localDiscoveryDetails;
    private Set remoteClientIds;


    public BrokerContainerImpl() {
        this(new IdGenerator().generateId());
    }
View Full Code Here

TOP

Related Classes of org.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.