SHL-100,101,102

This commit is contained in:
mpollack
2013-07-23 03:00:44 -04:00
parent 62ca88f36f
commit c37f0fdae8
19 changed files with 166 additions and 72 deletions

View File

@@ -0,0 +1,40 @@
/*
* Copyright 2011-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.shell.samples.helloworld;
import java.io.IOException;
import org.springframework.shell.Bootstrap;
/**
* Driver class to run the helloworld example.
*
* @author Mark Pollack
*
*/
public class Main {
/**
* Main class that delegates to Spring Shell's Bootstrap class in order to simplify debugging inside an IDE
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
Bootstrap.main(args);
}
}

View File

@@ -54,7 +54,7 @@ public class MyBannerProvider extends DefaultBannerProvider
}
@Override
public String name() {
return "helloworld";
public String getProviderName() {
return "Hello World Banner";
}
}

View File

@@ -28,15 +28,15 @@ import org.springframework.stereotype.Component;
*/
@Component
@Order(Ordered.HIGHEST_PRECEDENCE)
public class MyHistoryFileNameProvider extends DefaultHistoryFileNameProvider{
public class MyHistoryFileNameProvider extends DefaultHistoryFileNameProvider {
public String getHistoryFileName() {
return "my.log";
}
@Override
public String name() {
return "my history file name provider";
public String getProviderName() {
return "My history file name provider";
}
}

View File

@@ -35,8 +35,8 @@ public class MyPromptProvider extends DefaultPromptProvider {
@Override
public String name() {
return "my prompt provider";
public String getProviderName() {
return "My prompt provider";
}
}

View File

@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="org.springframework.shell.samples.helloworld.commands" />