Package org.apache.karaf.shell.commands

Examples of org.apache.karaf.shell.commands.Action


            Map<String, Set<String>> commands = new TreeMap<String, Set<String>>();

            String commandSuffix = FORMAT_DOCBX.equals(format) ? "xml" : "conf";
            for (Class<?> clazz : classes) {
                try {
                    Action action = (Action) clazz.newInstance();
                    ActionMetaData meta = new ActionMetaDataFactory().create(action.getClass());
                    Command cmd = meta.getCommand();

                    // skip the *-help command
                    if (cmd.scope().equals("*")) continue;

View Full Code Here


            Map<String, Set<String>> commands = new TreeMap<String, Set<String>>();

            String commandSuffix = FORMAT_DOCBX.equals(format) ? "xml" : "conf";
            for (Class<?> clazz : classes) {
                try {
                    Action action = (Action) clazz.newInstance();
                    ActionMetaData meta = new ActionMetaDataFactory().create(action.getClass());
                    Command cmd = meta.getCommand();

                    // skip the *-help command
                    if (cmd.scope().equals("*")) continue;

View Full Code Here

        }

    }

    public Action createNewAction() {
        Action action = (Action) blueprintContainer.getComponentInstance(actionId);
        if (action instanceof BlueprintContainerAware) {
            ((BlueprintContainerAware) action).setBlueprintContainer(blueprintContainer);
        }
        if (action instanceof BundleContextAware) {
            BundleContext context = (BundleContext) blueprintContainer.getComponentInstance("blueprintBundleContext");
View Full Code Here

import org.apache.karaf.shell.commands.CommandWithAction;

public abstract class AbstractCommand implements CommandWithAction {

    public Object execute(CommandSession session, List<Object> arguments) throws Exception {
        Action action = createNewAction();
        try {
            if (getPreparator().prepare(action, session, arguments)) {
                return action.execute(session);
            } else {
                return null;
            }
        } finally {
          releaseAction(action);
View Full Code Here

            for (int i = 0, size = arguments.size(); i < size; i++) {
                Completer argCompleter = NullCompleter.INSTANCE;
                Method method = methods.get(i);
                if (method != null) {
                    // lets invoke the method
                    Action action = function.createNewAction();
                    try {
                        Object value = method.invoke(action);
                        if (value instanceof String[]) {
                            argCompleter = new StringsCompleter((String[]) value);
                        } else if (value instanceof Collection) {
View Full Code Here

            for (int i = 0, size = arguments.size(); i < size; i++) {
                Completer argCompleter = NullCompleter.INSTANCE;
                Method method = methods.get(i);
                if (method != null) {
                    // lets invoke the method
                    Action action = function.createNewAction();
                    try {
                        Object value = method.invoke(action);
                        if (value instanceof String[]) {
                            argCompleter = new StringsCompleter((String[]) value);
                        } else if (value instanceof Collection) {
View Full Code Here

            Map<String, Set<String>> commands = new TreeMap<String, Set<String>>();

            for (Class clazz : classes) {
                try {
                    Action action = (Action) clazz.newInstance();
                    ActionMetaData meta = new ActionMetaDataFactory().create(action.getClass());
                    String help = printHelp(action, meta, format, includeHelpOption);
                    Command cmd = meta.getCommand();
                    File output = null;

                    // skip the *-help command
View Full Code Here

import org.apache.karaf.shell.commands.CommandWithAction;

public abstract class AbstractCommand implements CommandWithAction {

    public Object execute(CommandSession session, List<Object> arguments) throws Exception {
        Action action = createNewAction();
        try {
            if (getPreparator().prepare(action, session, arguments)) {
                return action.execute(session);
            } else {
                return null;
            }
        } finally {
          releaseAction(action);
View Full Code Here

TOP

Related Classes of org.apache.karaf.shell.commands.Action

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.