geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r669893 [1/2] - in /geronimo/gshell/trunk: gshell-api/src/main/java/org/apache/geronimo/gshell/command/ gshell-api/src/main/java/org/apache/geronimo/gshell/commandline/ gshell-api/src/main/java/org/apache/geronimo/gshell/notification/ gshel...
Date Fri, 20 Jun 2008 13:43:31 GMT
Author: jdillon
Date: Fri Jun 20 06:43:30 2008
New Revision: 669893

URL: http://svn.apache.org/viewvc?rev=669893&view=rev
Log:
Renamed Environment to ShellContext
Introduced CommandResult to provide details about the execution results of a CommandAction

Added:
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandResult.java
      - copied, changed from r669873, geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/ShellContext.java   (contents, props changed)
      - copied, changed from r669867, geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/Environment.java
    geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultShellContext.java   (contents, props changed)
      - copied, changed from r669867, geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultEnvironment.java
    geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/proxy/RemoteShellContextProxy.java   (contents, props changed)
      - copied, changed from r669867, geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/proxy/RemoteEnvironmentProxy.java
Removed:
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/Environment.java
    geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultEnvironment.java
    geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/proxy/RemoteEnvironmentProxy.java
Modified:
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandAction.java
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandFactory.java
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Variables.java
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineBuilder.java
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineExecutor.java
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/notification/ErrorNotification.java
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/notification/ExitNotification.java
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/notification/Notification.java
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/Shell.java
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/ShellFactory.java
    geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/ShellInfo.java
    geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/ApplicationConfiguration.java
    geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/ApplicationContext.java
    geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultApplicationManager.java
    geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/builder/ShellBuilder.java
    geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommand.java
    geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandLineBuilder.java
    geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandLineExecutor.java
    geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultShell.java
    geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/ExecutingVisitor.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
    geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/OpenShellHandler.java
    geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerSessionContext.java
    geronimo/gshell/trunk/src/uml/GShell.mdxml

Modified: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java (original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java Fri Jun 20 06:43:30 2008
@@ -26,13 +26,39 @@
  */
 public interface Command
 {
+    /**
+     * Returns the configured identifier of the command.
+     *
+     * @return  The command identifier; never null;
+     */
     String getId();
 
+    /**
+     * Returns the action of the command.
+     *
+     * @return  The command action; never null;
+     */
     CommandAction getAction();
 
+    /**
+     * Returns the documenter for the command.
+     *
+     * @return  The command documenter; never null;
+     */
     CommandDocumenter getDocumenter();
 
+    /**
+     * Returns the completer for the command.
+     *
+     * @return  The command completer; never null;
+     */
     CommandCompleter getCompleter();
 
-    Object execute(CommandContext context) throws Exception;
+    /**
+     * Execute the command action.
+     *
+     * @param context   The execution context.
+     * @return          The result of the action execution.
+     */
+    CommandResult execute(CommandContext context);
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandAction.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandAction.java (original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandAction.java Fri Jun 20 06:43:30 2008
@@ -19,6 +19,8 @@
 
 package org.apache.geronimo.gshell.command;
 
+import org.apache.geronimo.gshell.notification.Notification;
+
 /**
  * Provides the user-action for a command.
  *
@@ -26,7 +28,16 @@
  */
 public interface CommandAction
 {
-    Object execute(CommandContext context) throws Exception;
+    /**
+     * Execute the command action.
+     *
+     * @param context   The execution context of the command.
+     * @return          The result of the command execution.
+     *
+     * @throws Exception    Command execution failed.
+     * @throws Notification Inform the shell of some non-exception exit state.
+     */
+    Object execute(CommandContext context) throws Notification, Exception;
 
     /**
      * Enumeration for the basic return types of a command execution.

Modified: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandFactory.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandFactory.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandFactory.java (original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandFactory.java Fri Jun 20 06:43:30 2008
@@ -26,5 +26,13 @@
  */
 public interface CommandFactory
 {
+    /**
+     * Create a command instance for the given identifier.
+     *
+     * @param id    The identifier of the command to create.
+     * @return      A new command instance; never null.
+     *
+     * @throws Exception    Failed to create command instance.
+     */
     Command create(String id) throws Exception;
 }
\ No newline at end of file

Copied: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandResult.java (from r669873, geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandResult.java?p2=geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandResult.java&p1=geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java&r1=669873&r2=669893&rev=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Command.java (original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/CommandResult.java Fri Jun 20 06:43:30 2008
@@ -19,20 +19,96 @@
 
 package org.apache.geronimo.gshell.command;
 
+import org.apache.geronimo.gshell.notification.Notification;
+import org.apache.geronimo.gshell.yarn.ReflectionToStringBuilder;
+import org.apache.geronimo.gshell.yarn.ToStringStyle;
+
 /**
- * Containment for an installed command and its related components.
+ * Provides the result of a command execution.
  *
  * @version $Rev$ $Date$
  */
-public interface Command
+public class CommandResult
 {
-    String getId();
-
-    CommandAction getAction();
+    private final Object value;
 
-    CommandDocumenter getDocumenter();
+    // TODO: Change this to Throwable, requires some interface updates
+    private final Exception failure;
 
-    CommandCompleter getCompleter();
+    private final Notification notification;
 
-    Object execute(CommandContext context) throws Exception;
+    private CommandResult(final Object value, final Exception failure, final Notification notification) {
+        this.value = value;
+        this.failure = failure;
+        this.notification = notification;
+    }
+
+    public CommandResult(final Object value) {
+        this(value, null, null);
+    }
+
+    public CommandResult(final Exception failure) {
+        this(null, failure, null);
+
+        assert failure != null;
+    }
+
+    public CommandResult(final Notification notification) {
+        this(null, null, notification);
+
+        assert notification != null;
+    }
+
+    /**
+     * The result value of a command execution.
+     *
+     * @return  Command execution result value.
+     */
+    public Object getValue() {
+        return value;
+    }
+
+    /**
+     * True if the command failed with an exception.
+     *
+     * @return  True if the command failed with an exception.
+     *
+     * @see #getFailure
+     */
+    public boolean hasFailed() {
+        return failure != null;
+    }
+
+    /**
+     * Returns the command failure cause.
+     *
+     * @return  The command failure cause; or null if there was no failure.
+     */
+    public Exception getFailure() {
+        return failure;
+    }
+
+    /**
+     * True if the command exited with a notification.
+     *
+     * @return  True if the command exited with a notification.
+     *
+     * @see #getNotification
+     */
+    public boolean hasNotified() {
+        return notification != null;
+    }
+
+    /**
+     * Returns the command notification.
+     *
+     * @return  The command notification; or null if there was no notification.
+     */
+    public Notification getNotification() {
+        return notification;
+    }
+
+    public String toString() {
+        return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
+    }
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Variables.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Variables.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Variables.java (original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/command/Variables.java Fri Jun 20 06:43:30 2008
@@ -33,6 +33,7 @@
      *
      * @param name  The name of the variable to set.
      * @param value The value of the variable.
+     * 
      * @throws ImmutableVariableException   The variable is immutable.
      */
     void set(String name, Object value) throws ImmutableVariableException;
@@ -43,6 +44,7 @@
      * @param name      The name of the variable to set.
      * @param value     The value of the variable.
      * @param mutable   False to make the variable immutable.
+     *
      * @throws ImmutableVariableException   The variable is immutable.
      */
     void set(String name, Object value, boolean mutable) throws ImmutableVariableException;

Modified: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineBuilder.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineBuilder.java (original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineBuilder.java Fri Jun 20 06:43:30 2008
@@ -26,5 +26,13 @@
  */
 public interface CommandLineBuilder
 {
-    CommandLine create(final String commandLine) throws Exception;
+    /**
+     * Build a command-line from the given input string.
+     *
+     * @param input Command-line to parse.
+     * @return      Parsed command-line.
+     *
+     * @throws Exception    Failed to construct command-line.
+     */
+    CommandLine create(final String input) throws Exception;
 }

Modified: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineExecutor.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineExecutor.java (original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/commandline/CommandLineExecutor.java Fri Jun 20 06:43:30 2008
@@ -28,21 +28,42 @@
 {
     /**
      * Execute a command-line, parsing out valid recognized syntax.
+     *
+     * @param line  Raw command-line to parse and execute.
+     * @return      Command execution result.
+     *
+     * @throws Exception    Command-line execution failed.
      */
     Object execute(String line) throws Exception;
 
     /**
      * Execute command name/path with the given arguments.
+     *
+     * @param command   Name of the command/path to execute.
+     * @param args      Command arguments.
+     * @return          Command execution result.
+     *
+     * @throws Exception    Command-line execution failed.
      */
     Object execute(String command, final Object[] args) throws Exception;
 
     /**
      * Execute a pre-processed command-line.
+     *
+     * @param args  Command arguments, first argument is expected to be the command/path to execute.
+     * @return      Command execution result.
+     *
+     * @throws Exception    Command-line execution failed.
      */
     Object execute(Object... args) throws Exception;
 
     /**
      * Execute a piped-command-line.
+     *
+     * @param commands  Command arguments.
+     * @return          Command execution result.
+     *
+     * @throws Exception    Command-line execution failed.
      */
     Object execute(Object[][] commands) throws Exception;
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/notification/ErrorNotification.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/notification/ErrorNotification.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/notification/ErrorNotification.java (original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/notification/ErrorNotification.java Fri Jun 20 06:43:30 2008
@@ -19,8 +19,6 @@
 
 package org.apache.geronimo.gshell.notification;
 
-import org.apache.geronimo.gshell.notification.Notification;
-
 /**
  * Thrown to indicate an error notification state.
  *

Modified: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/notification/ExitNotification.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/notification/ExitNotification.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/notification/ExitNotification.java (original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/notification/ExitNotification.java Fri Jun 20 06:43:30 2008
@@ -19,8 +19,6 @@
 
 package org.apache.geronimo.gshell.notification;
 
-import org.apache.geronimo.gshell.notification.Notification;
-
 /**
  * Thrown to indicate that the current shell should exit.
  *

Modified: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/notification/Notification.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/notification/Notification.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/notification/Notification.java (original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/notification/Notification.java Fri Jun 20 06:43:30 2008
@@ -22,6 +22,9 @@
 /**
  * Thrown to indicate a notification state.
  *
+ * <p>
+ * Extending from Error to prevent need to declare throwable.
+ *
  * @version $Rev$ $Date$
  */
 public abstract class Notification

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=669893&r1=669892&r2=669893&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 Fri Jun 20 06:43:30 2008
@@ -22,18 +22,40 @@
 import org.apache.geronimo.gshell.commandline.CommandLineExecutor;
 
 /**
- * This is the primary interface to executing commands.
+ * Provides access to execute commands.
  *
  * @version $Rev$ $Date$
  */
 public interface Shell
     extends CommandLineExecutor
 {
-    ShellInfo getShellInfo();
+    /**
+     * Get the runtime configuration details of the shell.
+     *
+     * @return The runtime configuration of the shell.
+     */
+    ShellInfo getInfo();
 
-    Environment getEnvironment();
+    /**
+     * Get the execution details of the shell.
+     *
+     * @return  The execution details of the shell.
+     */
+    ShellContext getContext();
 
+    /**
+     * Check if the shell can be run interactivly.
+     * 
+     * @return  True if the shell is interactive.
+     */
     boolean isInteractive();
-    
-    void run(Object... args) throws Exception;
+
+    /**
+     * Run the shell iteractivly.
+     *
+     * @param args  The initial commands to execute iteractivly.
+     * @throws Exception    Failed to execute commands.
+     * @throws UnsupportedOperationException    The shell does not support iteractive execution.
+     */
+    void run(Object... args) throws UnsupportedOperationException, Exception;
 }

Copied: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/ShellContext.java (from r669867, geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/Environment.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/ShellContext.java?p2=geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/ShellContext.java&p1=geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/Environment.java&r1=669867&r2=669893&rev=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/Environment.java (original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/ShellContext.java Fri Jun 20 06:43:30 2008
@@ -19,18 +19,16 @@
 
 package org.apache.geronimo.gshell.shell;
 
-import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.command.Variables;
+import org.apache.geronimo.gshell.io.IO;
 
 /**
- * Abstraction of the environment of a shell.
+ * Provides the execution context of a {@link Shell}.
  *
  * @version $Rev$ $Date$
  */
-public interface Environment
+public interface ShellContext
 {
-    // TODO: Rename to ShellContext
-    
     IO getIO();
 
     Variables getVariables();

Propchange: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/ShellContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Modified: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/ShellFactory.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/ShellFactory.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/ShellFactory.java (original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/ShellFactory.java Fri Jun 20 06:43:30 2008
@@ -20,11 +20,17 @@
 package org.apache.geronimo.gshell.shell;
 
 /**
- * ???
+ * Creates {@link Shell} instanes.
  *
  * @version $Rev$ $Date$
  */
 public interface ShellFactory
 {
+    /**
+     * Create a new shell instance.
+     *
+     * @return  A new shell instance.
+     * @throws Exception    Failed to create shell instance.
+     */
     Shell create() throws Exception;
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/ShellInfo.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/ShellInfo.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/ShellInfo.java (original)
+++ geronimo/gshell/trunk/gshell-api/src/main/java/org/apache/geronimo/gshell/shell/ShellInfo.java Fri Jun 20 06:43:30 2008
@@ -29,9 +29,24 @@
  */
 public interface ShellInfo
 {
+    /**
+     * Returns the home directory of the shell.
+     *
+     * @return  Shell home directory.
+     */
     File getHomeDir();
 
+    /**
+     * Returns the local IP address of the shell.
+     *
+     * @return  The local IP address of the shell.
+     */
     InetAddress getLocalHost();
 
+    /**
+     * Returns the name of the current user.
+     *
+     * @return  The current user name.
+     */
     String getUserName();
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/ApplicationConfiguration.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/ApplicationConfiguration.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/ApplicationConfiguration.java (original)
+++ geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/ApplicationConfiguration.java Fri Jun 20 06:43:30 2008
@@ -23,7 +23,7 @@
 import org.apache.geronimo.gshell.yarn.ToStringStyle;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.model.application.Application;
-import org.apache.geronimo.gshell.shell.Environment;
+import org.apache.geronimo.gshell.shell.ShellContext;
 
 /**
  * Container for application configuration.
@@ -34,7 +34,7 @@
 {
     private IO io;
 
-    private Environment environment;
+    private ShellContext context;
 
     private Application application;
 
@@ -53,20 +53,20 @@
         this.io = io;
     }
 
-    private Environment createEnvironment() {
-        return new DefaultEnvironment(getIo());
+    private ShellContext createEnvironment() {
+        return new DefaultShellContext(getIo());
     }
 
-    public Environment getEnvironment() {
-        if (environment == null) {
-            environment = createEnvironment();
+    public ShellContext getEnvironment() {
+        if (context == null) {
+            context = createEnvironment();
         }
 
-        return environment;
+        return context;
     }
 
-    public void setEnvironment(final Environment environment) {
-        this.environment = environment;
+    public void setEnvironment(final ShellContext context) {
+        this.context = context;
     }
 
     public Application getApplication() {

Modified: geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/ApplicationContext.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/ApplicationContext.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/ApplicationContext.java (original)
+++ geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/ApplicationContext.java Fri Jun 20 06:43:30 2008
@@ -21,7 +21,7 @@
 
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.model.application.Application;
-import org.apache.geronimo.gshell.shell.Environment;
+import org.apache.geronimo.gshell.shell.ShellContext;
 
 /**
  * Encapsulates the context for an application.
@@ -32,7 +32,7 @@
 {
     IO getIo();
 
-    Environment getEnvironment();
+    ShellContext getEnvironment();
 
     Application getApplication();
     

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=669893&r1=669892&r2=669893&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 Fri Jun 20 06:43:30 2008
@@ -32,7 +32,7 @@
 import org.apache.geronimo.gshell.plugin.PluginCollector;
 import org.apache.geronimo.gshell.plugin.PluginDiscoverer;
 import org.apache.geronimo.gshell.settings.SettingsManager;
-import org.apache.geronimo.gshell.shell.Environment;
+import org.apache.geronimo.gshell.shell.ShellContext;
 import org.apache.geronimo.gshell.shell.Shell;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
@@ -124,7 +124,7 @@
                 return config.getIo();
             }
 
-            public Environment getEnvironment() {
+            public ShellContext getEnvironment() {
                 return config.getEnvironment();
             }
 

Copied: geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultShellContext.java (from r669867, geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultEnvironment.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultShellContext.java?p2=geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultShellContext.java&p1=geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultEnvironment.java&r1=669867&r2=669893&rev=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultEnvironment.java (original)
+++ geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/application/DefaultShellContext.java Fri Jun 20 06:43:30 2008
@@ -22,21 +22,21 @@
 import org.apache.geronimo.gshell.command.Variables;
 import org.apache.geronimo.gshell.yarn.ReflectionToStringBuilder;
 import org.apache.geronimo.gshell.io.IO;
-import org.apache.geronimo.gshell.shell.Environment;
+import org.apache.geronimo.gshell.shell.ShellContext;
 
 /**
- * Default {@link Environment} implementation.
+ * Default {@link org.apache.geronimo.gshell.shell.ShellContext} implementation.
  *
  * @version $Rev$ $Date$
  */
-public class DefaultEnvironment
-    implements Environment
+public class DefaultShellContext
+    implements ShellContext
 {
     private final IO io;
 
     private final Variables vars;
 
-    public DefaultEnvironment(final IO io, final Variables vars) {
+    public DefaultShellContext(final IO io, final Variables vars) {
         assert io != null;
         assert vars != null;
 
@@ -46,7 +46,7 @@
         vars.set("env", System.getenv(), false);
     }
 
-    public DefaultEnvironment(final IO io) {
+    public DefaultShellContext(final IO io) {
         this(io, new DefaultVariables());
     }
 

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

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

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

Modified: geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/builder/ShellBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/builder/ShellBuilder.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/builder/ShellBuilder.java (original)
+++ geronimo/gshell/trunk/gshell-plugin/src/main/java/org/apache/geronimo/gshell/builder/ShellBuilder.java Fri Jun 20 06:43:30 2008
@@ -30,7 +30,7 @@
 import org.apache.geronimo.gshell.plexus.Slf4jLoggingManager;
 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.ShellContext;
 import org.apache.geronimo.gshell.shell.Shell;
 import org.apache.geronimo.gshell.shell.ShellFactory;
 import org.apache.geronimo.gshell.io.SystemOutputHijacker;
@@ -120,12 +120,12 @@
         applicationConfig.setIo(io);
     }
 
-    public Environment getEnvironment() {
+    public ShellContext getEnvironment() {
         return applicationConfig.getEnvironment();
     }
 
-    public void setEnvironment(final Environment environment) {
-        applicationConfig.setEnvironment(environment);
+    public void setEnvironment(final ShellContext context) {
+        applicationConfig.setEnvironment(context);
     }
 
     public Settings getSettings() {

Modified: geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommand.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommand.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommand.java (original)
+++ geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommand.java Fri Jun 20 06:43:30 2008
@@ -23,13 +23,15 @@
 import org.apache.geronimo.gshell.clp.Option;
 import org.apache.geronimo.gshell.clp.Printer;
 import org.apache.geronimo.gshell.clp.ProcessingException;
+import org.apache.geronimo.gshell.command.Command;
 import org.apache.geronimo.gshell.command.CommandAction;
+import org.apache.geronimo.gshell.command.CommandCompleter;
 import org.apache.geronimo.gshell.command.CommandContext;
-import org.apache.geronimo.gshell.command.CommandInfo;
-import org.apache.geronimo.gshell.command.Command;
 import org.apache.geronimo.gshell.command.CommandDocumenter;
-import org.apache.geronimo.gshell.command.CommandCompleter;
+import org.apache.geronimo.gshell.command.CommandInfo;
+import org.apache.geronimo.gshell.command.CommandResult;
 import org.apache.geronimo.gshell.io.IO;
+import org.apache.geronimo.gshell.notification.Notification;
 import org.apache.geronimo.gshell.plexus.GShellPlexusContainer;
 import org.apache.geronimo.gshell.util.Arguments;
 import org.codehaus.plexus.PlexusConstants;
@@ -108,8 +110,8 @@
             throw new RuntimeException(e);
         }
     }
-
-    public Object execute(final CommandContext context) throws Exception {
+    
+    public CommandResult execute(final CommandContext context) {
         assert context != null;
 
         log.trace("Executing; context={}");
@@ -117,19 +119,37 @@
         // Provide logging context for the command execution
         MDC.put("commandId", commandId);
 
-        Object result;
+        CommandResult result;
 
         try {
             CommandAction action = getAction();
-            
+
             // Process command line options/arguments, return if we have been asked to display --help
-            if (processArguments(context, action, context.getArguments())) {
-                return CommandAction.Result.SUCCESS;
+            try {
+                if (processArguments(context, action, context.getArguments())) {
+                    return new CommandResult(CommandAction.Result.SUCCESS);
+                }
+            }
+            catch (ProcessingException e) {
+                new CommandResult(e);
             }
 
-            result = action.execute(context);
+            try {
+                final Object value = action.execute(context);
+                log.trace("Result: {}", value);
+
+                result = new CommandResult(value);
+            }
+            catch (final Notification n) {
+                log.trace("Notified: {}, n");
 
-            log.trace("Result: {}", result);
+                result = new CommandResult(n);
+            }
+            catch (final Throwable t) {
+                log.trace("Caught: {}", t);
+
+                result = new CommandResult(t);
+            }
         }
         finally {
             MDC.remove("commandId");

Modified: geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandLineBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandLineBuilder.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandLineBuilder.java (original)
+++ geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandLineBuilder.java Fri Jun 20 06:43:30 2008
@@ -27,7 +27,7 @@
 import org.apache.geronimo.gshell.parser.ASTCommandLine;
 import org.apache.geronimo.gshell.parser.CommandLineParser;
 import org.apache.geronimo.gshell.parser.ParseException;
-import org.apache.geronimo.gshell.shell.Environment;
+import org.apache.geronimo.gshell.shell.ShellContext;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
@@ -100,7 +100,7 @@
             CommandLineExecutor executor = (CommandLineExecutor) container.lookup(CommandLineExecutor.class);
 
             assert applicationManager != null;
-            Environment env = applicationManager.getContext().getEnvironment();
+            ShellContext env = applicationManager.getContext().getEnvironment();
 
             final ExecutingVisitor visitor = new ExecutingVisitor(executor, env);
             final ASTCommandLine root = parse(commandLine);

Modified: geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandLineExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandLineExecutor.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandLineExecutor.java (original)
+++ geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultCommandLineExecutor.java Fri Jun 20 06:43:30 2008
@@ -27,6 +27,7 @@
 import org.apache.geronimo.gshell.command.Variables;
 import org.apache.geronimo.gshell.command.CommandFactory;
 import org.apache.geronimo.gshell.command.Command;
+import org.apache.geronimo.gshell.command.CommandResult;
 import org.apache.geronimo.gshell.commandline.CommandExecutionFailied;
 import org.apache.geronimo.gshell.commandline.CommandLine;
 import org.apache.geronimo.gshell.commandline.CommandLineBuilder;
@@ -40,7 +41,7 @@
 import org.apache.geronimo.gshell.model.layout.Node;
 import org.apache.geronimo.gshell.notification.ErrorNotification;
 import org.apache.geronimo.gshell.notification.Notification;
-import org.apache.geronimo.gshell.shell.Environment;
+import org.apache.geronimo.gshell.shell.ShellContext;
 import org.apache.geronimo.gshell.util.Arguments;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
@@ -82,7 +83,7 @@
     @Requirement
     private CommandLineBuilder commandLineBuilder;
 
-    private Environment env;
+    private ShellContext env;
 
     public DefaultCommandLineExecutor() {}
     
@@ -309,7 +310,7 @@
         // Hijack the system streams in the current thread's context
         SystemOutputHijacker.register(io.outputStream, io.errorStream);
 
-        Object result;
+        CommandResult result;
         try {
             result = command.execute(context);
 
@@ -326,7 +327,16 @@
             catch (Exception ignore) {}
         }
 
-        return result;
+        // Decode the command result
+        if (result.hasNotified()) {
+            throw result.getNotification();
+        }
+        else if (result.hasFailed()) {
+            throw result.getFailure();
+        }
+        else {
+            return result.getValue();
+        }
     }
 
     protected String findCommandId(final Node node) throws NotFoundException {

Modified: geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultShell.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultShell.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultShell.java (original)
+++ geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/DefaultShell.java Fri Jun 20 06:43:30 2008
@@ -32,7 +32,7 @@
 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.Environment;
+import org.apache.geronimo.gshell.shell.ShellContext;
 import org.apache.geronimo.gshell.shell.Shell;
 import org.apache.geronimo.gshell.shell.ShellInfo;
 import org.codehaus.plexus.component.annotations.Component;
@@ -71,7 +71,7 @@
     @Requirement
     private History history;
 
-    private Environment env;
+    private ShellContext shellContext;
 
     private IO io;
 
@@ -95,11 +95,11 @@
         this.history = history;
     }
 
-    public Environment getEnvironment() {
-        return env;
+    public ShellContext getContext() {
+        return shellContext;
     }
 
-    public ShellInfo getShellInfo() {
+    public ShellInfo getInfo() {
         return shellInfo;
     }
 
@@ -113,7 +113,7 @@
         // Dereference some bits from the applciation context
         ApplicationContext context = applicationManager.getContext();
         this.io = context.getIo();
-        this.env = context.getEnvironment();
+        this.shellContext = context.getEnvironment();
         this.branding = context.getApplication().getBranding();
         
         try {

Modified: geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/ExecutingVisitor.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/ExecutingVisitor.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/ExecutingVisitor.java (original)
+++ geronimo/gshell/trunk/gshell-rapture/src/main/java/org/apache/geronimo/gshell/rapture/ExecutingVisitor.java Fri Jun 20 06:43:30 2008
@@ -29,7 +29,7 @@
 import org.apache.geronimo.gshell.parser.ASTQuotedString;
 import org.apache.geronimo.gshell.parser.CommandLineParserVisitor;
 import org.apache.geronimo.gshell.parser.SimpleNode;
-import org.apache.geronimo.gshell.shell.Environment;
+import org.apache.geronimo.gshell.shell.ShellContext;
 import org.apache.geronimo.gshell.util.Arguments;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -47,13 +47,13 @@
 {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    private final Environment env;
+    private final ShellContext env;
     
     private final CommandLineExecutor executor;
 
     private final VariableInterpolator interp = new VariableInterpolator();
 
-    public ExecutingVisitor(final CommandLineExecutor executor, final Environment env) {
+    public ExecutingVisitor(final CommandLineExecutor executor, final ShellContext env) {
         assert executor != null;
         assert env != null;
 

Copied: geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/proxy/RemoteShellContextProxy.java (from r669867, geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/proxy/RemoteEnvironmentProxy.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/RemoteShellContextProxy.java?p2=geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/proxy/RemoteShellContextProxy.java&p1=geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/proxy/RemoteEnvironmentProxy.java&r1=669867&r2=669893&rev=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/proxy/RemoteEnvironmentProxy.java (original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/proxy/RemoteShellContextProxy.java Fri Jun 20 06:43:30 2008
@@ -22,19 +22,19 @@
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.command.Variables;
 import org.apache.geronimo.gshell.remote.client.RshClient;
-import org.apache.geronimo.gshell.shell.Environment;
+import org.apache.geronimo.gshell.shell.ShellContext;
 
 /**
  * ???
  *
  * @version $Rev$ $Date$
  */
-public class RemoteEnvironmentProxy
-    implements Environment
+public class RemoteShellContextProxy
+    implements ShellContext
 {
     private final RshClient client;
 
-    public RemoteEnvironmentProxy(final RshClient client) {
+    public RemoteShellContextProxy(final RshClient client) {
         assert client != null;
 
         this.client = client;

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/proxy/RemoteShellContextProxy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/proxy/RemoteShellContextProxy.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/proxy/RemoteShellContextProxy.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=669893&r1=669892&r2=669893&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 Fri Jun 20 06:43:30 2008
@@ -19,16 +19,16 @@
 
 package org.apache.geronimo.gshell.remote.client.proxy;
 
-import org.apache.geronimo.gshell.notification.ExitNotification;
 import org.apache.geronimo.gshell.ansi.Renderer;
 import org.apache.geronimo.gshell.console.Console;
 import org.apache.geronimo.gshell.console.JLineConsole;
 import org.apache.geronimo.gshell.io.IO;
+import org.apache.geronimo.gshell.notification.ExitNotification;
 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.ShellInfo;
 import org.apache.geronimo.gshell.shell.Shell;
+import org.apache.geronimo.gshell.shell.ShellContext;
+import org.apache.geronimo.gshell.shell.ShellInfo;
 import org.apache.geronimo.gshell.whisper.stream.StreamFeeder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -53,7 +53,7 @@
 
     private boolean opened;
 
-    private RemoteEnvironmentProxy env;
+    private RemoteShellContextProxy context;
 
     private RemoteShellInfoProxy shellInfo;
 
@@ -74,7 +74,7 @@
         client.openShell();
 
         // Setup other proxies
-        env = new RemoteEnvironmentProxy(client);
+        context = new RemoteShellContextProxy(client);
         shellInfo = new RemoteShellInfoProxy(client);
         history = new RemoteHistoryProxy(client);
 
@@ -89,13 +89,13 @@
         return true;
     }
 
-    public Environment getEnvironment() {
+    public ShellContext getContext() {
         ensureOpened();
 
-        return env;
+        return context;
     }
 
-    public ShellInfo getShellInfo() {
+    public ShellInfo getInfo() {
         ensureOpened();
 
         return shellInfo;

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=669893&r1=669892&r2=669893&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 Fri Jun 20 06:43:30 2008
@@ -21,7 +21,7 @@
 
 import org.apache.geronimo.gshell.commandline.CommandLineExecutor;
 import org.apache.geronimo.gshell.remote.RemoteShell;
-import org.apache.geronimo.gshell.shell.Environment;
+import org.apache.geronimo.gshell.shell.ShellContext;
 import org.apache.geronimo.gshell.shell.ShellInfo;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
@@ -47,17 +47,21 @@
 
     // FIXME: Pull this from some manager's context
     @Requirement
-    private Environment env;
+    private ShellContext context;
 
     private boolean opened = true;
 
     public DefaultRemoteShell() {
     }
 
-    public DefaultRemoteShell(final ShellInfo shellInfo, final CommandLineExecutor executor, final Environment env) {
+    public DefaultRemoteShell(final ShellInfo shellInfo, final CommandLineExecutor executor, final ShellContext context) {
+        assert shellInfo != null;
+        assert executor != null;
+        assert context != null;
+
         this.shellInfo = shellInfo;
         this.executor = executor;
-        this.env = env;
+        this.context = context;
     }
     
     private void ensureOpened() {
@@ -80,13 +84,13 @@
         return false;
     }
 
-    public Environment getEnvironment() {
+    public ShellContext getContext() {
         ensureOpened();
         
-        return env;
+        return context;
     }
 
-    public ShellInfo getShellInfo() {
+    public ShellInfo getInfo() {
         ensureOpened();
 
         return shellInfo;

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/OpenShellHandler.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/OpenShellHandler.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/OpenShellHandler.java (original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/OpenShellHandler.java Fri Jun 20 06:43:30 2008
@@ -19,7 +19,7 @@
 
 package org.apache.geronimo.gshell.remote.server.handler;
 
-import org.apache.geronimo.gshell.application.DefaultEnvironment;
+import org.apache.geronimo.gshell.application.DefaultShellContext;
 import org.apache.geronimo.gshell.remote.RemoteShell;
 import org.apache.geronimo.gshell.remote.message.EchoMessage;
 import org.apache.geronimo.gshell.remote.message.OpenShellMessage;
@@ -58,7 +58,7 @@
         // IOLookup.set(context.container, context.io);
 
         // Setup shell environemnt
-        context.env = new DefaultEnvironment(context.io);
+        context.env = new DefaultShellContext(context.io);
         // FIXME: Need to find out what to do here, w/o this lookup
         // EnvironmentLookup.set(context.container, context.env);
 

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerSessionContext.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerSessionContext.java?rev=669893&r1=669892&r2=669893&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerSessionContext.java (original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerSessionContext.java Fri Jun 20 06:43:30 2008
@@ -28,7 +28,7 @@
 import org.apache.geronimo.gshell.remote.jaas.UserPrincipal;
 import org.apache.geronimo.gshell.remote.server.RemoteIO;
 import org.apache.geronimo.gshell.remote.server.RemoteShellContainer;
-import org.apache.geronimo.gshell.shell.Environment;
+import org.apache.geronimo.gshell.shell.ShellContext;
 import org.apache.geronimo.gshell.whisper.util.SessionAttributeBinder;
 
 /**
@@ -64,7 +64,7 @@
 
     public RemoteIO io;
 
-    public Environment env;
+    public ShellContext env;
 
     public RemoteShell shell;
 }



Mime
View raw message