LOG.debug("Found following implementations of FileManager interface: #0", names.toString());
}
Set<FileManager> internals = new HashSet<FileManager>();
Set<FileManager> users = new HashSet<FileManager>();
for (String fmName : names) {
FileManager fm = container.getInstance(FileManager.class, fmName);
if (fm.internal()) {
internals.add(fm);
} else {
users.add(fm);
}
}
for (FileManager fm : users) {
if (fm.support()) {
if (LOG.isDebugEnabled()) {
LOG.debug("Using FileManager implementation [#0]", fm.getClass().getSimpleName());
}
fm.setReloadingConfigs(reloadingConfigs);
return fm;
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("No user defined FileManager, looking up for internal implementations!");
}
for (FileManager fm : internals) {
if (fm.support()) {
return fm;
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("Using default implementation of FileManager provided under name [system]: #0", fileManager.getClass().getSimpleName());