in src/main/java/org/apache/sling/jcr/registration/impl/RmiRegistrationSupport.java [272:295]
public void unregister() {
// unregister repository
if (this.rmiName != null) {
try {
Registry privateRegistry = RmiRegistrationSupport.this.getPrivateRegistry();
if (privateRegistry != null) {
privateRegistry.unbind(this.rmiName);
logger.info("Repository unbound from {}", this.getRmiURL());
}
} catch (Exception e) {
logger.error("Error while unbinding repository from JNDI: ", e);
}
}
// drop strong reference to remote repository
if (this.rmiRepository != null) {
try {
UnicastRemoteObject.unexportObject(this.rmiRepository, true);
} catch (NoSuchObjectException nsoe) {
// not expected, but don't really care either
logger.info("Cannot unexport remote Repository reference", nsoe);
}
}
}