WorkspaceFileCleanerHolder wfcleaner =
(WorkspaceFileCleanerHolder)wsFacade.getComponent(WorkspaceFileCleanerHolder.class);
FileCleaner fileCleaner = wfcleaner.getFileCleaner();
// create the RecoveryManager
RecoveryManager recoveryManager =
new RecoveryManager(dir, ownName, systemId, participantsClusterList, waitConfirmation,
jcrRepository.getName(), workspaces[wIndex], channelManager, fileCleaner, maxBufferSize,
new ReaderSpoolFileHolder());
PersistentDataManager dataManager =
(PersistentDataManager)wsFacade.getComponent(PersistentDataManager.class);
ConnectionFailDetector failDetector =
new ConnectionFailDetector(channelManager, dataManager, recoveryManager, ownPriority,
participantsClusterList, ownName, priprityType, workspaces[wIndex]);
channelManager.addStateListener(failDetector);
// add data transmitter
wContainer.registerComponentImplementation(WorkspaceDataTransmitter.class);
WorkspaceDataTransmitter dataTransmitter =
(WorkspaceDataTransmitter)wContainer.getComponentInstanceOfType(WorkspaceDataTransmitter.class);
dataTransmitter.init(/* disp */channelManager, systemId, ownName, recoveryManager);
// add data receiver
AbstractWorkspaceDataReceiver dataReceiver = null;
if (mode.equals(PROXY_MODE))
{
wContainer.registerComponentImplementation(WorkspaceDataManagerProxy.class);
wContainer.registerComponentImplementation(ProxyWorkspaceDataReceiver.class);
dataReceiver =
(ProxyWorkspaceDataReceiver)wContainer
.getComponentInstanceOfType(ProxyWorkspaceDataReceiver.class);
}
else if (mode.equals(PERSISTENT_MODE))
{
wContainer.registerComponentImplementation(PersistentWorkspaceDataReceiver.class);
dataReceiver =
(PersistentWorkspaceDataReceiver)wContainer
.getComponentInstanceOfType(PersistentWorkspaceDataReceiver.class);
}
recoveryManager.setDataKeeper(dataReceiver.getDataKeeper());
dataReceiver.init(channelManager, systemId, ownName, recoveryManager);
channelManager.connect();
// Register for management