org.springframework.shell.Shell Java Examples

The following examples show how to use org.springframework.shell.Shell. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: ssh-shell-spring-boot   Author: fonimus   File: SshShellCommandFactory.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Constructor
 *
 * @param shellListenerService shell listener service
 * @param banner               shell banner
 * @param promptProvider       prompt provider
 * @param shell                spring shell
 * @param completerAdapter     completer adapter
 * @param parser               jline parser
 * @param environment          spring environment
 * @param properties           ssh shell properties
 */
public SshShellCommandFactory(SshShellListenerService shellListenerService,
                              @Autowired(required = false) Banner banner,
                              @Lazy PromptProvider promptProvider,
                              Shell shell,
                              JLineShellAutoConfiguration.CompleterAdapter completerAdapter, Parser parser,
                              Environment environment,
                              SshShellProperties properties) {
    this.shellListenerService = shellListenerService;
    this.shellBanner = banner;
    this.promptProvider = promptProvider;
    this.shell = shell;
    this.completerAdapter = completerAdapter;
    this.parser = parser;
    this.environment = environment;
    this.properties = properties;
}
 
Example #2
Source Project: ssh-shell-spring-boot   Author: fonimus   File: SshShellRunnable.java    License: Apache License 2.0 6 votes vote down vote up
public SshShellRunnable(SshShellProperties properties, ChannelSession session,
                        SshShellListenerService shellListenerService, Banner shellBanner,
                        PromptProvider promptProvider, Shell shell,
                        JLineShellAutoConfiguration.CompleterAdapter completerAdapter, Parser parser,
                        Environment environment, org.apache.sshd.server.Environment sshEnv,
                        SshShellCommandFactory sshShellCommandFactory, InputStream is,
                        OutputStream os, ExitCallback ec) {
    this.properties = properties;
    this.session = session;
    this.shellListenerService = shellListenerService;
    this.shellBanner = shellBanner;
    this.promptProvider = promptProvider;
    this.shell = shell;
    this.completerAdapter = completerAdapter;
    this.parser = parser;
    this.environment = environment;
    this.sshEnv = sshEnv;
    this.sshShellCommandFactory = sshShellCommandFactory;
    this.is = is;
    this.os = os;
    this.ec = ec;
}
 
Example #3
Source Project: ssh-shell-spring-boot   Author: fonimus   File: SshShellAutoConfiguration.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Primary shell application runner which answers true to {@link InteractiveShellApplicationRunner#isEnabled()}
 *
 * @param lineReader     line reader
 * @param promptProvider prompt provider
 * @param parser         parser
 * @param shell          spring shell
 * @param environment    spring environment
 * @return shell application runner
 */
@Bean
@Primary
public InteractiveShellApplicationRunner sshInteractiveShellApplicationRunner(LineReader lineReader,
                                                                              PromptProvider promptProvider,
                                                                              Parser parser, Shell shell,
                                                                              Environment environment) {
    return new InteractiveShellApplicationRunner(lineReader, promptProvider, parser, shell, environment) {

        @Override
        public boolean isEnabled() {
            return true;
        }

        @Override
        public void run(ApplicationArguments args) {
            // do nothing
        }
    };
}
 
Example #4
Source Project: Cleanstone   Author: CleanstoneMC   File: InteractiveShellLifecycle.java    License: MIT License 5 votes vote down vote up
@Lazy
public InteractiveShellLifecycle(LineReader lineReader, PromptProvider promptProvider, Shell shell) {
    this.lineReader = lineReader;
    this.promptProvider = promptProvider;
    this.shell = shell;
    this.thread = new Thread(this);
}
 
Example #5
Source Project: ssh-shell-spring-boot   Author: fonimus   File: SshShellAutoConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
@Primary
public Shell sshShell(@Qualifier("main") ResultHandler<Object> resultHandler, List<PostProcessor> postProcessors) {
    return new ExtendedShell(new TypePostProcessorResultHandler(resultHandler, postProcessors));
}
 
Example #6
Source Project: spring-cloud-skipper   Author: spring-cloud   File: ShellConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public ApplicationRunner applicationRunner(Shell shell, ConfigurableEnvironment environment) {
	return new InteractiveModeApplicationRunner(shell, environment);
}
 
Example #7
Source Project: spring-cloud-skipper   Author: spring-cloud   File: InteractiveModeApplicationRunner.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Construct a new InteractiveModeApplicationRunner, given the required shell components.
 *
 * @param shell the shell
 * @param environment the environment
 */
public InteractiveModeApplicationRunner(Shell shell, ConfigurableEnvironment environment) {
	this.shell = shell;
	this.environment = environment;
}