use of org.apache.sis.util.resources.Errors in project sis by apache.
the class Supervisor method warnings.
/**
* {@inheritDoc}
*/
@Override
public String[] warnings(final Locale locale) {
final DaemonThread lastCreatedDaemon;
synchronized (Threads.class) {
lastCreatedDaemon = Threads.lastCreatedDaemon;
}
final List<Thread> threads = DaemonThread.listStalledThreads(lastCreatedDaemon);
if (threads == null) {
return null;
}
final String[] warnings = new String[threads.size()];
final Errors resources = Errors.getResources(locale);
for (int i = 0; i < warnings.length; i++) {
final Thread thread = threads.get(i);
warnings[i] = resources.getString(thread.isAlive() ? Errors.Keys.StalledThread_1 : Errors.Keys.DeadThread_1, thread.getName());
}
return warnings;
}
Aggregations