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

svn commit: r702842 - /geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandSupport.java

Author: jdillon
Date: Wed Oct  8 05:32:48 2008
New Revision: 702842

URL: http://svn.apache.org/viewvc?rev=702842&view=rev
Log:
Add generic support for ResultNotification

Modified:
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandSupport.java

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandSupport.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandSupport.java?rev=702842&r1=702841&r2=702842&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandSupport.java (original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandSupport.java Wed Oct  8 05:32:48 2008
@@ -34,6 +34,7 @@
 import org.apache.geronimo.gshell.notification.Notification;
 import org.apache.geronimo.gshell.notification.FailureNotification;
 import org.apache.geronimo.gshell.notification.SuccessNotification;
+import org.apache.geronimo.gshell.notification.ResultNotification;
 import org.apache.geronimo.gshell.shell.ShellContext;
 import org.apache.geronimo.gshell.spring.BeanContainer;
 import org.apache.geronimo.gshell.spring.BeanContainerAware;
@@ -304,14 +305,19 @@
 
             io.error(n.getMessage());
 
-            result = new CommandResult.ValueResult(CommandAction.Result.FAILURE);
+            result = new CommandResult.ValueResult(n.getResult());
         }
         catch (final SuccessNotification n) {
             log.trace("Command notified SUCCESS result: " + n, n);
 
             io.verbose(n.getMessage());
 
-            result = new CommandResult.ValueResult(CommandAction.Result.SUCCESS);
+            result = new CommandResult.ValueResult(n.getResult());
+        }
+        catch (final ResultNotification n) {
+            log.trace("Command notified result: " + n, n);
+
+            result = new CommandResult.ValueResult(n.getResult());
         }
         catch (final Notification n) {
             log.trace("Notified: " + n, n);