Package org.apache.qpid.qmf2.common

Examples of org.apache.qpid.qmf2.common.SchemaMethod


            while (true)
            {
                notifier.waitForWorkItem();
                System.out.println("WorkItem available, WorkItem count = " + _console.getWorkitemCount());

                WorkItem wi;
                while ((wi = _console.getNextWorkitem(0)) != null)
                {
                    System.out.println("WorkItem type: " + wi.getType());
                    if (wi.getType() == AGENT_HEARTBEAT || wi.getType() == AGENT_ADDED ||
                        wi.getType() == AGENT_DELETED || wi.getType() == AGENT_RESTARTED ||
                        wi.getType() == EVENT_RECEIVED)
                    {
                        Map<String, Object> p = wi.<Map<String, Object>>getParams();
                        Agent agent = (Agent)p.get("agent");
                        System.out.println(agent.getName());
                    }
                }
View Full Code Here


                    if (wi.getType() == AGENT_HEARTBEAT || wi.getType() == AGENT_ADDED ||
                        wi.getType() == AGENT_DELETED || wi.getType() == AGENT_RESTARTED ||
                        wi.getType() == EVENT_RECEIVED)
                    {
                        Map<String, Object> p = wi.<Map<String, Object>>getParams();
                        Agent agent = (Agent)p.get("agent");
                        System.out.println(agent.getName());
                    }
                }

                count++;
                if (count == 10)
View Full Code Here

            {
                agent.listValues();
            }

            System.out.println("*** Test1 testing _console.getAgent(\"broker\"): ***");
            Agent agent = _console.getAgent("broker");
            agent.listValues();

            System.out.println("*** Test1 testing _console.findAgent(\"broker\"): ***");
            agent = _console.findAgent("broker");
            if (agent == null)
            {
                System.out.println("*** Test1 _console.findAgent(\"broker\") returned null : Test1 failed ***");
                System.exit(1);
            }
            else
            {
                agent.listValues();
            }


            System.out.println("*** Test1 testing _console.findAgent(\"monkey\"): ***");
            agent = _console.findAgent("monkey");
            if (agent == null)
            {
                System.out.println("*** Test1 _console.findAgent(\"monkey\") correctly returned null ***");
            }
            else
            {
                agent.listValues();
            }


            System.out.println("*** Test1 testing _console.getObjects(\"broker\"): ***");
            List<QmfConsoleData> brokers = _console.getObjects("broker");
View Full Code Here

    public void onEvent(final WorkItem wi)
    {
        if (wi instanceof EventReceivedWorkItem)
        {
            EventReceivedWorkItem item = (EventReceivedWorkItem)wi;
            Agent agent = item.getAgent();
            QmfEvent event = item.getEvent();

            String className = event.getSchemaClassId().getClassName();
            if (className.equals("clientConnect") ||
                className.equals("clientDisconnect"))
            {
                _stateChanged = true;
            }
        }
        else if (wi instanceof AgentRestartedWorkItem)
        {
            _stateChanged = true;
        }
        else if (wi instanceof AgentHeartbeatWorkItem)
        {
            AgentHeartbeatWorkItem item = (AgentHeartbeatWorkItem)wi;
            Agent agent = item.getAgent();

            if (_stateChanged && agent.getName().contains("qpidd"))
            {
                logConnectionInformation();
                _stateChanged = false;
            }
        }
View Full Code Here

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

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

        {
            _stateChanged = true;
        }
        else if (wi instanceof AgentHeartbeatWorkItem)
        {
            AgentHeartbeatWorkItem item = (AgentHeartbeatWorkItem)wi;
            Agent agent = item.getAgent();

            if (_stateChanged && agent.getName().contains("qpidd"))
            {
                logConnectionInformation();
                _stateChanged = false;
View Full Code Here

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

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

            System.out.println("*** Starting Test2 asynchronous Agent discovery using WorkQueue API ***");
               
            BlockingNotifier notifier = new BlockingNotifier();

            Connection connection = ConnectionHelper.createConnection(url, "{reconnect: true}");
            _console = new Console(notifier);
//console.disableAgentDiscovery(); // To miss all notifications this needs done before addConnection()
            _console.addConnection(connection);

            int count = 0;
            while (true)
View Full Code Here

    {
        try
        {
            System.out.println("*** Starting Test1 synchronous Agent discovery ***");
            Connection connection = ConnectionHelper.createConnection(url, "{reconnect: true}");
            _console = new Console();
            _console.addConnection(connection);

            System.out.println("*** Test1 testing _console.getAgents(): ***");
            List<Agent> agents = _console.getAgents();

View Full Code Here

        try
        {
            System.out.println("*** Starting PartialGetObjectsTest used to test schema retrieval ***");
               
            Connection connection = ConnectionHelper.createConnection(url, "{reconnect: true}");
            _console = new Console(this);
            _console.addConnection(connection);

            // First we create a large number of queues using the QMF2 create method on the broker object
            List<QmfConsoleData> brokers = _console.getObjects("org.apache.qpid.broker", "broker");
            if (brokers.isEmpty())
View Full Code Here

TOP

Related Classes of org.apache.qpid.qmf2.common.SchemaMethod

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.