private void checkJoinRoomPreconditionDelegate( @Nonnull final JID realAddress ) throws UnauthorizedException
    {
        boolean canJoin = true;
        if (mucService.getMUCDelegate() != null) {
            if (!mucService.getMUCDelegate().joiningRoom(this, realAddress)) {
                // Delegate said no, reject join.
                canJoin = false;
            }
        }
        Log.trace( "{} Room join precondition 'delegate': User '{}' {} join room '{}'.", canJoin ? "PASS" : "FAIL", realAddress, canJoin ? "can" : "cannot", this.getJID() );
        if (!canJoin) {
            throw new UnauthorizedException();
        }
    }
Checks all preconditions for joining a room. If one of them fails, an Exception is thrown.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/MUCRoom.java