Package org.apache.qpid.qmf2.tools

Examples of org.apache.qpid.qmf2.tools.QpidPrintEvents


        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


        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

            registerObjectClass(mammal);
            registerObjectClass(insect);
            registerObjectClass(reptile);
            registerObjectClass(bird);

            QmfAgentData cat = new QmfAgentData(mammal);
            cat.setValue("name", "cat");
            cat.setValue("legs", 4l);
            addObject(cat);

            QmfAgentData dog = new QmfAgentData(mammal);
            dog.setValue("name", "dog");
            dog.setValue("legs", 4l);
            addObject(dog);

            QmfAgentData rabbit = new QmfAgentData(mammal);
            rabbit.setValue("name", "rabbit");
            rabbit.setValue("legs", 4);
            addObject(rabbit);

            QmfAgentData horse = new QmfAgentData(mammal);
            horse.setValue("name", "horse");
            horse.setValue("legs", 4);
            addObject(horse);

            QmfAgentData human = new QmfAgentData(mammal);
            human.setValue("name", "human");
            human.setValue("legs", 2);
            addObject(human);


            QmfAgentData wasp = new QmfAgentData(insect);
            wasp.setValue("name", "wasp");
            wasp.setValue("legs", 6);
            addObject(wasp);

            QmfAgentData ant = new QmfAgentData(insect);
            ant.setValue("name", "ant");
            ant.setValue("legs", 6);
            addObject(ant);

            QmfAgentData crocodile = new QmfAgentData(reptile);
            crocodile.setValue("name", "crocodile");
            crocodile.setValue("legs", 4);
            addObject(crocodile);

            QmfAgentData gecko = new QmfAgentData(reptile);
            gecko.setValue("name", "gecko");
            gecko.setValue("legs", 4);
            addObject(gecko);

            QmfAgentData python = new QmfAgentData(reptile);
            python.setValue("name", "python");
            python.setValue("legs", 0);
            addObject(python);

            QmfAgentData hawk = new QmfAgentData(bird);
            hawk.setValue("name", "hawk");
            hawk.setValue("legs", 2);
            addObject(hawk);

            QmfAgentData ostrich = new QmfAgentData(bird);
            ostrich.setValue("name", "ostrich");
            ostrich.setValue("legs", 2);
            addObject(ostrich);


            System.out.println("total number of objects registered: " + _objectIndex.size());
View Full Code Here

        if (query.getObjectId() != null)
        {
            // Look up a QmfAgentData object by the ObjectId obtained from the query
            ObjectId objectId = query.getObjectId();
            QmfAgentData object = _objectIndex.get(objectId);
            if (object != null && !object.isDeleted())
            {
                results.add(new QmfConsoleData(object.mapEncode(), null));
            }
        }
        else
        {
            for (QmfAgentData object : _objectIndex.values())
            {
                if (!object.isDeleted() && query.evaluate(object))
                {
                    results.add(new QmfConsoleData(object.mapEncode(), null));
                }
            }
        }

        return results;
View Full Code Here

    {
        try
        {
            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)
            {
                notifier.waitForWorkItem();
                System.out.println("WorkItem available, WorkItem count = " + _console.getWorkitemCount());

                WorkItem wi;
                while ((wi = _console.getNextWorkitem(0)) != null)
                {
View Full Code Here

//System.out.println("content = " + content);
//System.out.println("opcode = " + opcode);
//System.out.println("routingKey = " + routingKey);
//System.out.println("contentType = " + contentType);

            Handle handle = new Handle(message.getJMSCorrelationID(), message.getJMSReplyTo());

            if (opcode.equals("_agent_locate_request"))
            {
                handleLocateRequest(handle);
            }
View Full Code Here

        {
            _eventListener = new NullQmfEventListener();
        }
        else if (notifier instanceof Notifier)
        {
            _eventListener = new NotifierWrapper((Notifier)notifier, _workQueue);
        }
        else if (notifier instanceof QmfEventListener)
        {
            _eventListener = (QmfEventListener)notifier;
        }
View Full Code Here

        _domain = (domain == null) ? "default" : domain;

        if (notifier == null)
        {
            _eventListener = new NullQmfEventListener();
        }
        else if (notifier instanceof Notifier)
        {
            _eventListener = new NotifierWrapper((Notifier)notifier, _workQueue);
        }
View Full Code Here

TOP

Related Classes of org.apache.qpid.qmf2.tools.QpidPrintEvents

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.