}
else
{
session.setVirtualHost(virtualHost);
AccessResult result = virtualHost.getAccessManager().isAuthorized(virtualHost, session.getAuthorizedID(), AccessRights.Rights.ANY);
switch (result.getStatus())
{
default:
case REFUSED:
String error = "Any access denied to vHost '" + virtualHostName + "' by "
+ result.getAuthorizer();
_logger.warn(error);
throw body.getConnectionException(AMQConstant.ACCESS_REFUSED, error);
case GRANTED:
_logger.info("Granted any access to vHost '" + virtualHostName + "' for " + session.getAuthorizedID()
+ " by '" + result.getAuthorizer() + "'");
}
// See Spec (0.8.2). Section 3.1.2 Virtual Hosts
if (session.getContextKey() == null)
{