wspInfos.put(config.getName(), info);
}
// initialize optional clustering before setting up any other
// external event source that a cluster node will be interested in
ClusterNode clusterNode = null;
if (repConfig.getClusterConfig() != null) {
clusterNode = createClusterNode();
context.setClusterNode(clusterNode);
context.getNamespaceRegistry().setEventChannel(clusterNode);
context.getNodeTypeRegistry().setEventChannel(clusterNode);
context.getPrivilegeRegistry().setEventChannel(clusterNode);
createWorkspaceEventChannel = clusterNode;
clusterNode.setListener(this);
}
// init version manager
InternalVersionManagerImpl vMgr = createVersionManager(
repConfig.getVersioningConfig(), delegatingDispatcher);
context.setInternalVersionManager(vMgr);
if (clusterNode != null) {
vMgr.setEventChannel(clusterNode.createUpdateChannel(null));
}
// init virtual node type manager
virtNTMgr = new VirtualNodeTypeStateManager(
context.getNodeTypeRegistry(),
delegatingDispatcher, NODETYPES_NODE_ID, SYSTEM_ROOT_NODE_ID);
// initialize startup workspaces
initStartupWorkspaces();
// initialize system search manager
getSystemSearchManager(repConfig.getDefaultWorkspaceName());
// Initialise the security manager;
initSecurityManager();
// after the workspace is initialized we pass a system session to
// the virtual node type manager
// todo FIXME the *global* virtual node type manager is using a session that is bound to a single specific workspace...
virtNTMgr.setSession(getSystemSession(repConfig.getDefaultWorkspaceName()));
// now start cluster node as last step
if (clusterNode != null) {
setDescriptor(JACKRABBIT_CLUSTER_ID, repConfig.getClusterConfig().getId());
try {
clusterNode.start();
} catch (ClusterException e) {
String msg = "Unable to start clustered node, forcing shutdown...";
log.error(msg, e);
shutdown();
throw new RepositoryException(msg, e);