Package org.activemq.util

Examples of org.activemq.util.IdGenerator


    private boolean reuseMessageId; //hint to reuse the same messageId - if already set

    protected ActiveMQMessageProducer(ActiveMQSession theSession, ActiveMQDestination destination) throws JMSException {
        this.session = theSession;
        this.defaultDestination = destination;
        this.idGenerator = new IdGenerator();
        this.disableMessageID = false;
        this.disableMessageTimestamp = theSession.connection.isDisableTimeStampsByDefault();
        this.defaultDeliveryMode = Message.DEFAULT_DELIVERY_MODE;
        this.defaultPriority = Message.DEFAULT_PRIORITY;
        this.defaultTimeToLive = Message.DEFAULT_TIME_TO_LIVE;
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

                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

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

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

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

    public void testIsDuplicateString() {
        int count = 10000;

        ActiveMQMessageAudit audit = new ActiveMQMessageAudit();

        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

    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

    private Map localDiscoveryDetails;
    private Set remoteClientIds;


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

    /**
     * Default Constructor of BrokerClientImpl
     */
    public BrokerClientImpl() {
        this.packetIdGenerator = new IdGenerator();
        this.closed = new SynchronizedBoolean(false);
        this.started = new SynchronizedBoolean(false);
        this.activeConsumers = new HashSet();
        this.consumers = new CopyOnWriteArrayList();
        this.producers = new CopyOnWriteArrayList();
View Full Code Here

        Connection connection = ServerConnectionFactory.createConnectionFactory(this.getURL(),
                                                                                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,
View Full Code Here

        remoteBroker.addConnector(ActiveMQConnection.DEFAULT_BROKER_URL);
        remoteBroker.start();
       
        ActiveMQConnectionFactory fac = new ActiveMQConnectionFactory("remote://" + URL + "?brokerName=receiver");
        consumerConnection = fac.createConnection();
        consumerConnection.setClientID(new IdGenerator().generateId());
        consumerConnection.start();
       
        fac = new ActiveMQConnectionFactory("remote://" + URL + "?brokerName=sender");
        producerConnection = fac.createConnection();
        producerConnection.start();
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.