public synchronized void createWorkspace(String workspaceName) throws RepositoryException
{
SecurityHelper.validateSecurityPermission(JCRRuntimePermissions.MANAGE_REPOSITORY_PERMISSION);
final WorkspaceContainer wsContainer = repositoryContainer.getWorkspaceContainer(workspaceName);
if (wsContainer == null)
{
throw new RepositoryException("Workspace " + workspaceName
+ " is not configured. Use RepositoryImpl.configWorkspace() method");
}
final WorkspaceInitializer workspaceInitializer =
repositoryContainer.getWorkspaceContainer(workspaceName).getWorkspaceInitializer();
SystemParametersPersistenceConfigurator sppc =
(SystemParametersPersistenceConfigurator)repositoryContainer
.getComponentInstanceOfType(SystemParametersPersistenceConfigurator.class);
if (sppc != null)
{
WorkspaceEntry workspaceEntry = repositoryContainer.getWorkspaceEntry(workspaceName);
repositoryContainer.setInitializerAndValidateOverriddenParameters(workspaceEntry, workspaceInitializer);
}
if (isWorkspaceInitialized(workspaceName))
{
LOG.warn("Workspace '" + workspaceName + "' is presumably initialized. config canceled");
return;
}
try
{
SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Void>()
{
public Void run() throws Exception
{
workspaceInitializer.initWorkspace();
wsContainer.start();
return null;
}
});
}
catch (PrivilegedActionException pae)