summaryrefslogtreecommitdiff
path: root/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java')
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java b/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java
index f97b77a4fe..f352bbdd2c 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java
@@ -32,7 +32,9 @@ import org.apache.qpid.protocol.AMQConstant;
import org.apache.qpid.protocol.AMQMethodEvent;
import org.apache.qpid.protocol.AMQMethodListener;
import org.apache.qpid.server.protocol.AMQProtocolSession;
+import org.apache.qpid.server.registry.IApplicationRegistry;
import org.apache.qpid.server.security.SecurityManager;
+import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
import java.util.concurrent.CopyOnWriteArraySet;
@@ -61,6 +63,18 @@ public class AMQStateManager implements AMQMethodListener
}
+ /**
+ * Get the ApplicationRegistry associated with this AMQStateManager
+ *
+ * returns the application registry associated with the VirtualHostRegistry of the AMQStateManager
+ *
+ * @return the ApplicationRegistry
+ */
+ public IApplicationRegistry getApplicationRegistry()
+ {
+ return _virtualHostRegistry.getApplicationRegistry();
+ }
+
public AMQState getCurrentState()
{
return _currentState;
@@ -142,4 +156,14 @@ public class AMQStateManager implements AMQMethodListener
SecurityManager.setThreadSubject(_protocolSession.getAuthorizedSubject());
return _protocolSession;
}
+
+ /**
+ * Get the AuthenticationManager associated with the ProtocolSession of the AMQStateManager
+ *
+ * @return the AuthenticationManager
+ */
+ public AuthenticationManager getAuthenticationManager()
+ {
+ return getApplicationRegistry().getAuthenticationManager(getProtocolSession().getLocalAddress());
+ }
}