Examples of MethodResult


Examples of org.apache.felix.scr.impl.helper.MethodResult

                        "DependencyManager : invokeUnbindMethod : Service not available from service registry for ServiceReference {0} for reference {1}",
                        new Object[] {refPair.getRef(), getName()}, null );
                return;

            }
            MethodResult methodResult = m_bindMethods.getUnbind().invoke( componentInstance, refPair, MethodResult.VOID, m_componentManager );
            if ( methodResult != null )
            {
                m_componentManager.setServiceProperties( methodResult );
            }
        }
View Full Code Here

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

                // ********** Invoke processPayload nethod **********
                System.out.println("Testing invokeMethod(processPayload, args)");
                QmfData inArgs = new QmfData();
                inArgs.setValue("parameter", new byte[150000000]);

                MethodResult results = control.invokeMethod("processPayload", inArgs);
                if (!results.succeeded())
                {
                    System.out.println("processPayload returned an exception object");
                    System.exit(1);
                }

                if (!results.hasValue("return"))
                {
                    System.out.println("processPayload returned an unexpected value");
                    System.exit(1);
                }

                byte[] returnVal = results.getValue("return");       
                System.out.println("returnVal size = " + returnVal.length);
            }
            else
            {
                System.out.println("No control objects returned: BigPayloadAgentTestConsole failed");
View Full Code Here

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

            // Parse the args String
            QmfData inArgs = (args == null) ? new QmfData() : new QmfData(new AddressParser(args).map());

            // Find the required QmfConsoleData object and invoke the specified command
            MethodResult results = null;
            for (QmfConsoleData object : objects)
            {
                String objectName = object.getObjectId().getObjectName();
                if (command.equals("listObjects"))
                {
                    System.out.println(objectName);
                }
                else
                {
                    if (objectName.contains(id))
                    { // Use contains as ObjectNames may comprise other identifiers tha make using equals impractical
                        if (command.equals("listValues"))
                        {
                            object.listValues();
                            System.exit(1);
                        }
                        else
                        {
                            results = object.invokeMethod(command, inArgs);
                        }
                        break;
                    }
                }
            }

            if (results == null)
            {
                if (objects.size() == 0)
                {
                    System.out.println("getObjects(" + pkg + ", " + cls + ", " + agentName + ") returned no objects.");
                }
                else
                {
                    System.out.println("Id " + id + " not found in " + pkg + ":" + cls);
                }
            }
            else
            {
                if (results.succeeded())
                {
                    results.listValues();
                }
                else
                {
                    System.err.println ("QmfException " + results.getQmfException().getMessage() +
                                        " returned from " + command + " method");
                }
            }
        }
        catch (QmfException qmfe)
View Full Code Here

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

                }

                System.out.println("MethodCount = " + control.getLongValue("methodCount"));
                QmfData inArgs;
                QmfData outArgs;
                MethodResult results;

/*
                System.out.println("Testing invokeMethod(toString, args) - method called directly on Agent");
                results = _gizmo.invokeMethod("toString", null);
                System.out.println("gizmo.toString() = " + results.getArguments().getStringValue("string"));
*/

                // ********** Invoke create_child nethod **********
                System.out.println("Testing invokeMethod(create_child, args)");
                inArgs = new QmfData();
                inArgs.setValue("name", "child 1");

                results = control.invokeMethod("create_child", inArgs);
                if (!results.succeeded())
                {
                    System.out.println("create_child returned an exception object");
                    System.exit(1);
                }

                if (!results.hasValue("childAddr"))
                {
                    System.out.println("create_child returned an unexpected value");
                    System.exit(1);
                }

                ObjectId childId = results.getRefValue("childAddr");       
                System.out.println("childId = " + childId);
                System.out.println("childAddr subtype = " + results.getSubtype("childAddr"));
                QmfConsoleData child1 = _console.getObjects(childId).get(0);
                System.out.println("child1 name = " + child1.getStringValue("name"));


                // Update and display state of control object
                control.refresh();
                System.out.println("MethodCount = " + control.getLongValue("methodCount"));


                // ********** Invoke event nethod **********
                System.out.println("Testing invokeMethod(event, args) ");
                inArgs = new QmfData();
                inArgs.setValue("text", "Attention Will Robinson!! Aliens have just invaded");
                inArgs.setValue("severity", 0);
                control.invokeMethod("event", inArgs);


                // Update and display state of control object
                control.refresh();
                System.out.println("MethodCount = " + control.getLongValue("methodCount"));


                // ********** Invoke fail nethod **********
                System.out.println("Testing invokeMethod(fail, args) ");
                QmfData details = new QmfData();
                details.setValue("detail1", "something bad");
                details.setValue("detail2", "something even badder");
                inArgs = new QmfData();
                inArgs.setValue("details", details.mapEncode());
                results = control.invokeMethod("fail", inArgs);
                System.out.println("whatHappened: " + results.getStringValue("whatHappened"));
                System.out.println("howBad: " + results.getLongValue("howBad"));

                // Update and display state of control object
                control.refresh();
                System.out.println("MethodCount = " + control.getLongValue("methodCount"));

View Full Code Here

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

        }

        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;
View Full Code Here

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

        }

        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;
View Full Code Here

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

        }

        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;
View Full Code Here

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

            while (true)
            {
                try
                {
                    MethodResult results = broker.invokeMethod("getLogLevel", arguments);
//System.out.println(results.getStringValue("level"));
                }
                catch (QmfException e)
                { // This may be throw if we've already added the queues, we just catch and ignore for this test.
                    //System.out.println(e.getMessage());
View Full Code Here

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

            // Parse the args String
            QmfData inArgs = (args == null) ? new QmfData() : new QmfData(new AddressParser(args).map());

            // Find the required QmfConsoleData object and invoke the specified command
            MethodResult results = null;
            for (QmfConsoleData object : objects)
            {
                String objectName = object.getObjectId().getObjectName();
                if (command.equals("listObjects"))
                {
                    System.out.println(objectName);
                }
                else
                {
                    if (objectName.contains(id))
                    { // Use contains as ObjectNames may comprise other identifiers tha make using equals impractical
                        if (command.equals("listValues"))
                        {
                            object.listValues();
                            System.exit(1);
                        }
                        else
                        {
                            results = object.invokeMethod(command, inArgs);
                        }
                        break;
                    }
                }
            }

            if (results == null)
            {
                if (objects.size() == 0)
                {
                    System.out.println("getObjects(" + pkg + ", " + cls + ", " + agentName + ") returned no objects.");
                }
                else
                {
                    System.out.println("Id " + id + " not found in " + pkg + ":" + cls);
                }
            }
            else
            {
                if (results.succeeded())
                {
                    results.listValues();
                }
                else
                {
                    System.err.println ("QmfException " + results.getQmfException().getMessage() +
                                        " returned from " + command + " method");
                }
            }
        }
        catch (QmfException qmfe)
View Full Code Here

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

                                // Parse the args if present into a QmfData (needed by invokeMethod).
                                QmfData inArgs = (args == null) ? new QmfData() : new QmfData(args);

                                // Invoke the specified method on the QmfConsoleData we've created.
                                MethodResult results = null;

                                _log.info("invokeMethod: {}", request);
                                results = object.invokeMethod(method, inArgs);
                                tx.sendResponse(HTTP_OK, "application/json", JSON.fromObject(results));
                            }
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.