Package org.apache.felix.gogo.runtime

Examples of org.apache.felix.gogo.runtime.CommandProxy


                    Map<String, CommandProxy> proxyMap = new HashMap<String, CommandProxy>();
                    if (function.getClass().isArray())
                    {
                        for (Object f : ((Object[]) function))
                        {
                            CommandProxy target = new CommandProxy(context, reference, f.toString());
                            proxyMap.put(f.toString(), target);
                            processor.addCommand(scope.toString(), target, f.toString(), rank);
                            commands.add(target);
                        }
                    }
                    else
                    {
                        CommandProxy target = new CommandProxy(context, reference, function.toString());
                        proxyMap.put(function.toString(), target);
                        processor.addCommand(scope.toString(), target, function.toString(), rank);
                        commands.add(target);
                    }
                    proxies.put(reference, proxyMap);
View Full Code Here


                {
                    if (function.getClass().isArray())
                    {
                        for (Object f : ((Object[]) function))
                        {
                            Function target = new CommandProxy(context, reference,
                                f.toString());
                            processor.addCommand(scope.toString(), target, f.toString());
                            commands.add(target);
                        }
                    }
                    else
                    {
                        Function target = new CommandProxy(context, reference,
                            function.toString());
                        processor.addCommand(scope.toString(), target, function.toString());
                        commands.add(target);
                    }
                    return commands;
View Full Code Here

                List<Object> commands = new ArrayList<Object>();

                if (scope != null && function != null) {
                    if (function.getClass().isArray()) {
                        for (Object f : ((Object[]) function)) {
                            Function target = new CommandProxy(context, reference,
                                    f.toString());
                            addCommand(scope.toString(), target, f.toString());
                            commands.add(target);
                        }
                    } else {
                        Function target = new CommandProxy(context, reference,
                                function.toString());
                        addCommand(scope.toString(), target, function.toString());
                        commands.add(target);
                    }
                    return commands;
View Full Code Here

                    Map<String, CommandProxy> proxyMap = new HashMap<String, CommandProxy>();
                    if (function.getClass().isArray())
                    {
                        for (Object f : ((Object[]) function))
                        {
                            CommandProxy target = new CommandProxy(context, reference, f.toString());
                            proxyMap.put(f.toString(), target);
                            addCommand(scope.toString(), target, f.toString(), rank);
                            commands.add(target);
                        }
                    }
                    else
                    {
                        CommandProxy target = new CommandProxy(context, reference, function.toString());
                        proxyMap.put(function.toString(), target);
                        addCommand(scope.toString(), target, function.toString(), rank);
                        commands.add(target);
                    }
                    proxies.put(reference, proxyMap);
View Full Code Here

        return aliases;
    }

    protected Function unProxy(Function function) {
        if (function instanceof CommandProxy) {
            CommandProxy proxy = (CommandProxy) function;
            Object target = proxy.getTarget();
            Function result;
            if (target instanceof Function) {
                result = (Function) target;
            } else {
                result = function;
            }
            proxy.ungetTarget();
            return result;
        } else {
            return function;
        }
    }
View Full Code Here

                List<Object> commands = new ArrayList<Object>();

                if (scope != null && function != null) {
                    if (function.getClass().isArray()) {
                        for (Object f : ((Object[]) function)) {
                            Function target = new CommandProxy(context, reference,
                                    f.toString());
                            addCommand(scope.toString(), target, f.toString());
                            commands.add(target);
                        }
                    } else {
                        Function target = new CommandProxy(context, reference,
                                function.toString());
                        addCommand(scope.toString(), target, function.toString());
                        commands.add(target);
                    }
                    return commands;
View Full Code Here

    public static Function unProxy(Function function) {
        if (function == null || function.getClass() != CommandProxy.class) {
            return function;
        }
        CommandProxy proxy = (CommandProxy)function;
        Object target = proxy.getTarget();
        try {
            return target instanceof Function ? (Function)target : function;
        } finally {
            proxy.ungetTarget();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.felix.gogo.runtime.CommandProxy

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.