SHL-17 customize welcome message

This commit is contained in:
Jarred Li
2012-04-12 17:00:41 +08:00
parent 2b05b13db6
commit 11fe9f5918
6 changed files with 94 additions and 25 deletions

View File

@@ -35,10 +35,11 @@ public class Bootstrap {
private Thread shellThread;
private ConfigurableApplicationContext ctx;
private static StopWatch sw = new StopWatch("Spring Sehll");
private static SimpleShellCommandLineOptions options;
public static void main(String[] args) throws IOException {
sw.start();
SimpleShellCommandLineOptions options = SimpleShellCommandLineOptions.parseCommandLine(args);
options = SimpleShellCommandLineOptions.parseCommandLine(args);
for (Map.Entry<String, String> entry : options.extraSystemProperties.entrySet()) {
System.setProperty(entry.getKey(), entry.getValue());
@@ -68,6 +69,9 @@ public class Bootstrap {
//shell = new JLineShellComponent();
shell = ctx.getBean("shell", JLineShellComponent.class);
shell.setApplicationContext(ctx);
if(options.executeThenQuit != null){
shell.setPrintBanner(false);
}
Map<String, CommandMarker> commands = BeanFactoryUtils.beansOfTypeIncludingAncestors(ctx,CommandMarker.class);
@@ -191,14 +195,15 @@ public class Bootstrap {
// shouldn't really happen, but we'll fallback to this anyway
exitShellRequest = ExitShellRequest.NORMAL_EXIT;
}
try {
shellThread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
try {
shellThread.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
ctx.close();
sw.stop();
if (shell.isDevelopmentMode()) {