Search in sources :

Example 6 with ActiveMQTempQueue

use of org.apache.activemq.command.ActiveMQTempQueue in project activemq-artemis by apache.

the class ActiveMQTempQueueTest method populateObject.

@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    ActiveMQTempQueue info = (ActiveMQTempQueue) object;
}
Also used : ActiveMQTempQueue(org.apache.activemq.command.ActiveMQTempQueue)

Example 7 with ActiveMQTempQueue

use of org.apache.activemq.command.ActiveMQTempQueue in project activemq-artemis by apache.

the class MessageTransformationTest method testTransformDestination.

/**
 * Tests transforming destinations into ActiveMQ's destination
 * implementation.
 */
public void testTransformDestination() throws Exception {
    assertTrue("Transforming a TempQueue destination to an ActiveMQTempQueue", ActiveMQMessageTransformation.transformDestination(new ActiveMQTempQueue()) instanceof ActiveMQTempQueue);
    assertTrue("Transforming a TempTopic destination to an ActiveMQTempTopic", ActiveMQMessageTransformation.transformDestination(new ActiveMQTempTopic()) instanceof ActiveMQTempTopic);
    assertTrue("Transforming a Queue destination to an ActiveMQQueue", ActiveMQMessageTransformation.transformDestination(new ActiveMQQueue()) instanceof ActiveMQQueue);
    assertTrue("Transforming a Topic destination to an ActiveMQTopic", ActiveMQMessageTransformation.transformDestination(new ActiveMQTopic()) instanceof ActiveMQTopic);
    assertTrue("Transforming a Destination to an ActiveMQDestination", ActiveMQMessageTransformation.transformDestination(new ActiveMQTopic()) instanceof ActiveMQDestination);
}
Also used : ActiveMQTopic(org.apache.activemq.command.ActiveMQTopic) ActiveMQTempTopic(org.apache.activemq.command.ActiveMQTempTopic) ActiveMQQueue(org.apache.activemq.command.ActiveMQQueue) ActiveMQTempQueue(org.apache.activemq.command.ActiveMQTempQueue) ActiveMQDestination(org.apache.activemq.command.ActiveMQDestination)

Example 8 with ActiveMQTempQueue

use of org.apache.activemq.command.ActiveMQTempQueue in project activemq-artemis by apache.

the class OpenWireConnection method tempQueueDeleted.

@Override
public void tempQueueDeleted(SimpleString bindingName) {
    ActiveMQDestination dest = new ActiveMQTempQueue(bindingName.toString());
    state.removeTempDestination(dest);
    if (!AdvisorySupport.isAdvisoryTopic(dest)) {
        AMQConnectionContext context = getContext();
        DestinationInfo advInfo = new DestinationInfo(context.getConnectionId(), DestinationInfo.REMOVE_OPERATION_TYPE, dest);
        ActiveMQTopic topic = AdvisorySupport.getDestinationAdvisoryTopic(dest);
        try {
            protocolManager.fireAdvisory(context, topic, advInfo);
        } catch (Exception e) {
            logger.warn("Failed to fire advisory on " + topic, e);
        }
    }
}
Also used : DestinationInfo(org.apache.activemq.command.DestinationInfo) ActiveMQTopic(org.apache.activemq.command.ActiveMQTopic) AMQConnectionContext(org.apache.activemq.artemis.core.protocol.openwire.amq.AMQConnectionContext) ActiveMQTempQueue(org.apache.activemq.command.ActiveMQTempQueue) ActiveMQException(org.apache.activemq.artemis.api.core.ActiveMQException) ActiveMQRemoteDisconnectException(org.apache.activemq.artemis.api.core.ActiveMQRemoteDisconnectException) IllegalStateException(javax.jms.IllegalStateException) XAException(javax.transaction.xa.XAException) InvalidDestinationException(javax.jms.InvalidDestinationException) ActiveMQNonExistentQueueException(org.apache.activemq.artemis.api.core.ActiveMQNonExistentQueueException) IOException(java.io.IOException) ActiveMQAddressExistsException(org.apache.activemq.artemis.api.core.ActiveMQAddressExistsException) ActiveMQSecurityException(org.apache.activemq.artemis.api.core.ActiveMQSecurityException) JMSSecurityException(javax.jms.JMSSecurityException) ActiveMQQueueExistsException(org.apache.activemq.artemis.api.core.ActiveMQQueueExistsException) InvalidClientIDException(javax.jms.InvalidClientIDException) ActiveMQDestination(org.apache.activemq.command.ActiveMQDestination)

Example 9 with ActiveMQTempQueue

use of org.apache.activemq.command.ActiveMQTempQueue in project activemq-artemis by apache.

the class DestinationMapTempDestinationTest method testtestTempDestinations.

public void testtestTempDestinations() throws Exception {
    ConnectionId id = new ConnectionId(new IdGenerator().generateId());
    DestinationMap map = new DestinationMap();
    Object value = new Object();
    int count = 1000;
    for (int i = 0; i < count; i++) {
        ActiveMQTempQueue queue = new ActiveMQTempQueue(id, i);
        map.put(queue, value);
    }
    for (int i = 0; i < count; i++) {
        ActiveMQTempQueue queue = new ActiveMQTempQueue(id, i);
        map.remove(queue, value);
        Set<?> set = map.get(queue);
        assertTrue(set.isEmpty());
    }
}
Also used : ConnectionId(org.apache.activemq.command.ConnectionId) IdGenerator(org.apache.activemq.util.IdGenerator) ActiveMQTempQueue(org.apache.activemq.command.ActiveMQTempQueue)

Aggregations

ActiveMQTempQueue (org.apache.activemq.command.ActiveMQTempQueue)9 ActiveMQDestination (org.apache.activemq.command.ActiveMQDestination)3 ActiveMQTopic (org.apache.activemq.command.ActiveMQTopic)3 ActiveMQQueue (org.apache.activemq.command.ActiveMQQueue)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 IllegalStateException (javax.jms.IllegalStateException)1 InvalidClientIDException (javax.jms.InvalidClientIDException)1 InvalidDestinationException (javax.jms.InvalidDestinationException)1 JMSSecurityException (javax.jms.JMSSecurityException)1 MessageConsumer (javax.jms.MessageConsumer)1 MessageProducer (javax.jms.MessageProducer)1 TextMessage (javax.jms.TextMessage)1 XAException (javax.transaction.xa.XAException)1 ActiveMQConnection (org.apache.activemq.ActiveMQConnection)1 ActiveMQConnectionFactory (org.apache.activemq.ActiveMQConnectionFactory)1 ActiveMQSession (org.apache.activemq.ActiveMQSession)1 ActiveMQAddressExistsException (org.apache.activemq.artemis.api.core.ActiveMQAddressExistsException)1 ActiveMQException (org.apache.activemq.artemis.api.core.ActiveMQException)1 ActiveMQNonExistentQueueException (org.apache.activemq.artemis.api.core.ActiveMQNonExistentQueueException)1