final AbstractSystemConfig parentObject = new JsonSystemConfigImpl(taskExecutor,
mock(EventLogger.class),
mock(LogRecorder.class),
brokerOptions);
ConfiguredObjectRecordConverter converter = new ConfiguredObjectRecordConverter(BrokerModel.getInstance());
Reader reader;
try
{
try
{
URL url = new URL(initialStoreLocation);
try(InputStream urlStream = url.openStream())
{
reader = new InputStreamReader(urlStream);
}
}
catch (MalformedURLException e)
{
reader = new FileReader(initialStoreLocation);
}
Collection<ConfiguredObjectRecord> records = converter.readFromJson(org.apache.qpid.server.model.Broker.class, parentObject, reader);
reader.close();
_store = new AbstractMemoryStore(Broker.class){};
ConfiguredObjectRecord[] initialRecords = records.toArray(new ConfiguredObjectRecord[records.size()]);