Package org.apache.karaf.shell.api.console

Examples of org.apache.karaf.shell.api.console.Command


    @Override
    public void register(Object service) {
        synchronized (services) {
            if (service instanceof Command) {
                Command command = (Command) service;
                String scope = command.getScope();
                String name = command.getName();
                if (!Session.SCOPE_GLOBAL.equals(scope)) {
                    if (!subshells.containsKey(scope)) {
                        SubShellCommand subShell = new SubShellCommand(scope);
                        subshells.put(scope, subShell);
                        register(subShell);
View Full Code Here


    @Override
    public void unregister(Object service) {
        synchronized (services) {
            super.unregister(service);
            if (service instanceof Command) {
                Command command = (Command) service;
                String scope = command.getScope();
                String name = command.getName();
                commandProcessor.removeCommand(scope, name);
                if (!Session.SCOPE_GLOBAL.equals(scope)) {
                    if (subshells.get(scope).decrement() == 0) {
                        SubShellCommand subShell = subshells.remove(scope);
                        unregister(subShell);
View Full Code Here

    }

    @Override
    public Command getCommand(String scope, String name) {
        if (parent != null) {
            Command command = parent.getCommand(scope, name);
            if (command != null) {
                return command;
            }
        }
        synchronized (services) {
View Full Code Here

    @Override
    public void register(Object service) {
        synchronized (services) {
            services.put(service, service);
            if (service instanceof Command) {
                Command cmd = (Command) service;
                String key = cmd.getScope() + ":" + cmd.getName();
                List<Command> cmds = commands.get(key);
                if (cmds == null) {
                    cmds = new ArrayList<Command>();
                    commands.put(key, cmds);
                }
View Full Code Here

    @Override
    public void unregister(Object service) {
        synchronized (services) {
            services.remove(service);
            if (service instanceof Command) {
                Command cmd = (Command) service;
                String key = cmd.getScope() + ":" + cmd.getName();
                List<Command> cmds = commands.get(key);
                if (cmds != null) {
                    cmds.remove(cmd);
                    if (cmds.isEmpty()) {
                        commands.remove(key);
View Full Code Here

    }

    @Override
    public Command getCommand(String scope, String name) {
        if (parent != null) {
            Command command = parent.getCommand(scope, name);
            if (command != null) {
                return command;
            }
        }
        synchronized (services) {
View Full Code Here

    @Override
    public void register(Object service) {
        synchronized (services) {
            services.put(service, service);
            if (service instanceof Command) {
                Command cmd = (Command) service;
                String key = cmd.getScope() + ":" + cmd.getName();
                List<Command> cmds = commands.get(key);
                if (cmds == null) {
                    cmds = new ArrayList<Command>();
                    commands.put(key, cmds);
                }
View Full Code Here

    @Override
    public void unregister(Object service) {
        synchronized (services) {
            services.remove(service);
            if (service instanceof Command) {
                Command cmd = (Command) service;
                String key = cmd.getScope() + ":" + cmd.getName();
                List<Command> cmds = commands.get(key);
                if (cmds != null) {
                    cmds.remove(cmd);
                    if (cmds.isEmpty()) {
                        commands.remove(key);
View Full Code Here

TOP

Related Classes of org.apache.karaf.shell.api.console.Command

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.