public synchronized PrincipalManager getPrincipalManager(Session session)
throws RepositoryException {
checkInitialized();
if (session instanceof SessionImpl) {
SessionImpl sImpl = ((SessionImpl)session);
return new PrincipalManagerImpl(sImpl, principalProviderRegistry.getProviders());
} else {
throw new RepositoryException("Internal error: SessionImpl expected.");
}
}