public synchronized void registerQueue(final Queue queue,
final SimpleString address,
final StorageManager storageManager) throws Exception
{
QueueControlImpl queueControl = new QueueControlImpl(queue,
address.toString(),
postOffice,
storageManager,
addressSettingsRepository);
if (messageCounterManager != null)
{
MessageCounter counter = new MessageCounter(queue.getName().toString(),
null,
queue,
false,
queue.isDurable(),
messageCounterManager.getMaxDayCount());
queueControl.setMessageCounter(counter);
messageCounterManager.registerMessageCounter(queue.getName().toString(), counter);
}
ObjectName objectName = objectNameBuilder.getQueueObjectName(address, queue.getName());
registerInJMX(objectName, queueControl);
registerInRegistry(ResourceNames.CORE_QUEUE + queue.getName(), queueControl);