@Override
    public MUCRoom getChatRoom(@Nonnull final String roomName) {
        boolean loaded = false;
        MUCRoom room = localMUCRoomManager.get(roomName);
        if (room == null) {
            // Check if the room exists in the database and was not present in memory
            final Lock lock = localMUCRoomManager.getLock(roomName);
            lock.lock();
            try {
                room = localMUCRoomManager.get(roomName);
                if (room == null) {
                    room = new MUCRoom(this, roomName);
                    // If the room is persistent load the configuration values from the DB
                    try {
                        // Try to load the room's configuration from the database (if the room is
                        // persistent but was added to the DB after the server was started up or the
                        // room may be an old room that was not present in memory)
                        MUCPersistenceManager.loadFromDB(room);
                        loaded = true;
                        localMUCRoomManager.add(room);
                    }
                    catch (final IllegalArgumentException e) {
                        // The room does not exist so do nothing
                        room = null;
                        loaded = false;
                    }
                }
            } finally {
                lock.unlock();
            }
        }
        if (loaded) {
            // Initiate FMUC, when enabled.
            room.getFmucHandler().applyConfigurationChanges();
        }
        return room;
    }
Checks if a particular JID is allowed to create rooms.

@param jid The jid for which to check (cannot be null).
@return true if the JID is allowed to create a room, otherwise false.
xmppserver/src/main/java/org/jivesoftware/openfire/muc/spi/MultiUserChatServiceImpl.java