private void persist() {
        synchronized (mutex) {
            try (final OutputStream out = FileUtils.openOutputStream(registryFile)) {
                final RegistryWrapper wrapper = new RegistryWrapper();
                wrapper.getApis().addAll(filterByType(map, Api.class));
                wrapper.getClients().addAll(filterByType(map, Client.class));

                mapper.writeValue(out, wrapper);

            } catch (Exception e) {
                throw new RuntimeException("Error persisting registry to file: " + registryFile, e);
            }
        }
    }
Store the {@link #map} to the filesystem.
gateway/engine/filesystem/src/main/java/io/apiman/gateway/engine/filesystem/LocalFileRegistry.java