Package org.codehaus.activemq.util

Examples of org.codehaus.activemq.util.IdGenerator


     * @param wireFormat
     * @param peerURIs
     * @throws JMSException
     */
    protected RemoteTransportChannel(WireFormat wireFormat, String peerURIs) throws JMSException{
        super(wireFormat,new IdGenerator().generateId());
        setPeerURIs(peerURIs);
        setDoDiscovery(false);
        setRemote(true);
    }
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.consumerIdGenerator = 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

        remoteBroker.addConnector(ActiveMQConnection.DEFAULT_URL);
        remoteBroker.start();
       
        ActiveMQConnectionFactory fac = new ActiveMQConnectionFactory("remote://" + URL + "?brokerName=receiver");
        receiver = fac.createConnection();
        receiver.setClientID(new IdGenerator().generateId());
        receiver.start();
        Session s = receiver.createSession(false,Session.AUTO_ACKNOWLEDGE);
        Topic destination = s.createTopic(getClass().getName());
        consumer = s.createDurableSubscriber(destination, destination.toString());
        fac = new ActiveMQConnectionFactory("remote://" + URL + "?brokerName=sender");
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

    public MulticastDiscoveryAgent(String channelName) throws JMSException {
        this.channelName = channelName;
        this.started = new SynchronizedBoolean(false);
        this.services = new ConcurrentHashMap();
        this.keepAliveMap = new ConcurrentHashMap();
        this.idGen = new IdGenerator();
        this.localId = idGen.generateId();
        this.keepAliveTimeout = DEFAULT_KEEP_ALIVE_TIMEOUT;
        this.timeoutCount = DEFAULT_TIMEOUT_COUNT;
        this.timeoutExpiration = this.keepAliveTimeout * timeoutCount;
        try {
View Full Code Here

    protected ActiveMQSession(ActiveMQConnection theConnection, int theAcknowledgeMode) throws JMSException {
        this.connection = theConnection;
        this.acknowledgeMode = theAcknowledgeMode;
        this.consumers = new CopyOnWriteArrayList();
        this.producers = new CopyOnWriteArrayList();
        this.consumerIdGenerator = new IdGenerator();
        this.transactionIdGenerator = new IdGenerator();
        this.temporaryDestinationGenerator = new IdGenerator();
        this.packetIdGenerator = new IdGenerator();
        this.closed = new SynchronizedBoolean(false);
        this.startTransaction = new SynchronizedBoolean(false);
        this.sessionId = connection.generateSessionId();
        this.startTime = System.currentTimeMillis();
        this.deliveredMessages = new DefaultQueueList();
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

TOP

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