Package org.apache.qpid.utils

Examples of org.apache.qpid.utils.JMXinfo


                        config.getPassword());
                jmxc = conn.getConnector();
                mbsc = conn.getMBeanServerConnection();
                if (config.checkoptionsetting("r", commandlineoptionparser.getAlloptions()))
                {
                    JMXinfo info = new JMXinfo(jmxc, commandlineoptionparser, mbsc);
                    ReportGenerator reportgen = new ReportGenerator(config.optionchecker("r", commandlineoptionparser
                            .getAlloptions()), info);
                    reportgen.loadproperties();
                    reportgen.run();
                }
                /*
                 * This implementation is for the people who are using the
                 * interactive mode for one shot this run the user given command
                 * and exit
                 */
                for (int i = 0; i < args.length; i++)
                {
                    if (CommandExecutionEngine.getCommands().keySet().contains(args[i]))
                    {
                        oneshotmode(args, commandlineoptionparser, jmxc, mbsc);
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                connectionrefuse(ex);
                return;
            }
            /* In this point connection has been established */
            String line;
            String[] command;

            /* prividing GNU readline features using Jline library */
            PrintWriter out = new PrintWriter(System.out);
            SimpleCompletor completer = new SimpleCompletor(new String[] {
                    COMMAND_EXIT, COMMAND_QUIT, OBJECT_QUEUE, OBJECT_EXCHANGE, OBJECT_CONNECTION,
                    OBJECT_USERMANAGEMENT, OBJECT_VIRTUALHOST});
            for (String commandName : CommandExecutionEngine.getCommands().keySet())
            {
                completer.addCandidateString(commandName);
            }
            reader.addCompletor(new ArgumentCompletor(completer));
            while ((line = reader.readLine("qpid-admin-$ ")) != null)
            {
                out.flush();
                if (removeSpaces(line).equalsIgnoreCase(COMMAND_QUIT) || removeSpaces(line).equalsIgnoreCase(COMMAND_EXIT))
                    break;
                else if (line.length() == 0)
                    continue;
                else
                {
                    command = line.split("\\s+");
                    commandlineoptionparser = new CommandLineOptionParser(command);
                    JMXinfo info = new JMXinfo(jmxc, commandlineoptionparser, mbsc);
                    CommandExecutionEngine engine = new CommandExecutionEngine(info);
                    if (engine.CommandSelector())
                        engine.runcommand();
                }
            }
View Full Code Here


                                                                     // array
                                                                     // which
                                                                     // works as
                                                                     // interactive
                                                                     // mode//
        JMXinfo info = new JMXinfo(jmxc, commandlineoptionparser, mbsc);
        CommandExecutionEngine engine = new CommandExecutionEngine(info);
        if (engine.CommandSelector())
            engine.runcommand();
        return args;
View Full Code Here

        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT,
                ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
        JMXConnector jmxc = conn.getConnector();
        MBeanServerConnection mbsc = conn.getMBeanServerConnection();
        CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
        info = new JMXinfo(jmxc, parser, mbsc);
        list = new Commandlist(info);

    }
View Full Code Here

    public void TestCommandSelector() throws Exception
    {
        line = "list -o queue";
        command = line.split(" ");
        commandlineoptionparser = new CommandLineOptionParser(command);
        info = new JMXinfo(connector.getConnector(), commandlineoptionparser, connector.getMBeanServerConnection());
        engine = new CommandExecutionEngine(info);
        Assert.assertEquals(engine.CommandSelector(), true);
    }
View Full Code Here

    {
        list = command.split(" ");
        parser = new CommandLineOptionParser(list);
        test = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT,
                ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
        info = new JMXinfo(test.getConnector(), parser, test.getMBeanServerConnection());
        cmd = new Commandinfo(info);

    }
View Full Code Here

        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT,
                ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
        JMXConnector jmxc = conn.getConnector();
        MBeanServerConnection mbsc = conn.getMBeanServerConnection();
        CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
        info = new JMXinfo(jmxc, parser, mbsc);
        move = new Commandmove(info);

    }
View Full Code Here

        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT,
                ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
        JMXConnector jmxc = conn.getConnector();
        MBeanServerConnection mbsc = conn.getMBeanServerConnection();
        CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
        info = new JMXinfo(jmxc, parser, mbsc);
        viewcontent = new Commandviewcontent(info);

    }
View Full Code Here

        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT,
                ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
        JMXConnector jmxc = conn.getConnector();
        MBeanServerConnection mbsc = conn.getMBeanServerConnection();
        CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
        info = new JMXinfo(jmxc, parser, mbsc);
        view = new Commandview(info);
    }
View Full Code Here

        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT,
                ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
        JMXConnector jmxc = conn.getConnector();
        MBeanServerConnection mbsc = conn.getMBeanServerConnection();
        CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
        info = new JMXinfo(jmxc, parser, mbsc);
        infocommand = new Commandinfo(info);

    }
View Full Code Here

        conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT,
                ConnectionConstants.USERNAME, ConnectionConstants.PASSWORD);
        JMXConnector jmxc = conn.getConnector();
        MBeanServerConnection mbsc = conn.getMBeanServerConnection();
        CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
        info = new JMXinfo(jmxc, parser, mbsc);
        delete = new Commanddelete(info);

    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.utils.JMXinfo

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.