geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r726055 - in /geronimo/gshell/trunk: gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/ gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/completer/ gshell-wisdom/gshell-wisdom-core/src/ma...
Date Fri, 12 Dec 2008 15:44:17 GMT
Author: jdillon
Date: Fri Dec 12 07:44:16 2008
New Revision: 726055

URL: http://svn.apache.org/viewvc?rev=726055&view=rev
Log:
Remove dependency on Application* stuff

Modified:
    geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/FileSystemAccessImpl.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/completer/VariableNameCompleter.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/gshell/components.xml

Modified: geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/FileSystemAccessImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/FileSystemAccessImpl.java?rev=726055&r1=726054&r2=726055&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/FileSystemAccessImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-vfs/src/main/java/org/apache/geronimo/gshell/vfs/FileSystemAccessImpl.java
Fri Dec 12 07:44:16 2008
@@ -24,8 +24,8 @@
 import org.apache.commons.vfs.FileSystemManager;
 import org.apache.commons.vfs.provider.DelegateFileObject;
 import org.apache.commons.vfs.provider.local.LocalFile;
-import org.apache.geronimo.gshell.application.ApplicationManager;
 import org.apache.geronimo.gshell.command.Variables;
+import org.apache.geronimo.gshell.shell.ShellContextHolder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -42,13 +42,9 @@
 {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    private final ApplicationManager applicationManager;
-
     private final FileSystemManager fileSystemManager;
 
-    public FileSystemAccessImpl(final ApplicationManager applicationManager, final FileSystemManager
fileSystemManager) {
-        assert applicationManager != null;
-        this.applicationManager = applicationManager;
+    public FileSystemAccessImpl(final FileSystemManager fileSystemManager) {
         assert fileSystemManager != null;
         this.fileSystemManager = fileSystemManager;
     }
@@ -89,7 +85,7 @@
     public FileObject getCurrentDirectory() throws FileSystemException {
         log.trace("Resolving CWD from application variables");
 
-        return getCurrentDirectory(applicationManager.getApplication().getVariables());
+        return getCurrentDirectory(ShellContextHolder.get().getVariables());
     }
 
     public void setCurrentDirectory(final Variables vars, final FileObject dir) throws FileSystemException
{
@@ -114,7 +110,7 @@
 
         log.trace("Setting CWD to application variables");
 
-        setCurrentDirectory(applicationManager.getApplication().getVariables(), dir);
+        setCurrentDirectory(ShellContextHolder.get().getVariables(), dir);
     }
 
     public FileObject resolveFile(final FileObject baseFile, final String name) throws FileSystemException
{

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/completer/VariableNameCompleter.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/completer/VariableNameCompleter.java?rev=726055&r1=726054&r2=726055&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/completer/VariableNameCompleter.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/completer/VariableNameCompleter.java
Fri Dec 12 07:44:16 2008
@@ -21,9 +21,9 @@
 
 import jline.Completor;
 import org.apache.geronimo.gshell.application.Application;
-import org.apache.geronimo.gshell.application.ApplicationManager;
 import org.apache.geronimo.gshell.command.Variables;
 import org.apache.geronimo.gshell.console.completer.StringsCompleter;
+import org.apache.geronimo.gshell.shell.ShellContextHolder;
 
 import java.util.Collection;
 import java.util.Iterator;
@@ -37,15 +37,8 @@
 public class VariableNameCompleter
     implements Completor
 {
-    private final ApplicationManager applicationManager;
-
-    public VariableNameCompleter(final ApplicationManager applicationManager) {
-        assert applicationManager != null;
-        this.applicationManager = applicationManager;
-    }
-
     public int complete(final String buffer, final int cursor, final List candidates) {
-        Variables vars = applicationManager.getApplication().getVariables();
+        Variables vars = ShellContextHolder.get().getVariables();
 
         // There are no events for variables muck, so each time we have to rebuild the list.
         StringsCompleter delegate = new StringsCompleter();

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/gshell/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/gshell/components.xml?rev=726055&r1=726054&r2=726055&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/gshell/components.xml
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/gshell/components.xml
Fri Dec 12 07:44:16 2008
@@ -93,7 +93,6 @@
     </bean>
 
     <bean id="fileSystemAccess" class="org.apache.geronimo.gshell.vfs.FileSystemAccessImpl"
lazy-init="true">
-        <constructor-arg ref="applicationManager"/>
         <constructor-arg ref="fileSystemManager"/>
     </bean>
 
@@ -220,9 +219,7 @@
         <constructor-arg ref="commandRegistry"/>
     </bean>
 
-    <bean id="variableNameCompleter" class="org.apache.geronimo.gshell.wisdom.completer.VariableNameCompleter"
lazy-init="true">
-        <constructor-arg ref="applicationManager"/>
-    </bean>
+    <bean id="variableNameCompleter" class="org.apache.geronimo.gshell.wisdom.completer.VariableNameCompleter"
lazy-init="true"/>
 
     <bean class="org.apache.geronimo.gshell.vfs.provider.meta.data.support.MetaDataInstaller">
         <constructor-arg ref="metaDataRegistry"/>



Mime
View raw message