Package org.apache.qpid.qmf2.agent

Examples of org.apache.qpid.qmf2.agent.Agent


    }

    public void update(Observable o, Object arg) {
        String event = (String) arg;
        if (event.equals(EventConstants.AGENT_EVENT)) {
            Agent agent = (Agent) o;
            if (!agent.isAlive()) {
                if (agent.getDnaParams().getSpecies() == AgentConstants.TRACER) {
                    if (agent.getParams().isDuplication()) {
                        ejectAgents(agent);
                    }
                    agent.getWorld().deleteTail(agent);
                }
                killAgent(agent);
            } else if (agent.isDuplicating()) {
                agent.setDuplicating(false);
                ejectAgents(agent);
            }
        } else if (event.equals(GUIConstants.PHOTO)) {
            takeAPhoto = true;
        }
View Full Code Here


    }

    public void update(Observable o, Object arg) {
        String event = (String) arg;
        if (event.equals(EventConstants.AGENT_EVENT)) {
            Agent agent = (Agent) o;
            int idWorld = agent.getWorld().getId();
            if (!agent.isAlive()) {
                killGuiAgent(agent);
            } else {
                controllers.get(idWorld).updateGUIAgent(agent);
            }
        } else if (event.equals(EventConstants.CELL_EVENT)) {
View Full Code Here

        try
        {
            System.out.println("** Starting BigPayloadAgentTest a test of basic Agent class functions **");
               
            Connection connection = ConnectionHelper.createConnection(url, "{reconnect: true}");
            _agent = new Agent(this);
            _agent.setVendor("test.com");
            _agent.setProduct("big-payload-agent");

            System.out.println("Agent name: " + _agent.getName());

View Full Code Here

        try
        {
            System.out.println("** Starting AgentTest a test of basic Agent class functions **");
               
            Connection connection = ConnectionHelper.createConnection(url, "{reconnect: true}");
            _agent = new Agent(this);
            _agent.setVendor("profitron.com");
            _agent.setProduct("gizmo");
            _agent.setValue("attr1", 2000);

            System.out.println("Agent name: " + _agent.getName());
View Full Code Here

            {
                _log.info("QmfManagementAgent Constructor failed due to null AMQP Connection");
            }
            else
            {
                _agent = new Agent(this, HEARTBEAT_INTERVAL);
                // Vendor and Product are deliberately set to be the same as for the C++ broker.
                _agent.setVendor("apache.org");
                _agent.setProduct("qpidd");
                _agent.setConnection(connection);
View Full Code Here

            {
                _log.info("QmfManagementAgent Constructor failed due to null AMQP Connection");
            }
            else
            {
                _agent = new Agent(this, HEARTBEAT_INTERVAL);
                // Vendor and Product are deliberately set to be the same as for the C++ broker.
                _agent.setVendor("apache.org");
                _agent.setProduct("qpidd");
                _agent.setConnection(connection);
View Full Code Here

            {
                _log.info("QmfManagementAgent Constructor failed due to null AMQP Connection");
            }
            else
            {
                _agent = new Agent(this, HEARTBEAT_INTERVAL);
                // Vendor and Product are deliberately set to be the same as for the C++ broker.
                _agent.setVendor("apache.org");
                _agent.setProduct("qpidd");
                _agent.setConnection(connection);
View Full Code Here

        System.out.println("WorkItem type: " + wi.getType());

        if (wi.getType() == METHOD_CALL)
        {
            MethodCallWorkItem item = (MethodCallWorkItem)wi;
            MethodCallParams methodCallParams = item.getMethodCallParams();
            String methodName = methodCallParams.getName();
            ObjectId objectId = methodCallParams.getObjectId();

            QmfData inArgs = methodCallParams.getArgs();
            ObjectId controlAddress = _control.getObjectId();

            if (objectId.equals(controlAddress))
            {
                if (methodName.equals("processPayload"))
View Full Code Here

    {
        System.out.println("WorkItem type: " + wi.getType());

        if (wi.getType() == METHOD_CALL)
        {
            MethodCallWorkItem item = (MethodCallWorkItem)wi;
            MethodCallParams methodCallParams = item.getMethodCallParams();
            String methodName = methodCallParams.getName();
            ObjectId objectId = methodCallParams.getObjectId();

            QmfData inArgs = methodCallParams.getArgs();
            ObjectId controlAddress = _control.getObjectId();

            if (objectId.equals(controlAddress))
            {
                if (methodName.equals("processPayload"))
                {
                    System.out.println("Invoked processPayload method");

                    byte[] parameter = inArgs.getValue("parameter");
                    System.out.println("payload size = " + parameter.length);

                    QmfData outArgs = new QmfData();
                    outArgs.setValue("return", parameter);
                    _agent.methodResponse(methodName, item.getHandle(), outArgs, null);
                }
            }
        }
    }
View Full Code Here

    public void populateData() throws QmfException
    {
        System.out.println("*** BigPayloadAgentTest creating a control object ***");

        _control = new QmfAgentData(_controlSchema);
        _control.setValue("name", "controller");
        _agent.addObject(_control);
        System.out.println("BigPayloadAgentTest Schema control object added OK");
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.qmf2.agent.Agent

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.