diff options
Diffstat (limited to 'java/broker-core/src')
-rw-r--r-- | java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java b/java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java index cb3b5effd0..f2ac1a7cdc 100644 --- a/java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java +++ b/java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java @@ -430,7 +430,16 @@ public abstract class AbstractQueue<X extends AbstractQueue<X>> @Override public void performAction(final Deletable object) { - getVirtualHost().removeQueue(AbstractQueue.this); + Subject.doAs(SecurityManager.getSubjectWithAddedSystemRights(), + new PrivilegedAction<Void>() + { + @Override + public Void run() + { + getVirtualHost().removeQueue(AbstractQueue.this); + return null; + } + }); } }; @@ -742,7 +751,16 @@ public abstract class AbstractQueue<X extends AbstractQueue<X>> _logger.info("Auto-deleting queue:" + this); } - getVirtualHost().removeQueue(this); + Subject.doAs(SecurityManager.getSubjectWithAddedSystemRights(), new PrivilegedAction<Object>() + { + @Override + public Object run() + { + getVirtualHost().removeQueue(AbstractQueue.this); + return null; + } + }); + // we need to manually fire the event to the removed consumer (which was the last one left for this // queue. This is because the delete method uses the consumer set which has just been cleared |