Examples of CommandType


Examples of org.rhq.enterprise.communications.command.CommandType

     *
     * @return test command
     */
    private GenericCommand createGenericCommand() {
        GenericCommand cmd = new GenericCommand();
        cmd.setCommandType(new CommandType("test", 1));
        return cmd;
    }
View Full Code Here

Examples of org.rhq.enterprise.communications.command.CommandType

    public void testSerializeCommands() throws Exception {
        GenericCommand gc = new GenericCommand();
        ParameterDefinition def = new ParameterDefinition("hello", String.class.getName(),
            new ParameterRenderingInformation("a", "b"));

        gc.setCommandType(new CommandType("foo", 3));
        gc.setParameterDefinitions(new ParameterDefinition[] { def });
        gc.setParameterValue("hello", "world");
        gc.getConfiguration().put("config1", "config1value");
        gc.getConfiguration().put("config2", "config2value");
        gc = (GenericCommand) serializeDeserialize(gc);

        assert gc.getCommandType().equals(new CommandType("foo", 3));
        assert gc.getParameterDefinition("hello").getType().equals(String.class.getName());
        assert gc.getParameterDefinition("hello").getRenderingInfo().getLabelKey().equals("a");
        assert gc.getParameterDefinition("hello").getRenderingInfo().getDescriptionKey().equals("b");
        assert gc.getParameterValue("hello").equals("world");
        assert gc.getConfiguration().getProperty("config1").equals("config1value");
View Full Code Here

Examples of org.rhq.enterprise.communications.command.CommandType

    public void testSerializeCommandsWithNoConfig() throws Exception {
        GenericCommand gc = new GenericCommand();
        ParameterDefinition def = new ParameterDefinition("hello", String.class.getName(),
            new ParameterRenderingInformation("a", "b"));

        gc.setCommandType(new CommandType("foo", 3));
        gc.setParameterDefinitions(new ParameterDefinition[] { def });
        gc.setParameterValue("hello", "world");
        gc = (GenericCommand) serializeDeserialize(gc);

        assert gc.getCommandType().equals(new CommandType("foo", 3));
        assert gc.getParameterDefinition("hello").getType().equals(String.class.getName());
        assert gc.getParameterDefinition("hello").getRenderingInfo().getLabelKey().equals("a");
        assert gc.getParameterDefinition("hello").getRenderingInfo().getDescriptionKey().equals("b");
        assert gc.getParameterValue("hello").equals("world");
View Full Code Here

Examples of org.rhq.enterprise.communications.command.CommandType

    /**
     * @see AbstractCommand#buildCommandType()
     */
    protected CommandType buildCommandType() {
        if (m_newCommandType == null) {
            m_newCommandType = new CommandType("unknown", 1);
        }

        return m_newCommandType;
    }
View Full Code Here

Examples of org.rhq.enterprise.communications.command.CommandType

                        return ret_response;
                    }
                }

                // get the command's type
                CommandType cmdType = cmd.getCommandType();

                // ask the directory what command service supports the command we want to execute
                CommandServiceDirectoryEntry entry = null;
                ObjectName cmdServiceName = null;
View Full Code Here

Examples of org.rhq.enterprise.communications.command.CommandType

                }
            }

            // cmd might be null under odd, error edge cases, have to just be protective here.
            if (cmd != null) {
                CommandType cmdType = cmd.getCommandType();
                m_metrics.addCallTimeData(cmdType.getName(), elapsed, unsuccessfulReason);
                if (cmd instanceof RemotePojoInvocationCommand) {
                    // add additional metrics for the individual pojo method that was invoked
                    RemotePojoInvocationCommand pojoCmd = (RemotePojoInvocationCommand) cmd;
                    String ifaceName = pojoCmd.getTargetInterfaceName();
                    ifaceName = ifaceName.substring(ifaceName.lastIndexOf('.') + 1);
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.