Java 类org.springframework.boot.cli.command.OptionParsingCommand 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:CliTester.java   
private <T extends OptionParsingCommand> Future<T> submitCommand(final T command,
        String... args) {
    clearUrlHandler();
    final String[] sources = getSources(args);
    return Executors.newSingleThreadExecutor().submit(new Callable<T>() {
        @Override
        public T call() throws Exception {
            ClassLoader loader = Thread.currentThread().getContextClassLoader();
            System.setProperty("server.port", String.valueOf(CliTester.this.port));
            try {
                command.run(sources);
                return command;
            }
            finally {
                System.clearProperty("server.port");
                Thread.currentThread().setContextClassLoader(loader);
            }
        }
    });
}
项目:spring-boot-concourse    文件:CliTester.java   
private <T extends OptionParsingCommand> Future<T> submitCommand(final T command,
        String... args) {
    clearUrlHandler();
    final String[] sources = getSources(args);
    return Executors.newSingleThreadExecutor().submit(new Callable<T>() {
        @Override
        public T call() throws Exception {
            ClassLoader loader = Thread.currentThread().getContextClassLoader();
            System.setProperty("server.port", String.valueOf(CliTester.this.port));
            try {
                command.run(sources);
                return command;
            }
            finally {
                System.clearProperty("server.port");
                Thread.currentThread().setContextClassLoader(loader);
            }
        }
    });
}
项目:contestparser    文件:CliTester.java   
private <T extends OptionParsingCommand> Future<T> submitCommand(final T command,
        String... args) {
    clearUrlHandler();
    final String[] sources = getSources(args);
    return Executors.newSingleThreadExecutor().submit(new Callable<T>() {
        @Override
        public T call() throws Exception {
            ClassLoader loader = Thread.currentThread().getContextClassLoader();
            System.setProperty("server.port", String.valueOf(CliTester.this.port));
            try {
                command.run(sources);
                return command;
            }
            finally {
                System.clearProperty("server.port");
                Thread.currentThread().setContextClassLoader(loader);
            }
        }
    });
}
项目:spring-cloud-cli    文件:CliTester.java   
private <T extends OptionParsingCommand> Future<T> submitCommand(final T command,
        String... args) {
    clearUrlHandler();
    final String[] sources = getSources(args);
    return Executors.newSingleThreadExecutor().submit(new Callable<T>() {
        @Override
        public T call() throws Exception {
            ClassLoader loader = Thread.currentThread().getContextClassLoader();
            System.setProperty("server.port", String.valueOf(CliTester.this.port));
            try {
                command.run(sources);
                return command;
            }
            finally {
                System.clearProperty("server.port");
                Thread.currentThread().setContextClassLoader(loader);
            }
        }
    });
}