Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.SessionInfo


        try {
            //send the Connection info again
            sendConnectionInfoToBroker();
            for (Iterator iter = sessions.iterator(); iter.hasNext();) {
                ActiveMQSession session = (ActiveMQSession) iter.next();
                SessionInfo sessionInfo = createSessionInfo(session);
                sessionInfo.setStarted(true);
                asyncSendPacket(sessionInfo);
                //send consumers
                for (Iterator consumersIterator = session.consumers.iterator(); consumersIterator.hasNext();) {
                    ActiveMQMessageConsumer consumer = (ActiveMQMessageConsumer) consumersIterator.next();
                    ConsumerInfo consumerInfo = session.createConsumerInfo(consumer);
View Full Code Here


                            ProducerInfo info = (ProducerInfo) packet;
                            consumeProducerInfo(info);
                            break;
                        }
                        case Packet.SESSION_INFO : {
                            SessionInfo info = (SessionInfo) packet;
                            consumeSessionInfo(info);
                            break;
                        }
                        case Packet.ACTIVEMQ_CONNECTION_INFO : {
                            ConnectionInfo info = (ConnectionInfo) packet;
View Full Code Here

                        ProducerInfo info = (ProducerInfo) i.next();
                        info.setStarted(false);
                        this.brokerConnector.deregisterMessageProducer(this, info);
                    }
                    for (Iterator i = sessions.iterator();i.hasNext();) {
                        SessionInfo info = (SessionInfo) i.next();
                        info.setStarted(false);
                        this.brokerConnector.deregisterSession(this, info);
                    }
                    for (Iterator i = transactions.iterator();i.hasNext();) {
                        this.brokerConnector.rollbackTransaction(this, i.next().toString());
                    }
View Full Code Here

     * @throws IOException thrown if an error occurs
     */

    public void writePacket(Packet packet, DataOutput dataOut) throws IOException {
        super.writePacket(packet, dataOut);
        SessionInfo info = (SessionInfo) packet;
        super.writeUTF(info.getClientId(), dataOut);
        super.writeUTF(info.getSessionId(), dataOut);
        dataOut.writeLong(info.getStartTime());
        dataOut.writeBoolean(info.isStarted());
        dataOut.writeBoolean(info.isReceiptRequired());

    }
View Full Code Here

    /**
     * @return a new Packet instance
     */

    public Packet createPacket() {
        return new SessionInfo();
    }
View Full Code Here

     * @throws IOException
     */

    public void buildPacket(Packet packet, DataInput dataIn) throws IOException {
        super.buildPacket(packet, dataIn);
        SessionInfo info = (SessionInfo) packet;
        info.setClientId(dataIn.readUTF());
        info.setSessionId(dataIn.readUTF());
        info.setStartTime(dataIn.readLong());
        info.setStarted(dataIn.readBoolean());
        info.setReceiptRequired(dataIn.readBoolean());
    }
View Full Code Here

        this.sessions.add(session);
        addMessageDispatcher(session);
        if (started.get()) {
            session.start();
        }
        SessionInfo info = createSessionInfo(session);
        info.setStarted(true);
        asyncSendPacket(info);
    }
View Full Code Here

     * @throws JMSException
     */
    protected void removeSession(ActiveMQSession session) throws JMSException {
        this.sessions.remove(session);
        removeMessageDispatcher(session);
        SessionInfo info = createSessionInfo(session);
        info.setStarted(false);
        asyncSendPacket(info, false);
    }
View Full Code Here

        info.setStarted(false);
        asyncSendPacket(info, false);
    }

    private SessionInfo createSessionInfo(ActiveMQSession session) {
        SessionInfo info = new SessionInfo();
        info.setId(packetIdGenerator.generateId());
        info.setClientId(clientID);
        info.setSessionId(session.getSessionId());
        info.setStartTime(session.getStartTime());
        return info;
    }
View Full Code Here

        try {
            //send the Connection info again
            sendConnectionInfoToBroker(sendConnectionInfoTimeout, true);
            for (Iterator iter = sessions.iterator(); iter.hasNext();) {
                ActiveMQSession session = (ActiveMQSession) iter.next();
                SessionInfo sessionInfo = createSessionInfo(session);
                sessionInfo.setStarted(true);
                asyncSendPacket(sessionInfo, false);
                //send consumers
                for (Iterator consumersIterator = session.consumers.iterator(); consumersIterator.hasNext();) {
                    ActiveMQMessageConsumer consumer = (ActiveMQMessageConsumer) consumersIterator.next();
                    ConsumerInfo consumerInfo = session.createConsumerInfo(consumer);
View Full Code Here

TOP

Related Classes of org.codehaus.activemq.message.SessionInfo

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.