Package org.activemq.message

Examples of org.activemq.message.ConnectionInfo


      return;
    }

    this.isConnectionInfoSentToBroker = true;
    ensureClientIDInitialised();
    ConnectionInfo info = new ConnectionInfo();
    info.setClientId(this.clientID);
    info.setHostName(IdGenerator.getHostName());
    info.setUserName(userName);
    info.setPassword(password);
    info.setStartTime(startTime);
    info.setStarted(started.get());
    info.setClosed(closed || closing);
    info.setClientVersion(connectionMetaData.getProviderVersion());
    info.setWireFormatVersion(transportChannel
        .getCurrentWireFormatVersion());
    if (info.getProperties() != null) {
      info.getProperties().setProperty(ConnectionInfo.NO_DELAY_PROPERTY,
          new Boolean(!useAsyncSend).toString());
    }
    if (quickClose && info.isClosed()) {
      asyncSendPacket(info);
    } else {
      syncSendPacket(info, timeout);
    }
  }
View Full Code Here


        String login = headers.getProperty(Stomp.Headers.Connect.LOGIN);
        String passcode = headers.getProperty(Stomp.Headers.Connect.PASSCODE);

        // skip to end of the packet
        while (in.read() != 0) {}
        final ConnectionInfo info = new ConnectionInfo();
        final Short packet_id = new Short(PACKET_IDS.getNextShortSequence());
        clientId = clientIds.generateId();
        commandParser.setClientId(clientId);

        info.setClientId(clientId);
        info.setReceiptRequired(true);
        info.setClientVersion(Integer.toString(getCurrentWireFormatVersion()));
        info.setClosed(false);
        info.setHostName("ttmp.fake.host.name");
        info.setId(packet_id.shortValue());
        info.setUserName(login);
        info.setPassword(passcode);
        info.setStartTime(System.currentTimeMillis());
        info.setStarted(true);

        AsyncHelper.tryUntilNotInterrupted(new AsyncHelper.Helper()
        {
            public void cycle() throws InterruptedException
            {
                pendingReadPackets.put(info);
            }
        });

        addReceiptListener(new ReceiptListener()
        {
            public boolean onReceipt(Receipt receipt, DataOutput out)
            {
                if (receipt.getCorrelationId() != packet_id.shortValue()) return false;
                final Short session_packet_id = new Short(PACKET_IDS.getNextShortSequence());
                sessionId = clientIds.getNextShortSequence();
                commandParser.setSessionId(sessionId);

                final SessionInfo info = new SessionInfo();
                info.setStartTime(System.currentTimeMillis());
                info.setId(session_packet_id.shortValue());
                info.setClientId(clientId);
                info.setSessionId(sessionId);
                info.setStarted(true);
                info.setSessionMode(Session.AUTO_ACKNOWLEDGE);
                info.setReceiptRequired(true);

                AsyncHelper.tryUntilNotInterrupted(new AsyncHelper.Helper()
                {
                    public void cycle() throws InterruptedException
                    {
View Full Code Here

    }

    // Implementation methods
    //-------------------------------------------------------------------------
    protected Packet createConnectionInfo() {
        connectionInfo = new ConnectionInfo();
        connectionInfo.setStarted(true);
        connectionInfo.setClientId(this.clientID);
        connectionInfo.setClientVersion("" + getCurrentWireFormatVersion());
        connectionInfo.setUserName(userName);
        return connectionInfo;
View Full Code Here

        this.clientId = clientId;
    }

    public PacketEnvelope build(String line, DataInput in) throws IOException
    {
        ConnectionInfo ci = new ConnectionInfo();
        ci.setClientId(clientId);
        ci.setClosed(true);
        ci.setStarted(false);
        while (in.readByte() != 0) {}
        return new PacketEnvelope(ci, new Properties());
    }
View Full Code Here

      return;
    }

    this.isConnectionInfoSentToBroker = true;
    ensureClientIDInitialised();
    ConnectionInfo info = new ConnectionInfo();
    info.setClientId(this.clientID);
    info.setHostName(IdGenerator.getHostName());
    info.setUserName(userName);
    info.setPassword(password);
    info.setStartTime(startTime);
    info.setStarted(started.get());
    info.setClosed(closed || closing);
    info.setClientVersion(connectionMetaData.getProviderVersion());
    info.setWireFormatVersion(transportChannel
        .getCurrentWireFormatVersion());
    if (info.getProperties() != null) {
      info.getProperties().setProperty(ConnectionInfo.NO_DELAY_PROPERTY,
          new Boolean(!useAsyncSend).toString());
    }
    if (quickClose && info.isClosed()) {
      asyncSendPacket(info);
    } else {
      syncSendPacket(info, timeout);
    }
  }
View Full Code Here

    }

    // Implementation methods
    //-------------------------------------------------------------------------
    protected Packet createConnectionInfo() {
        connectionInfo = new ConnectionInfo();
        connectionInfo.setStarted(true);
        connectionInfo.setClientId(this.clientID);
        connectionInfo.setClientVersion("" + getCurrentWireFormatVersion());
        connectionInfo.setUserName(userName);
        producerID = idGenerator.generateId();
View Full Code Here

      return;
    }

    this.isConnectionInfoSentToBroker = true;
    ensureClientIDInitialised();
    ConnectionInfo info = new ConnectionInfo();
    info.setClientId(this.clientID);
    info.setHostName(IdGenerator.getHostName());
    info.setUserName(userName);
    info.setPassword(password);
    info.setStartTime(startTime);
    info.setStarted(started.get());
    info.setClosed(closed || closing);
    info.setClientVersion(connectionMetaData.getProviderVersion());
    info.setWireFormatVersion(transportChannel
        .getCurrentWireFormatVersion());
    if (info.getProperties() != null) {
      info.getProperties().setProperty(ConnectionInfo.NO_DELAY_PROPERTY,
          new Boolean(!useAsyncSend).toString());
    }
    if (quickClose && info.isClosed()) {
      asyncSendPacket(info);
    } else {
      syncSendPacket(info, timeout);
    }
  }
View Full Code Here

            String brokerClientID = createMulticastClientID();
            channel.setClientID(brokerClientID);

            // lets spoof a consumer for topics which will replicate messages
            // over the multicast transport
            ConnectionInfo info = new ConnectionInfo();
            info.setHostName(IdGenerator.getHostName());
            info.setClientId(brokerClientID);
            info.setStarted(true);
            client.consumeConnectionInfo(info);

            ConsumerInfo consumerInfo = new ConsumerInfo();
            consumerInfo.setDestination(new ActiveMQTopic(">"));
            consumerInfo.setNoLocal(true);
View Full Code Here

            for (Iterator i = producers.iterator();i.hasNext();) {
                ProducerInfo info = (ProducerInfo) i.next();
                dispatchToTarget(sender, generateAdvisory(advisory, info));
            }
            for (Iterator i = connections.iterator();i.hasNext();) {
                ConnectionInfo info = (ConnectionInfo) i.next();
                dispatchToTarget(sender, generateAdvisory(advisory, info));
            }
            for (Iterator i = tempDestinations.values().iterator();i.hasNext();) {
                Set set = (Set) i.next();
                for (Iterator si = set.iterator();si.hasNext();) {
View Full Code Here

                            SessionInfo info = (SessionInfo) packet;
                            consumeSessionInfo(info);
                            break;
                        }
                        case Packet.ACTIVEMQ_CONNECTION_INFO : {
                            ConnectionInfo info = (ConnectionInfo) packet;
                            consumeConnectionInfo(info);
                            break;
                        }
                        case Packet.DURABLE_UNSUBSCRIBE : {
                            DurableUnsubscribe ds = (DurableUnsubscribe) packet;
View Full Code Here

TOP

Related Classes of org.activemq.message.ConnectionInfo

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.