Examples of AgentopiaAgentMarker


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

Examples of net.sf.agentopia.core.AgentopiaAgentMarker

        }

        // 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

Examples of net.sf.agentopia.core.AgentopiaAgentMarker

            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
Copyright © 2018 www.massapi.com. 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.