}
}
ConfigurationManager configuration_manager = ConfigurationManagerSingleton.getInstance();
configuration_manager.initialize();
configuration_manager.start();
UserHash hash = null;
try {
hash = configuration_manager.getUserHash();
} catch (ConfigurationManagerException e1) {
e1.printStackTrace();
}
if (hash == null) {
hash = UserHash.genNewUserHash();
try {
((InternalConfigurationManager)configuration_manager).setUserHash(hash);
} catch (ConfigurationManagerException e) {
e.printStackTrace();
}
}
Logger log = Logger.getLogger("org.jmule");
/**Setup logger*/
log.setLevel(Level.ALL);//Log all events
try {
FileHandler fileHandler = new FileHandler(ConfigurationManager.LOGS_DIR+File.separator+"JMule%u.log",(int)ConfigurationManager.LOG_FILE_SIZE,ConfigurationManager.LOG_FILES_NUMBER);
fileHandler.setFormatter(new SimpleFormatter());
log.addHandler(fileHandler);
} catch (Throwable e) {
e.printStackTrace();
}
NetworkManagerSingleton.getInstance().initialize();
NetworkManagerSingleton.getInstance().start();
// notifies that the config manager has been started
notifyComponentStarted(configuration_manager);
IPFilter ip_filter = IPFilterSingleton.getInstance();
ip_filter.initialize();
ip_filter.start();
notifyComponentStarted( ip_filter );
SharingManager sharingManager = SharingManagerSingleton.getInstance();
sharingManager.initialize();
sharingManager.start();
sharingManager.loadCompletedFiles();
sharingManager.loadPartialFiles();
// notifies that the sharing manager has been started
notifyComponentStarted(sharingManager);
UploadManagerSingleton.getInstance().initialize();
UploadManagerSingleton.getInstance().start();
// notifies that the upload manager has been started
notifyComponentStarted(UploadManagerSingleton.getInstance());
SpeedManagerSingleton.getInstance().initialize();
SpeedManagerSingleton.getInstance().start();
// notifies that the speed manager has been started
notifyComponentStarted(UploadManagerSingleton.getInstance());
PeerManagerSingleton.getInstance().initialize();
PeerManagerSingleton.getInstance().start();
// notifies that the peer manager has been started
notifyComponentStarted(PeerManagerSingleton.getInstance());
// notifies that the download manager has been started
DownloadManagerSingleton.getInstance().initialize();
DownloadManagerSingleton.getInstance().start();
notifyComponentStarted(DownloadManagerSingleton.getInstance());
ServerManager servers_manager = ServerManagerSingleton.getInstance();
servers_manager.initialize();
try {
servers_manager.loadServerList();
} catch (Throwable t) {
t.printStackTrace();
}
servers_manager.start();
// notifies that the download manager has been started
notifyComponentStarted(servers_manager);
//servers_manager.startUDPQuery();
SearchManager search_manager = SearchManagerSingleton.getInstance();
search_manager.initialize();
search_manager.start();
notifyComponentStarted(search_manager);
JKadManagerSingleton.getInstance().initialize();
try {
if (configuration_manager.isJKadAutoconnectEnabled()) {
JKadManagerSingleton.getInstance().start();
}
} catch (ConfigurationManagerException e) {
e.printStackTrace();
}