Package org.apache.karaf.shell.commands

Examples of org.apache.karaf.shell.commands.Command.scope()


        return (name.equals(node.getNodeName()) || name.equals(node.getLocalName()));
    }

    public static String getScope(Class<?> action) {
        Command command = action.getAnnotation(Command.class);
        return command.scope();
    }

    public static String getName(Class<?> action) {
        Command command = action.getAnnotation(Command.class);
        return command.name();
View Full Code Here


    }

    public static String getScope(Class<?> action) {
        Command command = action.getAnnotation(Command.class);
        if (command != null) {
            return command.scope();
        }
        org.apache.felix.gogo.commands.Command command2 = action.getAnnotation(org.apache.felix.gogo.commands.Command.class);
        if (command2 != null) {
            return command2.scope();
        }
View Full Code Here

        if (cmd == null)
        {
            throw new IllegalArgumentException("Action class is not annotated with @Command");
        }
        Hashtable<String, String> props = new Hashtable<String, String>();
        props.put("osgi.command.scope", cmd.scope());
        props.put("osgi.command.function", cmd.name());
        SimpleCommand command = new SimpleCommand(actionClass);
        return context.registerService(
                new String[] { Function.class.getName(), CommandWithAction.class.getName() },
                command, props);
View Full Code Here

            // to avoid NPE with subshell
            return true;
        }

        String commandErrorSt = (command2 != null) ? COLOR_RED
                + "Error executing command " + command2.scope() + ":"
                + INTENSITY_BOLD + command2.name() + INTENSITY_NORMAL
                + COLOR_DEFAULT + ": " : "";
        for (Iterator<Object> it = params.iterator(); it.hasNext(); ) {
            Object param = it.next();
            if (HelpOption.HELP.name().equals(param)) {
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.