File base = m_agentConfig.getHome().getDirectory();
File directory = new File(new File(base, "file-store"), user);
m_fileStore = new FileStore(directory, m_logger);
}
m_sender.send(new AgentProcessReportMessage(ProcessReport.STATE_STARTED, m_fileStore
.getCacheHighWaterMark()));
final MessageDispatchSender fileStoreMessageDispatcher = new MessageDispatchSender();
m_fileStore.registerMessageHandlers(fileStoreMessageDispatcher);
final MessageDispatchSender messageDispatcher = new MessageDispatchSender();
m_consoleListener.registerMessageHandlers(messageDispatcher);
// Everything that the file store doesn't handle is tee'd to the
// worker processes and our message handlers.
fileStoreMessageDispatcher.addFallback(new TeeSender(messageDispatcher, new IgnoreShutdownSender(
m_fanOutStreamSender)));
m_messagePump = new MessagePump(receiver, fileStoreMessageDispatcher, 1);
m_reportRunningTask = new TimerTask() {
public void run() {
try {
m_sender.send(new AgentProcessReportMessage(ProcessReport.STATE_RUNNING, m_fileStore
.getCacheHighWaterMark()));
} catch (CommunicationException e) {
cancel();
m_logger.error("Error while pumping up the AgentProcessReportMessage", e.getMessage());
m_logger.debug("The error detail is ", e);