final OidGenerator oidGenerator = createOidGenerator(getConfiguration());
final RuntimeContext runtimeContext = createRuntimeContext(getConfiguration());
final DomainObjectContainer container = createContainer(getConfiguration());
final ServicesInjector servicesInjector = createServicesInjector(getConfiguration());
final List<Object> serviceList = persistenceSessionFactory.getServices();
ensureThatArg(adapterManager, is(not(nullValue())));
ensureThatArg(adapterFactory, is(not(nullValue())));
ensureThatArg(objectFactory, is(not(nullValue())));
ensureThatArg(oidGenerator, is(not(nullValue())));
ensureThatArg(runtimeContext, is(not(nullValue())));
ensureThatArg(container, is(not(nullValue())));
ensureThatArg(serviceList, is(not(nullValue())));
ensureThatArg(servicesInjector, is(not(nullValue())));
// wire up components
runtimeContext.injectInto(container);
runtimeContext.setContainer(container);
servicesInjector.setContainer(container);
servicesInjector.setServices(serviceList);
persistenceSessionFactory.getSpecificationLoader().injectInto(runtimeContext);
PersistenceSession persistenceSession =
createPersistenceSession(persistenceSessionFactory, adapterManager, adapterFactory, objectFactory,
oidGenerator, servicesInjector);