public synchronized static List<AgentSelector> getAvailableAgentSelectors() {
List<AgentSelector> answer = new ArrayList<AgentSelector>();
// First, add in built-in list of algorithms.
for (Class newClass : getBuiltInAgentSelectorClasses()) {
try {
AgentSelector algorithm = (AgentSelector)newClass.newInstance();
answer.add(algorithm);
}
catch (Exception e) {
Log.error(e.getMessage(), e);
}
}
// Now get custom algorithms.
List<String> classNames = JiveGlobals.getProperties("agentSelector.classes");
for (String className : classNames) {
install_algorithm:
try {
Class algorithmClass = loadClass(className);
// Make sure that the intercepter isn't already installed.
for (AgentSelector agentSelector : answer) {
if (algorithmClass.equals(agentSelector.getClass())) {
break install_algorithm;
}
}
AgentSelector algorithm = (AgentSelector)algorithmClass.newInstance();
answer.add(algorithm);
}
catch (Exception e) {
Log.error(e.getMessage(), e);
}