Examples of AgentAddedWorkItem


Examples of org.apache.qpid.qmf2.console.AgentAddedWorkItem

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

        if (wi.getType() == AGENT_ADDED)
        {
            AgentAddedWorkItem item = (AgentAddedWorkItem)wi;
            Agent agent = item.getAgent();

            // If this is the gizmo Agent we notify the main thread so processing can continue.
            if (agent.getProduct().equals("gizmo"))
            {
                synchronized(this)
                {
                    _gizmo = agent;
                    notify();
                }
            }
        }

        if (wi.getType() == AGENT_HEARTBEAT)
        {
            AgentHeartbeatWorkItem item = (AgentHeartbeatWorkItem)wi;
            Agent agent = item.getAgent();
            System.out.println(agent.getName());
        }

        if (wi.getType() == EVENT_RECEIVED)
        {
            EventReceivedWorkItem item = (EventReceivedWorkItem)wi;
            Agent agent = item.getAgent();
            QmfEvent event = item.getEvent();

            String className = event.getSchemaClassId().getClassName();
            System.out.println("Event: " + className);
//event.listValues();   
        }

        if (wi.getType() == METHOD_RESPONSE)
        {
            MethodResponseWorkItem item = (MethodResponseWorkItem)wi;
            MethodResult result = item.getMethodResult();
            String correlationId = item.getHandle().getCorrelationId();
            System.out.println("correlationId = " + correlationId);
            System.out.println(result.getStringValue("message"));
        }

        if (wi.getType() == OBJECT_UPDATE)
        {
            ObjectUpdateWorkItem item = (ObjectUpdateWorkItem)wi;
            QmfConsoleData object = item.getQmfConsoleData();
            ObjectId objectId = object.getObjectId();
            String correlationId = item.getHandle().getCorrelationId();
            System.out.println("correlationId = " + correlationId);
            System.out.println("objectId = " + objectId);
            System.out.println("MethodCount = " + object.getLongValue("methodCount"));
        }
View Full Code Here

Examples of org.apache.qpid.qmf2.console.AgentAddedWorkItem

    public void onEvent(WorkItem wi)
    {
        if (wi instanceof AgentAddedWorkItem)
        {
            AgentAddedWorkItem item = (AgentAddedWorkItem)wi;
            Agent agent = item.getAgent();
            System.out.println("\nAgent " + agent.getName() + " added ");

            // Retrieve the List of SchemaClassIds from the Agent, these will be used to retrieve the Schema.
            List<SchemaClassId> schemaClassIds = _console.getClasses(agent);
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.