Package net.sf.agentopia.core

Examples of net.sf.agentopia.core.AgentopiaAgentMarker


        if (null == agentClassList) {
            agentClassList = ClassFileFinder.findAnnotatedClasses(AgentopiaAgentMarker.class);
        }
        List<String> agentIds = new ArrayList<String>(agentClassList.size());
        for (Class<?> agentClass : agentClassList) {
            AgentopiaAgentMarker marker = (AgentopiaAgentMarker) agentClass.getAnnotation(AgentopiaAgentMarker.class);
            agentIds.add(marker.name());
        }
        return agentIds;
    }
View Full Code Here


        }

        // Instantiate the agent.
        AbstractAgent agent = null;
        for (Class<?> agentClass : agentClassList) {
            AgentopiaAgentMarker marker = (AgentopiaAgentMarker) agentClass.getAnnotation(AgentopiaAgentMarker.class);
            if (agentId.equals(marker.name())) {
                try {
                    agent = (AbstractAgent) agentClass.newInstance();
                }
                catch (Exception exc) {
                    Logger.getLogger().warn(exc, "Unable to instantiate agent: " + agentId);
View Full Code Here

            throw new IllegalArgumentException("Agent may not be null.");
        }
        final Class<?> agentClass = agent.getClass();

        // Check whether agent and agent GUI annotations are present.
        AgentopiaAgentMarker marker = (AgentopiaAgentMarker) agentClass.getAnnotation(AgentopiaAgentMarker.class);
        if (null == marker) {
            throw new IllegalArgumentException("Agent " + agent + " has no agent annotation.");
        }
        AgentopiaAgentWithGUI guiMarker = (AgentopiaAgentWithGUI) agentClass.getAnnotation(AgentopiaAgentWithGUI.class);
        if (null == guiMarker) {
View Full Code Here

TOP

Related Classes of net.sf.agentopia.core.AgentopiaAgentMarker

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.