public static void fromJSON(Reader r, ConfigurationAdmin admin) throws Exception { Decoder decoder = codec.dec().from(r); Protocol p = decoder.get(Protocol.class); for (int i = 0; i < p.size; i++) { Export e = decoder.get(Export.class); Configuration c; if (e.factoryPid != null) { c = admin.createFactoryConfiguration(e.factoryPid, "?*"); } else { c = admin.getConfiguration(e.pid, "?*"); } Dictionary<String, Object> d = getDictionary(e.types, e.values); c.update(d); } }