Rename ShellRunner classes
This commit is contained in:
@@ -22,10 +22,10 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.shell.Shell;
|
||||
import org.springframework.shell.jline.InteractiveShellApplicationRunner;
|
||||
import org.springframework.shell.jline.NonInteractiveShellApplicationRunner;
|
||||
import org.springframework.shell.jline.InteractiveShellRunner;
|
||||
import org.springframework.shell.jline.NonInteractiveShellRunner;
|
||||
import org.springframework.shell.jline.PromptProvider;
|
||||
import org.springframework.shell.jline.ScriptShellApplicationRunner;
|
||||
import org.springframework.shell.jline.ScriptShellRunner;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
public class ShellRunnerAutoConfiguration {
|
||||
@@ -44,19 +44,19 @@ public class ShellRunnerAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "spring.shell.interactive", value = "enabled", havingValue = "true", matchIfMissing = true)
|
||||
public InteractiveShellApplicationRunner interactiveApplicationRunner() {
|
||||
return new InteractiveShellApplicationRunner(lineReader, promptProvider, shell);
|
||||
public InteractiveShellRunner interactiveApplicationRunner() {
|
||||
return new InteractiveShellRunner(lineReader, promptProvider, shell);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "spring.shell.noninteractive", value = "enabled", havingValue = "true", matchIfMissing = true)
|
||||
public NonInteractiveShellApplicationRunner nonInteractiveApplicationRunner() {
|
||||
return new NonInteractiveShellApplicationRunner(shell);
|
||||
public NonInteractiveShellRunner nonInteractiveApplicationRunner() {
|
||||
return new NonInteractiveShellRunner(shell);
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "spring.shell.script", value = "enabled", havingValue = "true", matchIfMissing = true)
|
||||
public ScriptShellApplicationRunner scriptApplicationRunner() {
|
||||
return new ScriptShellApplicationRunner(parser, shell);
|
||||
public ScriptShellRunner scriptApplicationRunner() {
|
||||
return new ScriptShellRunner(parser, shell);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,8 +37,8 @@ import org.springframework.shell.ShellRunner;
|
||||
*
|
||||
* @author Eric Bottard
|
||||
*/
|
||||
@Order(InteractiveShellApplicationRunner.PRECEDENCE)
|
||||
public class InteractiveShellApplicationRunner implements ShellRunner {
|
||||
@Order(InteractiveShellRunner.PRECEDENCE)
|
||||
public class InteractiveShellRunner implements ShellRunner {
|
||||
|
||||
/**
|
||||
* The precedence at which this runner is set. Highger precedence runners may effectively disable this one by setting
|
||||
@@ -52,7 +52,7 @@ public class InteractiveShellApplicationRunner implements ShellRunner {
|
||||
|
||||
private final Shell shell;
|
||||
|
||||
public InteractiveShellApplicationRunner(LineReader lineReader, PromptProvider promptProvider, Shell shell) {
|
||||
public InteractiveShellRunner(LineReader lineReader, PromptProvider promptProvider, Shell shell) {
|
||||
this.lineReader = lineReader;
|
||||
this.promptProvider = promptProvider;
|
||||
this.shell = shell;
|
||||
@@ -33,12 +33,12 @@ import org.springframework.util.StringUtils;
|
||||
*
|
||||
* @author Janne Valkealahti
|
||||
*/
|
||||
@Order(InteractiveShellApplicationRunner.PRECEDENCE - 50)
|
||||
public class NonInteractiveShellApplicationRunner implements ShellRunner {
|
||||
@Order(InteractiveShellRunner.PRECEDENCE - 50)
|
||||
public class NonInteractiveShellRunner implements ShellRunner {
|
||||
|
||||
private final Shell shell;
|
||||
|
||||
public NonInteractiveShellApplicationRunner(Shell shell) {
|
||||
public NonInteractiveShellRunner(Shell shell) {
|
||||
this.shell = shell;
|
||||
}
|
||||
|
||||
@@ -34,14 +34,14 @@ import org.springframework.util.ObjectUtils;
|
||||
* Spring Boot ApplicationRunner that looks for process arguments that start with
|
||||
* {@literal @}, which are then interpreted as references to script files to run and exit.
|
||||
*
|
||||
* Has higher precedence than {@link InteractiveShellApplicationRunner} so that it
|
||||
* Has higher precedence than {@link InteractiveShellRunner} so that it
|
||||
* prevents it to run if scripts are found.
|
||||
*
|
||||
* @author Eric Bottard
|
||||
*/
|
||||
//tag::documentation[]
|
||||
@Order(InteractiveShellApplicationRunner.PRECEDENCE - 100) // Runs before InteractiveShellApplicationRunner
|
||||
public class ScriptShellApplicationRunner implements ShellRunner {
|
||||
@Order(InteractiveShellRunner.PRECEDENCE - 100)
|
||||
public class ScriptShellRunner implements ShellRunner {
|
||||
//end::documentation[]
|
||||
|
||||
public static final String SPRING_SHELL_SCRIPT = "spring.shell.script";
|
||||
@@ -57,7 +57,7 @@ public class ScriptShellApplicationRunner implements ShellRunner {
|
||||
|
||||
private final Shell shell;
|
||||
|
||||
public ScriptShellApplicationRunner(Parser parser, Shell shell) {
|
||||
public ScriptShellRunner(Parser parser, Shell shell) {
|
||||
this.parser = parser;
|
||||
this.shell = shell;
|
||||
}
|
||||
@@ -24,7 +24,7 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.shell.CommandRegistry;
|
||||
import org.springframework.shell.TerminalSizeAware;
|
||||
import org.springframework.shell.jline.InteractiveShellApplicationRunner;
|
||||
import org.springframework.shell.jline.InteractiveShellRunner;
|
||||
|
||||
/**
|
||||
* Used for explicit configuration of {@link org.springframework.shell.ResultHandler}s.
|
||||
@@ -58,7 +58,7 @@ public class ResultHandlerConfig {
|
||||
|
||||
@Bean
|
||||
public ThrowableResultHandler throwableResultHandler(Terminal terminal, CommandRegistry commandRegistry,
|
||||
ObjectProvider<InteractiveShellApplicationRunner> interactiveApplicationRunner) {
|
||||
ObjectProvider<InteractiveShellRunner> interactiveApplicationRunner) {
|
||||
return new ThrowableResultHandler(terminal, commandRegistry, interactiveApplicationRunner);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.jline.utils.AttributedStyle;
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.shell.CommandRegistry;
|
||||
import org.springframework.shell.ResultHandler;
|
||||
import org.springframework.shell.jline.InteractiveShellApplicationRunner;
|
||||
import org.springframework.shell.jline.InteractiveShellRunner;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
@@ -45,10 +45,10 @@ public class ThrowableResultHandler extends TerminalAwareResultHandler<Throwable
|
||||
|
||||
private CommandRegistry commandRegistry;
|
||||
|
||||
private ObjectProvider<InteractiveShellApplicationRunner> interactiveRunner;
|
||||
private ObjectProvider<InteractiveShellRunner> interactiveRunner;
|
||||
|
||||
public ThrowableResultHandler(Terminal terminal, CommandRegistry commandRegistry,
|
||||
ObjectProvider<InteractiveShellApplicationRunner> interactiveRunner) {
|
||||
ObjectProvider<InteractiveShellRunner> interactiveRunner) {
|
||||
super(terminal);
|
||||
this.commandRegistry = commandRegistry;
|
||||
this.interactiveRunner = interactiveRunner;
|
||||
|
||||
Reference in New Issue
Block a user