Package org.jivesoftware.xmpp.workgroup.dispatcher

Examples of org.jivesoftware.xmpp.workgroup.dispatcher.AgentSelector


    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);
            }
View Full Code Here


        }
    }

    public synchronized static void addAgentSelectorClass(Class newClass) throws IllegalArgumentException {
        try {
            AgentSelector newAlgorithm = (AgentSelector)newClass.newInstance();
            // Make sure the interceptor isn't already in the list.
            List<AgentSelector> availableAgentSelectors = getAvailableAgentSelectors();
            for (AgentSelector algorithm : availableAgentSelectors) {
                if (newAlgorithm.getClass().equals(algorithm.getClass())) {
                    return;
                }
            }
            // Add in the new algorithm
            availableAgentSelectors.add(newAlgorithm);
View Full Code Here

TOP

Related Classes of org.jivesoftware.xmpp.workgroup.dispatcher.AgentSelector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.