geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r699716 - in /geronimo/gshell/trunk: gshell-api/src/main/java/org/apache/geronimo/gshell/command/ gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/ gshell-commands/gshell-builtins/src/main/resources...
Date Sat, 27 Sep 2008 18:50:23 GMT
Author: jdillon
Date: Sat Sep 27 11:50:23 2008
New Revision: 699716

URL: http://svn.apache.org/viewvc?rev=699716&view=rev
Log:
Dropped Completer interface, just use poorly named jline.Completor for now
Changed CommandCompleter to expose createCompleters() as we need a list to determine if/when
to add null termination to completion
Renamed AliasNameCompleter to AliasesCompleter
Implemented CommandsCompleter muck to hook up command-name + any specific command completers
Moved completers to prototype beans, as looks like we might wanna re-use them
Started to figure out how to reuse the AliasesCompleter stuff to support completion for the
'unalias' command

Added:
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/AliasesCompleter.java
  (contents, props changed)
      - copied, changed from r699708, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/AliasNameCompleter.java
Removed:
    geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/Completer.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/AliasNameCompleter.java
Modified:
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandCompleter.java
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/UnaliasAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml
    geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/MuxCompleter.java
    geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/StringsCompleter.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/NullCommandCompleter.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/java/org/apache/geronimo/gshell/wisdom/shell/completer/CommandNameCompleter.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/CommandsCompleter.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/spring/components.xml

Modified: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandCompleter.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandCompleter.java?rev=699716&r1=699715&r2=699716&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandCompleter.java
(original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandCompleter.java
Sat Sep 27 11:50:23 2008
@@ -21,6 +21,8 @@
 
 import jline.Completor;
 
+import java.util.Collection;
+
 /**
  * Provides completion support for a command.
  *
@@ -28,9 +30,5 @@
  */
 public interface CommandCompleter
 {
-    //
-    // FIXME: Use Completer here from gshell-console instead
-    //
-
-    Completor createCompletor();
+    Collection<Completor> createCompletors();
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/UnaliasAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/UnaliasAction.java?rev=699716&r1=699715&r2=699716&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/UnaliasAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/UnaliasAction.java
Sat Sep 27 11:50:23 2008
@@ -21,6 +21,7 @@
 
 import org.apache.geronimo.gshell.command.CommandAction;
 import org.apache.geronimo.gshell.command.CommandContext;
+import org.apache.geronimo.gshell.command.CommandCompleter;
 import org.apache.geronimo.gshell.clp.Argument;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.registry.AliasRegistry;
@@ -28,6 +29,11 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import jline.Completor;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.ArrayList;
 
 /**
  * Undefine an alias.
@@ -62,4 +68,22 @@
             return Result.FAILURE;
         }
     }
+
+    public static class Completer
+        implements CommandCompleter
+    {
+        // TODO: The AliasesCompleter class is not in scope, so have to inject it manually
me thinks, or use qualifiers?
+        // @Autowired
+        // private AliasesCompleter aliasesCompleter;
+
+        public Collection<Completor> createCompletors() {
+            List<Completor> completers = new ArrayList<Completor>(2);
+
+            // TODO: Hook up a *wired* AliasesCompleter instance
+            // completers.add(aliasesCompleter)
+            completers.add(null);
+
+            return completers;
+        }
+    }
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml?rev=699716&r1=699715&r2=699716&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/resources/META-INF/spring/components.xml
Sat Sep 27 11:50:23 2008
@@ -73,6 +73,10 @@
 
             <gshell:command name="unalias">
                 <gshell:action class="org.apache.geronimo.gshell.commands.builtins.UnaliasAction"/>
+                <!--
+                FIXME: Need to resolve some binding issues...
+                <gshell:completer class="org.apache.geronimo.gshell.commands.builtins.UnaliasAction$Completer"/>
+                -->
             </gshell:command>
             
             <gshell:command name="history">

Modified: geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/MuxCompleter.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/MuxCompleter.java?rev=699716&r1=699715&r2=699716&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/MuxCompleter.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/MuxCompleter.java
Sat Sep 27 11:50:23 2008
@@ -19,6 +19,8 @@
 
 package org.apache.geronimo.gshell.console.completer;
 
+import jline.Completor;
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.LinkedList;
@@ -30,19 +32,19 @@
  * @version $Rev$ $Date$
  */
 public class MuxCompleter
-    implements Completer
+    implements Completor
 {
-    private final List<Completer> completers = new ArrayList<Completer>();
+    private final List<Completor> completers = new ArrayList<Completor>();
 
     public MuxCompleter() {}
 
-    public MuxCompleter(final Collection<Completer> completers) {
+    public MuxCompleter(final Collection<Completor> completers) {
         assert completers != null;
 
         getCompleters().addAll(completers);
     }
 
-    public Collection<Completer> getCompleters() {
+    public Collection<Completor> getCompleters() {
         return completers;
     }
 
@@ -54,7 +56,7 @@
 
         // Run each completer, saving its completion results
         int max = -1;
-        for (Completer completer : completers) {
+        for (Completor completer : completers) {
             Completion completion = new Completion(candidates);
             completion.complete(completer, buffer, cursor);
 
@@ -88,7 +90,7 @@
             this.candidates = new LinkedList<String>(candidates);
         }
 
-        public void complete(final Completer completer, final String buffer, final int cursor)
{
+        public void complete(final Completor completer, final String buffer, final int cursor)
{
             assert completer != null;
 
             this.cursor = completer.complete(buffer, cursor, candidates);

Modified: geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/StringsCompleter.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/StringsCompleter.java?rev=699716&r1=699715&r2=699716&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/StringsCompleter.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/completer/StringsCompleter.java
Sat Sep 27 11:50:23 2008
@@ -19,10 +19,13 @@
 
 package org.apache.geronimo.gshell.console.completer;
 
+import jline.Completor;
+
 import java.util.Collection;
 import java.util.List;
 import java.util.SortedSet;
 import java.util.TreeSet;
+import java.util.Arrays;
 
 /**
  * Completer for a set of strings.
@@ -30,7 +33,7 @@
  * @version $Rev$ $Date$
  */
 public class StringsCompleter
-    implements Completer
+    implements Completor
 {
     private final SortedSet<String> strings = new TreeSet<String>();
 
@@ -42,6 +45,10 @@
         getStrings().addAll(strings);
     }
 
+    public StringsCompleter(final String[] strings) {
+        this(Arrays.asList(strings));
+    }
+
     public Collection<String> getStrings() {
         return strings;
     }

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/NullCommandCompleter.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/NullCommandCompleter.java?rev=699716&r1=699715&r2=699716&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/NullCommandCompleter.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/NullCommandCompleter.java
Sat Sep 27 11:50:23 2008
@@ -22,6 +22,8 @@
 import jline.Completor;
 import org.apache.geronimo.gshell.command.CommandCompleter;
 
+import java.util.Collection;
+
 /**
  * A <em>null</em> {@link CommandCompleter}.
  *
@@ -30,9 +32,7 @@
 public class NullCommandCompleter
     implements CommandCompleter
 {
-    public Completor createCompletor() {
-        // Nothing
-
+    public Collection<Completor> createCompletors() {
         return null;
     }
 }
\ No newline at end of file

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=699716&r1=699715&r2=699716&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
Sat Sep 27 11:50:23 2008
@@ -20,6 +20,7 @@
 package org.apache.geronimo.gshell.wisdom.shell;
 
 import jline.History;
+import jline.Completor;
 import org.apache.geronimo.gshell.ansi.Renderer;
 import org.apache.geronimo.gshell.ansi.Code;
 import org.apache.geronimo.gshell.application.Application;
@@ -29,7 +30,6 @@
 import org.apache.geronimo.gshell.console.Console.ErrorHandler;
 import org.apache.geronimo.gshell.console.Console.Prompter;
 import org.apache.geronimo.gshell.console.JLineConsole;
-import org.apache.geronimo.gshell.console.completer.Completer;
 import org.apache.geronimo.gshell.console.completer.MuxCompleter;
 import org.apache.geronimo.gshell.event.Event;
 import org.apache.geronimo.gshell.event.EventListener;
@@ -76,7 +76,7 @@
     @Autowired
     private History history;
 
-    private List<Completer> completers;
+    private List<Completor> completers;
 
     private ShellContext context;
 
@@ -86,7 +86,7 @@
 
     private ErrorHandler errorHandler;
 
-    public void setCompleters(final List<Completer> completers) {
+    public void setCompleters(final List<Completor> completers) {
         assert completers != null;
 
         this.completers = completers;
@@ -268,7 +268,7 @@
                 buff.append(hostName);
                 buff.append(":");
                 buff.append(Renderer.encode(appName, Code.BOLD));
-                buff.append(">");
+                buff.append("> ");
 
                 return renderer.render(buff.toString());
             }

Copied: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/AliasesCompleter.java
(from r699708, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/AliasNameCompleter.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/AliasesCompleter.java?p2=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/AliasesCompleter.java&p1=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/AliasNameCompleter.java&r1=699708&r2=699716&rev=699716&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/AliasNameCompleter.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/AliasesCompleter.java
Sat Sep 27 11:50:23 2008
@@ -19,7 +19,6 @@
 
 package org.apache.geronimo.gshell.wisdom.shell.completer;
 
-import org.apache.geronimo.gshell.console.completer.Completer;
 import org.apache.geronimo.gshell.console.completer.StringsCompleter;
 import org.apache.geronimo.gshell.event.Event;
 import org.apache.geronimo.gshell.event.EventListener;
@@ -35,13 +34,15 @@
 import java.util.Collection;
 import java.util.List;
 
+import jline.Completor;
+
 /**
- * {@link Completer} for alias names.
+ * {@link Completor} for alias names.
  *
  * @version $Rev$ $Date$
  */
-public class AliasNameCompleter
-    implements Completer
+public class AliasesCompleter
+    implements Completor
 {
     private final Logger log = LoggerFactory.getLogger(getClass());
 

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

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/AliasesCompleter.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/completer/AliasesCompleter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/CommandNameCompleter.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/CommandNameCompleter.java?rev=699716&r1=699715&r2=699716&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/CommandNameCompleter.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/CommandNameCompleter.java
Sat Sep 27 11:50:23 2008
@@ -19,7 +19,6 @@
 
 package org.apache.geronimo.gshell.wisdom.shell.completer;
 
-import org.apache.geronimo.gshell.console.completer.Completer;
 import org.apache.geronimo.gshell.console.completer.StringsCompleter;
 import org.apache.geronimo.gshell.event.Event;
 import org.apache.geronimo.gshell.event.EventListener;
@@ -35,13 +34,15 @@
 import java.util.Collection;
 import java.util.List;
 
+import jline.Completor;
+
 /**
- * {@link Completer} for command names.
+ * {@link Completor} for command names.
  *
  * @version $Rev$ $Date$
  */
 public class CommandNameCompleter
-    implements Completer
+    implements Completor
 {
     private final Logger log = LoggerFactory.getLogger(getClass());
 

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/CommandsCompleter.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/CommandsCompleter.java?rev=699716&r1=699715&r2=699716&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/CommandsCompleter.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/completer/CommandsCompleter.java
Sat Sep 27 11:50:23 2008
@@ -19,7 +19,12 @@
 
 package org.apache.geronimo.gshell.wisdom.shell.completer;
 
-import org.apache.geronimo.gshell.console.completer.Completer;
+import jline.ArgumentCompletor;
+import jline.Completor;
+import jline.NullCompletor;
+import org.apache.geronimo.gshell.command.Command;
+import org.apache.geronimo.gshell.console.completer.MuxCompleter;
+import org.apache.geronimo.gshell.console.completer.StringsCompleter;
 import org.apache.geronimo.gshell.event.Event;
 import org.apache.geronimo.gshell.event.EventListener;
 import org.apache.geronimo.gshell.event.EventManager;
@@ -31,16 +36,19 @@
 import org.springframework.beans.factory.annotation.Autowired;
 
 import javax.annotation.PostConstruct;
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
- * {@link Completer} for commands.
+ * {@link Completor} for commands, including support for command-specific sub-completion.
  *
  * @version $Rev$ $Date$
  */
 public class CommandsCompleter
-    implements Completer
+    implements Completor
 {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
@@ -50,31 +58,77 @@
     @Autowired
     private CommandRegistry commandRegistry;
 
+    private final Map<String,Completor> completors = new HashMap<String,Completor>();
+
+    private final MuxCompleter delegate = new MuxCompleter();
+
     @PostConstruct
-    public void init() {
+    public void init() throws Exception {
         log.debug("Initializing");
 
-        // Populate the initial list of command names
+        // Populate the initial list of completers from the currently registered commands
         Collection<String> names = commandRegistry.getCommandNames();
-        // TODO:
+        for (String name : names) {
+            Command command = commandRegistry.getCommand(name);
+            addCompleter(name, command);
+        }
 
         // Register for updates to command registrations
         eventManager.addListener(new EventListener() {
             public void onEvent(final Event event) throws Exception {
                 if (event instanceof CommandRegisteredEvent) {
                     CommandRegisteredEvent targetEvent = (CommandRegisteredEvent)event;
-                    // TODO:
+                    addCompleter(targetEvent.getName(), targetEvent.getCommand());
                 }
                 else if (event instanceof CommandRemovedEvent) {
                     CommandRemovedEvent targetEvent = (CommandRemovedEvent)event;
-                    // TODO:
+                    removeCompleter(targetEvent.getName());
                 }
             }
         });
     }
 
+    private void addCompleter(final String name, final Command command) {
+        assert name != null;
+        assert command != null;
+
+        List<Completor> children = new ArrayList<Completor>();
+
+        // Attach completion for the command name
+        children.add(new StringsCompleter(new String[] { name }));
+
+        // Then attach any command specific completers
+        Collection<Completor> commandCompleters = command.getCompleter().createCompletors();
+        if (commandCompleters != null) {
+            for (Completor completer : commandCompleters) {
+                if (completer != null) {
+                    children.add(completer);
+                }
+                else {
+                    children.add(new NullCompletor());
+                }
+            }
+        }
+        else {
+            children.add(new NullCompletor());
+        }
+
+        // Setup the root completer for the command
+        Completor root = new ArgumentCompletor(children);
+
+        // Track and attach
+        completors.put(name, root);
+        delegate.getCompleters().add(root);
+    }
+
+    private void removeCompleter(final String name) {
+        assert name != null;
+
+        Completor completer = completors.remove(name);
+        delegate.getCompleters().remove(completer);
+    }
+    
     public int complete(final String buffer, final int cursor, final List candidates) {
-        // TODO:
-        return -1;
+        return delegate.complete(buffer, cursor, candidates);
     }
 }
\ No newline at end of file

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=699716&r1=699715&r2=699716&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
Sat Sep 27 11:50:23 2008
@@ -41,11 +41,17 @@
 
     <bean id="shellInfo" class="org.apache.geronimo.gshell.wisdom.shell.ShellInfoImpl"/>
 
+    <bean id="commandNameCompleter" class="org.apache.geronimo.gshell.wisdom.shell.completer.CommandNameCompleter"
scope="prototype"/>
+
+    <bean id="commandsCompleter" class="org.apache.geronimo.gshell.wisdom.shell.completer.CommandsCompleter"
scope="prototype"/>
+
+    <bean id="aliasesCompleter" class="org.apache.geronimo.gshell.wisdom.shell.completer.AliasesCompleter"
scope="prototype"/>
+
     <bean id="shell" class="org.apache.geronimo.gshell.wisdom.shell.ShellImpl">
         <property name="completers">
             <list>
-                <bean class="org.apache.geronimo.gshell.wisdom.shell.completer.CommandNameCompleter"/>
-                <bean class="org.apache.geronimo.gshell.wisdom.shell.completer.AliasNameCompleter"/>
+                <ref bean="commandsCompleter"/>
+                <ref bean="aliasesCompleter"/>
             </list>
         </property>
     </bean>



Mime
View raw message