throws RegistryException {
HandlerManager hm = registryContext.getHandlerManager();
List<RemoteConfiguration> remoteInstances = registryContext.getRemoteInstances();
for (RemoteConfiguration config : remoteInstances) {
if (config.getId().equals(target)) {
MountHandler handler = new MountHandler();
handler.setUserName(config.getTrustedUser());
handler.setPassword(config.getResolvedTrustedPwd());
handler.setDbConfig(config.getDbConfig());
handler.setRegistryRoot(config.getRegistryRoot());
handler.setReadOnly(config.getReadOnly() != null &&
Boolean.toString(true).equals(config.getReadOnly().toLowerCase()));
handler.setId(target);
handler.setConURL(config.getUrl());
handler.setMountPoint(path);
handler.setSubPath(targetSubPath);
handler.setAuthor(author);
if (config.getTrustedUser() == null || config.getTrustedPwd() == null) {
handler.setRemote(false);
} else {
handler.setRemote(true);
handler.setRegistryType(config.getType());
}
if (forAllTenants) {
hm.addHandler(RegistryUtils.getMountingMethods(),
RegistryUtils.getMountingMatcher(path), handler);
} else {