You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2008/10/07 12:37:02 UTC

svn commit: r702430 - in /geronimo/gshell/trunk: gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ gshell-wisdom/gshell-wi...

Author: jdillon
Date: Tue Oct  7 03:37:00 2008
New Revision: 702430

URL: http://svn.apache.org/viewvc?rev=702430&view=rev
Log:
The shell's console prompter and console error handler are now configured as components
Changed history to be set as a component now too (not autowired)
Added the shell and history as immutable variables for now until we revise the context apis

Added:
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsoleErrorHandlerImpl.java   (with props)
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsolePrompterImpl.java   (with props)
Modified:
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HistoryAction.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/HistoryImpl.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring/components.xml

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HistoryAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HistoryAction.java?rev=702430&r1=702429&r2=702430&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HistoryAction.java (original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HistoryAction.java Tue Oct  7 03:37:00 2008
@@ -25,7 +25,6 @@
 import org.apache.geronimo.gshell.command.CommandAction;
 import org.apache.geronimo.gshell.command.CommandContext;
 import org.apache.geronimo.gshell.io.IO;
-import org.springframework.beans.factory.annotation.Autowired;
 
 import java.util.List;
 
@@ -37,9 +36,6 @@
 public class HistoryAction
     implements CommandAction
 {
-    @Autowired
-    private History history;
-
     // TODO: Support displaying a range of history
     
     // TODO: Add clear and recall support
@@ -48,6 +44,10 @@
         assert context != null;
         IO io = context.getIo();
 
+        // HACK: Get at the shell's history from our variables
+        History history = (History) context.getVariables().get("SHELL.HISTORY");
+        assert history != null;
+
         // noinspection unchecked
         List<String> elements = history.getHistoryList();
 

Added: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsoleErrorHandlerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsoleErrorHandlerImpl.java?rev=702430&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsoleErrorHandlerImpl.java (added)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsoleErrorHandlerImpl.java Tue Oct  7 03:37:00 2008
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.geronimo.gshell.wisdom.shell;
+
+import org.apache.geronimo.gshell.ansi.Renderer;
+import org.apache.geronimo.gshell.application.Application;
+import org.apache.geronimo.gshell.console.Console;
+import org.apache.geronimo.gshell.event.EventManager;
+import org.apache.geronimo.gshell.io.IO;
+import org.apache.geronimo.gshell.notification.ErrorNotification;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * {@link Console.ErrorHandler} component.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ConsoleErrorHandlerImpl
+    implements Console.ErrorHandler
+{
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private EventManager eventManager;
+
+    @Autowired
+    private Application application;
+
+    private Renderer renderer = new Renderer();
+
+    public Result handleError(final Throwable error) {
+        assert error != null;
+
+        displayError(error);
+
+        return Result.CONTINUE;
+    }
+
+    private void displayError(final Throwable error) {
+        assert error != null;
+
+        // Decode any error notifications
+        Throwable cause = error;
+        if (error instanceof ErrorNotification) {
+            cause = error.getCause();
+        }
+
+        //
+        // FIXME: Really should be the ShellContext here
+        //
+        
+        assert application != null;
+        IO io = application.getIo();
+
+        //
+        // TODO: Use the Render API
+        //
+
+        // Spit out the terse reason why we've failed
+        io.err.print("@|bold,red ERROR| ");
+        io.err.print(cause.getClass().getSimpleName());
+        io.err.println(": @|bold,red " + cause.getMessage() + "|");
+
+        // Determine if the stack trace flag is set
+        String stackTraceProperty = System.getProperty("gshell.show.stacktrace");
+        boolean stackTraceFlag = false;
+        if (stackTraceProperty != null) {
+        	stackTraceFlag = stackTraceProperty.trim().equals("true");
+        }
+
+        if (io.isDebug()) {
+            // If we have debug enabled then skip the fancy bits below, and log the full error, don't decode shit
+            log.debug(error.toString(), error);
+        }
+        else if (io.isVerbose() || stackTraceFlag) {
+            // Render a fancy ansi colored stack trace
+            StackTraceElement[] trace = cause.getStackTrace();
+            StringBuilder buff = new StringBuilder();
+
+            //
+            // TODO: Move this to helper in gshell-ansi
+            //
+
+            for (StackTraceElement e : trace) {
+                buff.append("        @|bold at| ").
+                    append(e.getClassName()).
+                    append(".").
+                    append(e.getMethodName()).
+                    append(" (@|bold ");
+
+                buff.append(e.isNativeMethod() ? "Native Method" :
+                        (e.getFileName() != null && e.getLineNumber() != -1 ? e.getFileName() + ":" + e.getLineNumber() :
+                            (e.getFileName() != null ? e.getFileName() : "Unknown Source")));
+
+                buff.append("|)");
+
+                //
+                // FIXME: This does not properly display the full exception detail when cause contains nested exceptions
+                //
+
+                io.err.println(buff);
+
+                buff.setLength(0);
+            }
+        }
+    }
+}
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsoleErrorHandlerImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsoleErrorHandlerImpl.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsoleErrorHandlerImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsolePrompterImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsolePrompterImpl.java?rev=702430&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsolePrompterImpl.java (added)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsolePrompterImpl.java Tue Oct  7 03:37:00 2008
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.geronimo.gshell.wisdom.shell;
+
+import org.apache.geronimo.gshell.ansi.Code;
+import org.apache.geronimo.gshell.ansi.Renderer;
+import org.apache.geronimo.gshell.application.Application;
+import org.apache.geronimo.gshell.console.Console;
+import org.apache.geronimo.gshell.model.application.Branding;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * {@link Console.Prompter} component.
+ *
+ * @version $Rev$ $Date$
+ */
+public class ConsolePrompterImpl
+    implements Console.Prompter
+{
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private Application application;
+
+    private Renderer renderer = new Renderer();
+
+    //
+    // TODO: Need to create a PatternPrompter, which can use interpolation of a variable to render the prompt
+    //       so the following variable value would set the same prompt as we are hardcoding here:
+    //
+    //    set gshell.prompt="@|bold ${application.username}|@${application.localHost.hostName}:@|bold ${application.branding.name}|> "
+    //
+
+    public String prompt() {
+        assert application != null;
+        Branding branding = application.getModel().getBranding();
+
+        StringBuilder buff = new StringBuilder();
+        buff.append(Renderer.encode(application.getUserName(), Code.BOLD));
+        buff.append("@");
+        buff.append(application.getLocalHost().getHostName());
+        buff.append(":");
+        buff.append(Renderer.encode(branding.getName(), Code.BOLD));
+        buff.append("> ");
+
+        return renderer.render(buff.toString());
+    }
+}
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsolePrompterImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsolePrompterImpl.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsolePrompterImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/HistoryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/HistoryImpl.java?rev=702430&r1=702429&r2=702430&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/HistoryImpl.java (original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/HistoryImpl.java Tue Oct  7 03:37:00 2008
@@ -20,9 +20,7 @@
 package org.apache.geronimo.gshell.wisdom.shell;
 
 import jline.History;
-import org.apache.geronimo.gshell.event.EventAdapter;
-import org.apache.geronimo.gshell.event.EventManager;
-import org.apache.geronimo.gshell.wisdom.application.ApplicationConfiguredEvent;
+import org.apache.geronimo.gshell.application.Application;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -42,19 +40,14 @@
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     @Autowired
-    private EventManager eventManager;
+    private Application application;
 
     @PostConstruct
-    public void init() {
-        assert eventManager != null;
-        eventManager.addListener(new EventAdapter<ApplicationConfiguredEvent>() {
-            protected void handleEvent(final ApplicationConfiguredEvent event) throws Exception {
-                assert event != null;
-
-                File file = event.getApplication().getModel().getBranding().getHistoryFile();
-                log.debug("History file: {}", file);
-            }
-        });
+    public void init() throws Exception {
+        assert application != null;
+        File file = application.getModel().getBranding().getHistoryFile();
+        log.debug("History file: {}", file);
+        setHistoryFile(file);
     }
     
     public void setHistoryFile(final File file) throws IOException {

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java?rev=702430&r1=702429&r2=702430&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java (original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java Tue Oct  7 03:37:00 2008
@@ -21,8 +21,6 @@
 
 import jline.Completor;
 import jline.History;
-import org.apache.geronimo.gshell.ansi.Code;
-import org.apache.geronimo.gshell.ansi.Renderer;
 import org.apache.geronimo.gshell.application.Application;
 import org.apache.geronimo.gshell.command.Variables;
 import org.apache.geronimo.gshell.commandline.CommandLineExecutor;
@@ -33,7 +31,6 @@
 import org.apache.geronimo.gshell.console.completer.AggregateCompleter;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.model.application.Branding;
-import org.apache.geronimo.gshell.notification.ErrorNotification;
 import org.apache.geronimo.gshell.notification.ExitNotification;
 import org.apache.geronimo.gshell.shell.Shell;
 import org.apache.geronimo.gshell.shell.ShellContext;
@@ -66,7 +63,6 @@
     @Autowired
     private CommandLineExecutor executor;
 
-    @Autowired
     private History history;
 
     private List<Completor> completers;
@@ -91,36 +87,14 @@
         return true;
     }
 
-    public synchronized void close() {
-        log.debug("Closing");
-        opened = false;
-    }
-
-    public ShellContext getContext() {
-        ensureOpened();
-
-        if (context == null) {
-            throw new IllegalStateException("Shell context has not been initialized");
-        }
-        return context;
-    }
-
-    public void setCompleters(final List<Completor> completers) {
-        assert completers != null;
-
-        this.completers = completers;
-    }
-    
-    public boolean isInteractive() {
-        return true;
-    }
-
     @PostConstruct
-    public void init() throws Exception {
+    public synchronized void init() throws Exception {
         if (opened) {
             throw new IllegalStateException("Shell is already opened");
         }
 
+        log.debug("Initializing");
+
         assert application != null;
 
         // Dereference some bits from the applciation context
@@ -143,6 +117,12 @@
             }
         };
 
+        // HACK: Add ourself to variables so commands can get to us.  Maybe need to add to ^^^ and expose in CommandContent
+        vars.set("SHELL", this, true);
+
+        // HACK: Add history for the 'history' command, since its not part of the Shell interf it can't really access it easy, resolve with ^^^
+        vars.set("SHELL.HISTORY", getHistory(), true);
+
         branding = application.getModel().getBranding();
 
         opened = true;
@@ -154,6 +134,42 @@
         loadProfileScripts();
     }
 
+    public synchronized void close() {
+        log.debug("Closing");
+
+        opened = false;
+    }
+    
+    public ShellContext getContext() {
+        ensureOpened();
+
+        if (context == null) {
+            throw new IllegalStateException("Shell context has not been initialized");
+        }
+        return context;
+    }
+
+    public void setCompleters(final List<Completor> completers) {
+        assert completers != null;
+
+        this.completers = completers;
+    }
+
+    public History getHistory() {
+        if (history == null) {
+            throw new IllegalStateException("Missing configuration property: history");
+        }
+        return history;
+    }
+
+    public void setHistory(final History history) {
+        this.history = history;
+    }
+
+    public boolean isInteractive() {
+        return true;
+    }
+
     public Object execute(final String line) throws Exception {
         ensureOpened();
 
@@ -264,7 +280,7 @@
 
     public Prompter getPrompter() {
         if (prompter == null) {
-            prompter = createPrompter();
+            throw new IllegalStateException("Missing configuration property: prompter");
         }
         return prompter;
     }
@@ -272,125 +288,16 @@
     public void setPrompter(final Prompter prompter) {
         this.prompter = prompter;
     }
-
-    /**
-     * Allow subclasses to override the default Prompter implementation used.
-     *
-     * @return Interactive properter.
-     */
-    protected Prompter createPrompter() {
-        return new Prompter() {
-            Renderer renderer = new Renderer();
-
-            //
-            // TODO: Need to create a PatternPrompter, which can use interpolation of a variable to render the prompt
-            //       so the following variable value would set the same prompt as we are hardcoding here:
-            //
-            //    set gshell.prompt="@|bold ${application.username}|@${application.localHost.hostName}:@|bold ${application.branding.name}|> "
-            //
-
-            public String prompt() {
-                assert application != null;
-                Branding branding = application.getModel().getBranding();
-                
-                StringBuilder buff = new StringBuilder();
-                buff.append(Renderer.encode(application.getUserName(), Code.BOLD));
-                buff.append("@");
-                buff.append(application.getLocalHost().getHostName());
-                buff.append(":");
-                buff.append(Renderer.encode(branding.getName(), Code.BOLD));
-                buff.append("> ");
-
-                return renderer.render(buff.toString());
-            }
-        };
-    }
-
+    
     public ErrorHandler getErrorHandler() {
         if (errorHandler == null) {
-            errorHandler = createErrorHandler();
+            throw new IllegalStateException("Missing configuration property: errorHandler");
         }
         return errorHandler;
     }
 
-    public void setErrorHandler(ErrorHandler errorHandler) {
-        this.errorHandler = errorHandler;
-    }
-
-    public ErrorHandler createErrorHandler() {
-        return new ErrorHandler() {
-            public Result handleError(final Throwable error) {
-                assert error != null;
-
-                displayError(error);
-
-                return Result.CONTINUE;
-            }
-        };
-    }
-
-    //
-    // Error Display
-    //
-
-    private void displayError(final Throwable error) {
-        assert error != null;
-
-        // Decode any error notifications
-        Throwable cause = error;
-        if (error instanceof ErrorNotification) {
-            cause = error.getCause();
-        }
-
-        IO io = getContext().getIo();
-
-        // Spit out the terse reason why we've failed
-        io.err.print("@|bold,red ERROR| ");
-        io.err.print(cause.getClass().getSimpleName());
-        io.err.println(": @|bold,red " + cause.getMessage() + "|");
-
-        // Determine if the stack trace flag is set
-        String stackTraceProperty = System.getProperty("gshell.show.stacktrace");
-        boolean stackTraceFlag = false;
-        if (stackTraceProperty != null) {
-        	stackTraceFlag = stackTraceProperty.trim().equals("true");
-        }
-
-        if (io.isDebug()) {
-            // If we have debug enabled then skip the fancy bits below, and log the full error, don't decode shit
-            log.debug(error.toString(), error);
-        }
-        else if (io.isVerbose() || stackTraceFlag) {
-            // Render a fancy ansi colored stack trace
-            StackTraceElement[] trace = cause.getStackTrace();
-            StringBuffer buff = new StringBuffer();
-
-            //
-            // TODO: Move this to helper in gshell-ansi
-            //
-
-            for (StackTraceElement e : trace) {
-                buff.append("        @|bold at| ").
-                    append(e.getClassName()).
-                    append(".").
-                    append(e.getMethodName()).
-                    append(" (@|bold ");
-
-                buff.append(e.isNativeMethod() ? "Native Method" :
-                        (e.getFileName() != null && e.getLineNumber() != -1 ? e.getFileName() + ":" + e.getLineNumber() :
-                            (e.getFileName() != null ? e.getFileName() : "Unknown Source")));
-
-                buff.append("|)");
-
-                //
-                // FIXME: This does not properly display the full exception detail when cause contains nested exceptions
-                //
-
-                io.err.println(buff);
-
-                buff.setLength(0);
-            }
-        }
+    public void setErrorHandler(final ErrorHandler handler) {
+        this.errorHandler = handler;
     }
 
     //

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring/components.xml?rev=702430&r1=702429&r2=702430&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring/components.xml (original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring/components.xml Tue Oct  7 03:37:00 2008
@@ -43,12 +43,6 @@
 
     <bean id="commandLineExecutor" class="org.apache.geronimo.gshell.wisdom.shell.CommandLineExecutorImpl"/>
 
-    <!--
-    FIXME: Need to find a better way to configure the history for a Shell, this singleton is defs not correct.
-    -->
-
-    <bean id="history" class="org.apache.geronimo.gshell.wisdom.shell.HistoryImpl"/>
-
     <bean id="shell" class="org.apache.geronimo.gshell.wisdom.shell.ShellImpl" scope="prototype">
         <property name="completers">
             <list>
@@ -56,6 +50,18 @@
                 <ref bean="aliasNameCompleter"/>
             </list>
         </property>
+        
+        <property name="prompter">
+            <bean class="org.apache.geronimo.gshell.wisdom.shell.ConsolePrompterImpl"/>
+        </property>
+
+        <property name="errorHandler">
+            <bean class="org.apache.geronimo.gshell.wisdom.shell.ConsoleErrorHandlerImpl"/>
+        </property>
+
+        <property name="history">
+            <bean class="org.apache.geronimo.gshell.wisdom.shell.HistoryImpl"/>
+        </property>
     </bean>
 
     <bean id="commandNameCompleter" class="org.apache.geronimo.gshell.wisdom.completer.CommandNameCompleter"/>