Package org.osgi.service.command

Examples of org.osgi.service.command.Function


            while (line != null) {
                line = line.trim();
                if (line.length() > 0 && line.charAt(0) != '#') {
                    final Class<Action> actionClass = (Class<Action>) cl.loadClass(line);
                    Command cmd = actionClass.getAnnotation(Command.class);
                    Function function = new AbstractCommand() {
                        @Override
                        public Action createNewAction() {
                            try {
                                return ((Class<? extends Action>) actionClass).newInstance();
                            } catch (InstantiationException e) {
View Full Code Here


        Set<String> names = (Set<String>) session.get(CommandSessionImpl.COMMANDS);
        if (!names.equals(commands)) {
            commands.clear();
            completers.clear();
            for (String command : names) {
                Function function = (Function) session.get(command);
                function = unProxy(function);
                if (function instanceof AbstractCommand) {
                    completers.add(new ArgumentCompleter(session, (AbstractCommand) function, command));
                }
                commands.add(command);
View Full Code Here

            while (line != null) {
                line = line.trim();
                if (line.length() > 0 && line.charAt(0) != '#') {
                    final Class<Action> actionClass = (Class<Action>) cl.loadClass(line);
                    Command cmd = actionClass.getAnnotation(Command.class);
                    Function function = new AbstractCommand() {
                        @Override
                        public Action createNewAction() {
                            try {
                                return ((Class<? extends Action>) actionClass).newInstance();
                            } catch (InstantiationException e) {
View Full Code Here

                Terminal term = (Terminal) session.get(".jline.terminal");
                PrintStream out = System.out;
                SortedMap<String,String> commands = new TreeMap<String,String>();
                for (String name : names) {
                    String description = null;
                    Function function = (Function) session.get(name);
                    function = unProxy(function);
                    if (function instanceof AbstractCommand) {
                        try {
                            Method mth = AbstractCommand.class.getDeclaredMethod("createNewAction");
                            mth.setAccessible(true);
View Full Code Here

TOP

Related Classes of org.osgi.service.command.Function

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.