ARTEMIS-2526 - Update ActiveMQServerImpl to call correct

beforeDestroyQueue hook
This commit is contained in:
Christopher L. Shannon (cshannon) 2019-10-23 13:04:08 -04:00 committed by Clebert Suconic
parent d7dc8b8de8
commit 1aed3f9dd6
3 changed files with 7 additions and 3 deletions

View File

@ -2145,7 +2145,7 @@ public class ActiveMQServerImpl implements ActiveMQServer {
Queue queue = (Queue) binding.getBindable();
if (hasBrokerQueuePlugins()) {
callBrokerQueuePlugins(plugin -> plugin.beforeDestroyQueue(queueName, session, checkConsumerCount, removeConsumers, autoDeleteAddress));
callBrokerQueuePlugins(plugin -> plugin.beforeDestroyQueue(queue, session, checkConsumerCount, removeConsumers, autoDeleteAddress));
}
if (session != null) {

View File

@ -57,7 +57,10 @@ public interface ActiveMQServerQueuePlugin extends ActiveMQServerBasePlugin {
* @param removeConsumers
* @param autoDeleteAddress
* @throws ActiveMQException
*
* @deprecated use {@link #beforeDestroyQueue(Queue, SecurityAuth, boolean, boolean, boolean)}
*/
@Deprecated
default void beforeDestroyQueue(SimpleString queueName, final SecurityAuth session, boolean checkConsumerCount,
boolean removeConsumers, boolean autoDeleteAddress) throws ActiveMQException {
@ -75,6 +78,7 @@ public interface ActiveMQServerQueuePlugin extends ActiveMQServerBasePlugin {
*/
default void beforeDestroyQueue(Queue queue, final SecurityAuth session, boolean checkConsumerCount,
boolean removeConsumers, boolean autoDeleteAddress) throws ActiveMQException {
//by default call the old method for backwards compatibility
beforeDestroyQueue(queue.getName(), session, checkConsumerCount, removeConsumers, autoDeleteAddress);
}

View File

@ -239,9 +239,9 @@ public class MethodCalledVerifier implements ActiveMQServerPlugin {
}
@Override
public void beforeDestroyQueue(SimpleString queueName, SecurityAuth session, boolean checkConsumerCount,
public void beforeDestroyQueue(Queue queue, SecurityAuth session, boolean checkConsumerCount,
boolean removeConsumers, boolean autoDeleteAddress) {
Preconditions.checkNotNull(queueName);
Preconditions.checkNotNull(queue);
methodCalled(BEFORE_DESTROY_QUEUE);
}