in src/main/java/org/apache/sling/jcr/registration/impl/JndiRegistrationSupport.java [149:163]
protected Object bindRepository(String name, Repository repository) {
if (this.jndiContext != null) {
try {
this.jndiContext.bind(name, repository);
logger.info("Repository bound to JNDI as {}", name);
return repository;
} catch (NamingException ne) {
logger.error("Failed to register repository {}", name, ne);
}
}
// fall back to unregistered in case of failures or no context
return null;
}