Configuration c = pRepository.getServiceConfiguration();
Nucleus n = pRepository.getNucleus();
NucleusNameResolver r = new NucleusNameResolver(
n, n, pRepository.getNameContext(), true
);
GSARepository newRepository = null;
if (pRepository instanceof VersionRepository) {
newRepository = (GSARepository) c.createNewInstance(((VersionRepository) pRepository).getWrappedRepository());
c.configureService(
newRepository, r, ((VersionRepository) pRepository).getWrappedRepository()
);
}
else {
newRepository = (GSARepository) c.createNewInstance(pRepository);
c.configureService(newRepository, r, pRepository);
}
newRepository.setDataSource(pDS);
newRepository.setForeignRepositorySuffix("-Shadow");
/*
// Fool this new repository into thinking that it has been
// bound to the same name context as the original repository
// This changes will make sure that getAbsoluteName() returns