geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r662158 - in /geronimo/gshell/trunk: gshell-api/src/main/java/org/apache/geronimo/gshell/shell/ gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/ gshell-core/src/main/java/org/apache/geronimo/gshell/ gshell-plugin/src/main/java/org/a...
Date Sun, 01 Jun 2008 07:22:51 GMT
Author: jdillon
Date: Sun Jun  1 00:22:51 2008
New Revision: 662158

URL: http://svn.apache.org/viewvc?rev=662158&view=rev
Log:
Drop the InteractiveShell interface, merged into Shell for simplicity

Added:
    geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/ShellBuilder.java
  (contents, props changed)
      - copied, changed from r661968, geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/GShellBuilder.java
    geronimo/gshell/trunk/gshell-plugin/src/test/java/org/apache/geronimo/gshell/ShellBuilderTest.java
  (contents, props changed)
      - copied, changed from r661968, geronimo/gshell/trunk/gshell-plugin/src/test/java/org/apache/geronimo/gshell/GShellBuilderTest.java
Removed:
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/InteractiveShell.java
    geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/GShell.java
    geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/GShellBuilder.java
    geronimo/gshell/trunk/gshell-plugin/src/test/java/org/apache/geronimo/gshell/GShellBuilderTest.java
Modified:
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/Shell.java
    geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
    geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultShell.java
    geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/ApplicationManager.java
    geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java
    geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/proxy/RemoteShellProxy.java
    geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java

Modified: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/Shell.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/Shell.java?rev=662158&r1=662157&r2=662158&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/Shell.java
(original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/Shell.java
Sun Jun  1 00:22:51 2008
@@ -32,4 +32,8 @@
     ShellInfo getShellInfo();
 
     Environment getEnvironment();
+
+    boolean isInteractive();
+    
+    void run(Object... args) throws Exception;
 }

Modified: geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java?rev=662158&r1=662157&r2=662158&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
(original)
+++ geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
Sun Jun  1 00:22:51 2008
@@ -20,8 +20,8 @@
 package org.apache.geronimo.gshell.cli;
 
 import org.apache.geronimo.gshell.ExitNotification;
-import org.apache.geronimo.gshell.GShell;
-import org.apache.geronimo.gshell.GShellBuilder;
+import org.apache.geronimo.gshell.ShellBuilder;
+import org.apache.geronimo.gshell.shell.Shell;
 import org.apache.geronimo.gshell.ansi.ANSI;
 import org.apache.geronimo.gshell.application.ApplicationLocator;
 import org.apache.geronimo.gshell.clp.Argument;
@@ -205,7 +205,7 @@
         });
 
         try {
-            GShellBuilder builder = new GShellBuilder();
+            ShellBuilder builder = new ShellBuilder();
             builder.setClassWorld(classWorld);
             builder.setIo(io);
 
@@ -240,7 +240,7 @@
             }
 
             // Build the shell instance
-            GShell gshell = builder.build();
+            Shell gshell = builder.build();
 
             // clp gives us a list, but we need an array
             String[] _args = commandArgs.toArray(new String[commandArgs.size()]);

Modified: geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultShell.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultShell.java?rev=662158&r1=662157&r2=662158&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultShell.java
(original)
+++ geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultShell.java
Sun Jun  1 00:22:51 2008
@@ -31,7 +31,6 @@
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.model.application.Branding;
 import org.apache.geronimo.gshell.shell.Environment;
-import org.apache.geronimo.gshell.shell.InteractiveShell;
 import org.apache.geronimo.gshell.shell.Shell;
 import org.apache.geronimo.gshell.shell.ShellInfo;
 import org.codehaus.plexus.component.annotations.Component;
@@ -52,9 +51,9 @@
  *
  * @version $Rev$ $Date$
  */
-@Component(role=InteractiveShell.class, hint="default")
+@Component(role=Shell.class, hint="default")
 public class DefaultShell
-    implements InteractiveShell, Initializable
+    implements Shell, Initializable
 {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
@@ -102,6 +101,10 @@
         return shellInfo;
     }
 
+    public boolean isInteractive() {
+        return true;
+    }
+
     public void initialize() throws InitializationException {
         assert applicationManager != null;
         

Copied: geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/ShellBuilder.java
(from r661968, geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/GShellBuilder.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/ShellBuilder.java?p2=geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/ShellBuilder.java&p1=geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/GShellBuilder.java&r1=661968&r2=662158&rev=662158&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/GShellBuilder.java
(original)
+++ geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/ShellBuilder.java
Sun Jun  1 00:22:51 2008
@@ -31,6 +31,7 @@
 import org.apache.geronimo.gshell.settings.SettingsConfiguration;
 import org.apache.geronimo.gshell.settings.SettingsManager;
 import org.apache.geronimo.gshell.shell.Environment;
+import org.apache.geronimo.gshell.shell.Shell;
 import org.codehaus.plexus.ContainerConfiguration;
 import org.codehaus.plexus.DefaultContainerConfiguration;
 import org.codehaus.plexus.PlexusContainerException;
@@ -40,11 +41,11 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * Builds {@link GShell} instances.
+ * Builds {@link org.apache.geronimo.gshell.shell.Shell} instances.
  *
  * @version $Rev$ $Date$
  */
-public class GShellBuilder
+public class ShellBuilder
 {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
@@ -66,7 +67,7 @@
 
     private ArtifactManager artifactManager;
 
-    public GShellBuilder() {}
+    public ShellBuilder() {}
 
     private GShellPlexusContainer createContainer() throws PlexusContainerException {
         ContainerConfiguration config = new DefaultContainerConfiguration();
@@ -189,7 +190,7 @@
     // Building
     //
 
-    public GShell build() throws Exception {
+    public Shell build() throws Exception {
         log.debug("Building");
 
         // Initialize the container

Propchange: geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/ShellBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/ShellBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/ShellBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/ApplicationManager.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/ApplicationManager.java?rev=662158&r1=662157&r2=662158&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/ApplicationManager.java
(original)
+++ geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/ApplicationManager.java
Sun Jun  1 00:22:51 2008
@@ -19,7 +19,7 @@
 
 package org.apache.geronimo.gshell.application;
 
-import org.apache.geronimo.gshell.GShell;
+import org.apache.geronimo.gshell.shell.Shell;
 
 /**
  * ???
@@ -30,7 +30,7 @@
 {
     void configure(ApplicationConfiguration config) throws Exception;
 
-    GShell createShell() throws Exception;
+    Shell createShell() throws Exception;
 
     ApplicationContext getContext();
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java?rev=662158&r1=662157&r2=662158&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java
(original)
+++ geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java
Sun Jun  1 00:22:51 2008
@@ -19,7 +19,6 @@
 
 package org.apache.geronimo.gshell.application;
 
-import org.apache.geronimo.gshell.GShell;
 import org.apache.geronimo.gshell.settings.SettingsManager;
 import org.apache.geronimo.gshell.artifact.ArtifactManager;
 import org.apache.geronimo.gshell.io.IO;
@@ -34,8 +33,8 @@
 import org.apache.geronimo.gshell.plugin.CommandCollector;
 import org.apache.geronimo.gshell.plugin.CommandDiscoverer;
 import org.apache.geronimo.gshell.shell.Environment;
-import org.apache.geronimo.gshell.shell.InteractiveShell;
 import org.apache.geronimo.gshell.shell.ShellInfo;
+import org.apache.geronimo.gshell.shell.Shell;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
@@ -313,11 +312,11 @@
         return classPath;
     }
 
-    public GShell createShell() throws Exception {
+    public Shell createShell() throws Exception {
         // Make sure that we have a valid context
         getContext();
 
-        final InteractiveShell shell = container.lookupComponent(InteractiveShell.class);
+        final Shell shell = container.lookupComponent(Shell.class);
 
         log.debug("Created shell instance: {}", shell);
 
@@ -326,7 +325,7 @@
         //        or shall we use an aspect to handle this muck?
         //
         
-        GShell proxy = new GShell() {
+        Shell proxy = new Shell() {
             public void run(final Object... args) throws Exception {
                 shell.run(args);
             }
@@ -335,6 +334,10 @@
                 return shell.getShellInfo();
             }
 
+            public boolean isInteractive() {
+                return shell.isInteractive();
+            }
+
             public Environment getEnvironment() {
                 return shell.getEnvironment();
             }

Copied: geronimo/gshell/trunk/gshell-plugin/src/test/java/org/apache/geronimo/gshell/ShellBuilderTest.java
(from r661968, geronimo/gshell/trunk/gshell-plugin/src/test/java/org/apache/geronimo/gshell/GShellBuilderTest.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-plugin/src/test/java/org/apache/geronimo/gshell/ShellBuilderTest.java?p2=geronimo/gshell/trunk/gshell-plugin/src/test/java/org/apache/geronimo/gshell/ShellBuilderTest.java&p1=geronimo/gshell/trunk/gshell-plugin/src/test/java/org/apache/geronimo/gshell/GShellBuilderTest.java&r1=661968&r2=662158&rev=662158&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-plugin/src/test/java/org/apache/geronimo/gshell/GShellBuilderTest.java
(original)
+++ geronimo/gshell/trunk/gshell-plugin/src/test/java/org/apache/geronimo/gshell/ShellBuilderTest.java
Sun Jun  1 00:22:51 2008
@@ -28,17 +28,17 @@
 import java.net.URL;
 
 /**
- * Unit tests for the {@link GShellBuilder} class.
+ * Unit tests for the {@link ShellBuilder} class.
  *
  * @version $Rev$ $Date$
  */
-public class GShellBuilderTest
+public class ShellBuilderTest
     extends TestCase
 {
-    private GShellBuilder builder;
+    private ShellBuilder builder;
 
     protected void setUp() throws Exception {
-        builder = new GShellBuilder();
+        builder = new ShellBuilder();
     }
 
     protected void tearDown() throws Exception {

Propchange: geronimo/gshell/trunk/gshell-plugin/src/test/java/org/apache/geronimo/gshell/ShellBuilderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-plugin/src/test/java/org/apache/geronimo/gshell/ShellBuilderTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-plugin/src/test/java/org/apache/geronimo/gshell/ShellBuilderTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/proxy/RemoteShellProxy.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/proxy/RemoteShellProxy.java?rev=662158&r1=662157&r2=662158&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/proxy/RemoteShellProxy.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/proxy/RemoteShellProxy.java
Sun Jun  1 00:22:51 2008
@@ -27,8 +27,8 @@
 import org.apache.geronimo.gshell.remote.RemoteShell;
 import org.apache.geronimo.gshell.remote.client.RshClient;
 import org.apache.geronimo.gshell.shell.Environment;
-import org.apache.geronimo.gshell.shell.InteractiveShell;
 import org.apache.geronimo.gshell.shell.ShellInfo;
+import org.apache.geronimo.gshell.shell.Shell;
 import org.apache.geronimo.gshell.whisper.stream.StreamFeeder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -41,7 +41,7 @@
  * @version $Rev$ $Date$
  */
 public class RemoteShellProxy
-    implements RemoteShell, InteractiveShell
+    implements RemoteShell, Shell
 {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
@@ -85,6 +85,10 @@
         opened = true;
     }
 
+    public boolean isInteractive() {
+        return true;
+    }
+
     public Environment getEnvironment() {
         ensureOpened();
 

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java?rev=662158&r1=662157&r2=662158&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java
Sun Jun  1 00:22:51 2008
@@ -76,6 +76,10 @@
         opened = false;
     }
 
+    public boolean isInteractive() {
+        return false;
+    }
+
     public Environment getEnvironment() {
         ensureOpened();
         
@@ -110,12 +114,16 @@
         return executor.execute(path, args);
     }
 
-    public Object execute(Object[][] commands) throws Exception {
+    public Object execute(final Object[][] commands) throws Exception {
         ensureOpened();
 
         return executor.execute(commands);
     }
 
+    public void run(final Object... args) throws Exception {
+        throw new UnsupportedOperationException();
+    }
+
     //
     // TODO: Hookup profile script processing bits
     //



Mime
View raw message