Package org.apache.karaf.shell.support.completers

Examples of org.apache.karaf.shell.support.completers.StringsCompleter


    @Reference
    private JdbcService jdbcService;

    @Override
    public int complete(Session session, CommandLine commandLine, List<String> candidates) {
        StringsCompleter delegate = new StringsCompleter();
        try {
            for (String datasource : jdbcService.datasources()) {
                delegate.getStrings().add(datasource);
            }
        } catch (Exception e) {
            // nothing to do
        }
        return delegate.complete(session, commandLine, candidates);
    }
View Full Code Here


@Service
public class MyCompleter implements Completer {

    public int complete(Session session, CommandLine commandLine, List<String> candidates) {

        StringsCompleter delegate = new StringsCompleter();
        delegate.getStrings().add("one");
        delegate.getStrings().add("two");
        delegate.getStrings().add("three");
        return delegate.complete(session, commandLine, candidates);
    }
View Full Code Here

    @Reference
    private JmsService jmsService;

    @Override
    public int complete(Session session, CommandLine commandLine, List<String> candidates) {
        StringsCompleter delegate = new StringsCompleter();
        try {
            for (String connectionFactory : jmsService.connectionFactoryFileNames()) {
                delegate.getStrings().add(connectionFactory.replace("connectionfactory-", "").replace(".xml", ""));
            }
        } catch (Exception e) {
            // nothing to do
        }
        return delegate.complete(session, commandLine, candidates);
    }
View Full Code Here

    @Reference
    private JmsService jmsService;

    @Override
    public int complete(Session session, CommandLine commandLine, List<String> candidates) {
        StringsCompleter delegate = new StringsCompleter();
        try {
            for (String connectionFactory : jmsService.connectionFactories()) {
                delegate.getStrings().add(connectionFactory);
            }
        } catch (Exception e) {
            // nothing to do
        }
        return delegate.complete(session, commandLine, candidates);
    }
View Full Code Here

        List<String> strings = new ArrayList<String>();
        for (String name : serviceNames) {
            strings.add(ObjectClassMatcher.getShortName(name));
        }
        strings.addAll(serviceNames);
        return new StringsCompleter(strings).complete(session, commandLine, candidates);
    }
View Full Code Here

TOP

Related Classes of org.apache.karaf.shell.support.completers.StringsCompleter

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.