Package org.apache.activemq.command

Examples of org.apache.activemq.command.ActiveMQTempQueue


     * @since 1.1
     */
    public Queue createQueue(String queueName) throws JMSException {
        checkClosed();
        if (queueName.startsWith(ActiveMQDestination.TEMP_DESTINATION_NAME_PREFIX)) {
            return new ActiveMQTempQueue(queueName);
        }
        return new ActiveMQQueue(queueName);
    }
View Full Code Here


        ActiveMQDestination rc = tempDestinations.get(name);
        if( rc == null ) {
            if (topic) {
                rc = new ActiveMQTempTopic(connectionId, tempDestinationGenerator.getNextSequenceId());
            } else {
                rc = new ActiveMQTempQueue(connectionId, tempDestinationGenerator.getNextSequenceId());
            }
            sendToActiveMQ(new DestinationInfo(connectionId, DestinationInfo.ADD_OPERATION_TYPE, rc), null);
            tempDestinations.put(name, rc);
            tempDestinationAmqToStompMap.put(rc.getQualifiedName(), name);
        }
View Full Code Here

        // Check if Destination info is of temporary type.
        ActiveMQTempDestination dest;
        if( topic ) {
            dest = new ActiveMQTempTopic(info.getConnectionId(), tempDestinationIdGenerator.getNextSequenceId());
        } else {
            dest = new ActiveMQTempQueue(info.getConnectionId(), tempDestinationIdGenerator.getNextSequenceId());
        }
       
        DestinationInfo info = new DestinationInfo();
        info.setConnectionId(this.info.getConnectionId());
        info.setOperationType(DestinationInfo.ADD_OPERATION_TYPE);
View Full Code Here

        assertPermString("queue:myQueue:write", perms);
    }

    @Test
    public void testGetPermissionsWithTemporaryQueue() {
        ActiveMQTempQueue queue = new ActiveMQTempQueue("myTempQueue");
        DestinationAction action = new DestinationAction(new ConnectionContext(), queue, "read");
        Collection<Permission> perms = resolver.getPermissions(action);
        assertPermString("temp-queue:myTempQueue:read", perms);
    }
View Full Code Here

        ActiveMQDestination rc = tempDestinations.get(name);
        if( rc == null ) {
            if (topic) {
                rc = new ActiveMQTempTopic(connectionId, tempDestinationGenerator.getNextSequenceId());
            } else {
                rc = new ActiveMQTempQueue(connectionId, tempDestinationGenerator.getNextSequenceId());
            }
            sendToActiveMQ(new DestinationInfo(connectionId, DestinationInfo.ADD_OPERATION_TYPE, rc), null);
            tempDestinations.put(name, rc);
            tempDestinationAmqToStompMap.put(rc.getQualifiedName(), name);
        }
View Full Code Here

        }
        if (kind == Topic.class) {
            return kind.cast(new ActiveMQTopic(destinationName));
        }
        if (kind == TemporaryQueue.class) {
            return kind.cast(new ActiveMQTempQueue(destinationName));
        }
        if (kind == TemporaryTopic.class) {
            return kind.cast(new ActiveMQTempTopic(destinationName));
        }
View Full Code Here

        return false;
    }

    private ActiveMQDestination createTempQueue() {
        ActiveMQDestination rc;
        rc = new ActiveMQTempQueue(connectionId, nextTempDestinationId++);
        DestinationInfo info = new DestinationInfo();
        info.setConnectionId(connectionId);
        info.setOperationType(DestinationInfo.ADD_OPERATION_TYPE);
        info.setDestination(rc);
        sendToActiveMQ(info, null);
View Full Code Here

                // TODO - we need to cast TempTopic to TempQueue as we internally are using temp queues for all dynamic destinations
                // we need to figure out how to support both queues and topics
                if (message.getJMSReplyTo() != null && message.getJMSReplyTo() instanceof ActiveMQTempTopic) {
                    ActiveMQTempTopic tempTopic = (ActiveMQTempTopic)message.getJMSReplyTo();
                    message.setJMSReplyTo(new ActiveMQTempQueue(tempTopic.getPhysicalName()));
                }
                current = null;

                if (destination != null) {
                    message.setJMSDestination(destination);
View Full Code Here

        // Check if Destination info is of temporary type.
        ActiveMQTempDestination dest;
        if (topic) {
            dest = new ActiveMQTempTopic(info.getConnectionId(), tempDestinationIdGenerator.getNextSequenceId());
        } else {
            dest = new ActiveMQTempQueue(info.getConnectionId(), tempDestinationIdGenerator.getNextSequenceId());
        }

        DestinationInfo info = new DestinationInfo();
        info.setConnectionId(this.info.getConnectionId());
        info.setOperationType(DestinationInfo.ADD_OPERATION_TYPE);
View Full Code Here

        connection = connectionFactory.createConnection();

        connection.setClientID(clientID);
        connection.start();
        Session session = connection.createSession(transacted, authMode);
        ActiveMQTempQueue tQueue = (ActiveMQTempQueue) session.createTemporaryQueue();
        Thread.sleep(1000);

        ObjectName queueViewMBeanName = assertRegisteredObjectName(domain + ":type=Broker,brokerName=localhost,destinationType="
                + JMXSupport.encodeObjectNamePart(tQueue.getDestinationTypeAsString())
                + ",destinationName=" + JMXSupport.encodeObjectNamePart(tQueue.getPhysicalName()));

                        // should not throw an exception

        mbeanServer.getObjectInstance(queueViewMBeanName);

        tQueue.delete();
        Thread.sleep(1000);
        try {
            // should throw an exception
            mbeanServer.getObjectInstance(queueViewMBeanName);
View Full Code Here

TOP

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

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.