Package org.apache.activemq.command

Examples of org.apache.activemq.command.SessionId


                1 };
       
        for (int i = 0; i < numberValues.length; i++) {
            long value = numberValues[i];
           
            SessionId object = new SessionId();
            object.setConnectionId(connectionId);
            object.setValue(value);
            writeObject(object);
        }
        ds.writeInt(endOfStreamMarker);
       
        // now lets read from the stream
        ds.close();
       
        ByteArrayInputStream in = new ByteArrayInputStream(buffer.toByteArray());
        DataInputStream dis = new DataInputStream(in);
        for (int i = 0; i < numberValues.length; i++) {
            long value = numberValues[i];
            String expected = Long.toHexString(value);
            log.info("Unmarshaling value: " + i + " = " + expected);
           
            SessionId command = (SessionId) openWireformat.unmarshal(dis);
            assertEquals("connection ID in object: "+ i, connectionId, command.getConnectionId());
            String actual = Long.toHexString(command.getValue());
            assertEquals("value of object: "+ i + " was: " + actual, expected, actual);
        }
        int marker = dis.readInt();
        assertEquals("Marker int", Integer.toHexString(endOfStreamMarker), Integer.toHexString(marker));
       
View Full Code Here


    protected ConnectionId createConnectionId(String string) {
        return new ConnectionId(string);
    }

    protected SessionId createSessionId(String string) {
        return new SessionId(createConnectionId(string), ++counter);
    }
View Full Code Here

            }});
        asyncConnectionThread.allowCoreThreadTimeOut(true);
       
        this.info = new ConnectionInfo(new ConnectionId(connectionIdGenerator.generateId()));
        this.info.setManageable(true);
        this.connectionSessionId = new SessionId(info.getConnectionId(), -1);
       
        this.transport.setTransportListener(this);

        this.stats = new JMSConnectionStatsImpl(sessions, this instanceof XAConnection);
        this.factoryStats.addConnection(this);
View Full Code Here

    /**
     * @return sessionId
     */
    protected SessionId getNextSessionId() {
        return new SessionId(info.getConnectionId(), sessionIdGenerator.getNextSequenceId());
    }
View Full Code Here

    public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName,
            String messageSelector, ServerSessionPool sessionPool, int maxMessages, boolean noLocal)
            throws JMSException {
        checkClosedOrFailed();
        ensureConnectionInfoSent();
        SessionId sessionId = new SessionId(info.getConnectionId(), -1);
        ConsumerInfo info = new ConsumerInfo(new ConsumerId(sessionId, consumerIdGenerator
                .getNextSequenceId()));
        info.setDestination(ActiveMQMessageTransformation.transformDestination(topic));
        info.setSubscriptionName(subscriptionName);
        info.setSelector(messageSelector);
View Full Code Here

        this.isConnectionInfoSentToBroker = true;
        // Add a temp destination advisory consumer so that
        // We know what the valid temporary destinations are on the
        // broker without having to do an RPC to the broker.
       
        ConsumerId consumerId = new ConsumerId(new SessionId(info.getConnectionId(), -1),consumerIdGenerator.getNextSequenceId());
        if( watchTopicAdvisories ) {
          advisoryConsumer = new AdvisoryConsumer(this, consumerId);
        }
    }
View Full Code Here

    }

    protected ProducerId createProducerId() {
        String id = idGenerator.generateId();
        ConnectionId connectionId = new ConnectionId(id);
        SessionId sessionId = new SessionId(connectionId, 1);
        return new ProducerId(sessionId, 1);
    }
View Full Code Here

        return TRACKED_RESPONSE_MARKER;
    }


    public Response processAddProducer(ProducerInfo info) throws Exception {
        SessionId sessionId = info.getProducerId().getParentId();
        ConnectionId connectionId = sessionId.getParentId();
        ConnectionState cs = (ConnectionState) connectionStates.get(connectionId);
        SessionState ss = cs.getSessionState(sessionId);
        ss.addProducer(info);
        return TRACKED_RESPONSE_MARKER;
    }
View Full Code Here

        ss.addProducer(info);
        return TRACKED_RESPONSE_MARKER;
    }
   
    public Response processRemoveProducer(ProducerId id) throws Exception {
        SessionId sessionId = id.getParentId();
        ConnectionId connectionId = sessionId.getParentId();       
        ConnectionState cs = (ConnectionState) connectionStates.get(connectionId);
        SessionState ss = cs.getSessionState(sessionId);
        ss.removeProducer(id);       
        return TRACKED_RESPONSE_MARKER;
    }
View Full Code Here

        ss.removeProducer(id);       
        return TRACKED_RESPONSE_MARKER;
    }

    public Response processAddConsumer(ConsumerInfo info) throws Exception {
        SessionId sessionId = info.getConsumerId().getParentId();
        ConnectionId connectionId = sessionId.getParentId();
        ConnectionState cs = (ConnectionState) connectionStates.get(connectionId);
        SessionState ss = cs.getSessionState(sessionId);
        ss.addConsumer(info);
        return TRACKED_RESPONSE_MARKER;
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.command.SessionId

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.