* of this <code>Repository</code> and adds it to the repository context.
*
* @throws RepositoryException if an error occurs.
*/
private synchronized void initSecurityManager() throws RepositoryException {
SecurityManagerConfig smc =
getConfig().getSecurityConfig().getSecurityManagerConfig();
if (smc == null) {
log.debug("No configuration entry for SecurityManager. Using org.apache.jackrabbit.core.security.simple.SimpleSecurityManager");
securityMgr = new SimpleSecurityManager();
} else {
securityMgr = smc.newInstance(JackrabbitSecurityManager.class);
}
log.info("SecurityManager = " + securityMgr.getClass());
context.setSecurityManager(securityMgr);
String workspaceName = getConfig().getDefaultWorkspaceName();
if (smc != null && smc.getWorkspaceName() != null) {
workspaceName = smc.getWorkspaceName();
}
// mark the workspace as 'active' for that it does not get disposed
// by the workspace-janitor
// TODO: There should be a cleaner way to do this