Package org.apache.felix.gogo.commands.basic

Examples of org.apache.felix.gogo.commands.basic.AbstractCommand


                @Override
                public Object execute(CharSequence cmdstr) throws Exception {
                    List<String> tokens = Arrays.asList(cmdstr.toString().split("\\s"));
                    List<Object> args = new ArrayList<Object>(tokens);
                    args.remove(0);
                    AbstractCommand command =  (AbstractCommand) get(AbstractCommand.class.getName());
                    command.execute(this, args);
                    return null;
                }
            };
        }
        return commandSession;
View Full Code Here


            // Get the command service
            List<String> tokens = Arrays.asList(cmdstr.split("\\s"));
            String[] header = tokens.get(0).split(":");
            Assert.assertTrue("Two tokens in: " + tokens.get(0), header.length == 2);
            String filter = "(&(osgi.command.scope=" + header[0] + ")(osgi.command.function=" + header[1] + "))";
            AbstractCommand command = (AbstractCommand) ServiceLocator.awaitService(Function.class, filter);
            commandSession.put(AbstractCommand.class.getName(), command);

            Class<?> actionClass = command.getActionClass();
            LOGGER.debug("Using action: {} from {}", actionClass, actionClass.getClassLoader());
           
            boolean keepRunning = true;
            while (!Thread.currentThread().isInterrupted() && keepRunning) {
                try {
View Full Code Here

TOP

Related Classes of org.apache.felix.gogo.commands.basic.AbstractCommand

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.