private void checkJoinRoomPreconditionLocked( @Nonnull final JID realAddress ) throws RoomLockedException
    {
        boolean canJoin = true;
        final JID bareJID = realAddress.asBareJID();
        boolean isOwner = owners.includes(bareJID);
        if (isLocked()) {
            if (!isOwner) {
                canJoin = false;
            }
        }
        Log.trace( "{} Room join precondition 'room locked': User '{}' {} join room '{}'.", canJoin ? "PASS" : "FAIL", realAddress, canJoin ? "can" : "cannot", this.getJID() );
        if (!canJoin) {
            throw new RoomLockedException( "This room is locked (and you are not an owner)." );
        }
    }
Checks if the room is locked and this user is not an owner

@param realAddress The address of the user that attempts to join.
@throws RoomLockedException when joining is prevented by virtue of the room being locked.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/MUCRoom.java