GenericApplicationContext parent = new GenericApplicationContext();
parent.getBeanFactory().registerSingleton("database", database);
GraphAwareRuntime runtime = RuntimeRegistry.getRuntime(database);
if (runtime != null) {
runtime.waitUntilStarted();
parent.getBeanFactory().registerSingleton("databaseWriter", runtime.getDatabaseWriter());
}
parent.refresh();