public void createNewQueue(String queueName, String owner, boolean durable) throws JMException
{
AMQQueue queue = _queueRegistry.getQueue(new AMQShortString(queueName));
if (queue != null)
{
throw new JMException("The queue \"" + queueName + "\" already exists.");
}
try
{
AMQShortString ownerShortString = null;
if (owner != null)
{
ownerShortString = new AMQShortString(owner);
}
queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString(queueName), durable, ownerShortString, false, getVirtualHost(),
null);
if (queue.isDurable() && !queue.isAutoDelete())
{
_messageStore.createQueue(queue);
}
_queueRegistry.registerQueue(queue);
}
catch (AMQException ex)
{
JMException jme = new JMException(ex.getMessage());
jme.initCause(ex);
throw new MBeanException(jme, "Error in creating queue " + queueName);
}
}