geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r697487 - in /geronimo/gshell/trunk: gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/ gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/ gshell-remote/gshell...
Date Sun, 21 Sep 2008 12:37:42 GMT
Author: jdillon
Date: Sun Sep 21 05:37:42 2008
New Revision: 697487

URL: http://svn.apache.org/viewvc?rev=697487&view=rev
Log:
Changed FaultResult to FailureResult
Added ServerSessionContext.close() moved clean up muck to it
Sending more meaningful responses for open and close shell

Modified:
    geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/ExecuteCommand.java
    geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshClient.java
    geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/CloseShellMessage.java
    geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/ExecuteMessage.java
    geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/OpenShellMessage.java
    geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/CloseShellHandler.java
    geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ExecuteHandler.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/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseService.java

Modified: geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/ExecuteCommand.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/ExecuteCommand.java?rev=697487&r1=697486&r2=697487&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/ExecuteCommand.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-optional/src/main/java/org/apache/geronimo/gshell/commands/optional/ExecuteCommand.java
Sun Sep 21 05:37:42 2008
@@ -50,7 +50,7 @@
         IO io = context.getIo();
 
         //
-        // FIXME:
+        // FIXME: Seems we are missing the builder here... oops
         //
         
         assert builder != null;

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshClient.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshClient.java?rev=697487&r1=697486&r2=697487&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshClient.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshClient.java
Sun Sep 21 05:37:42 2008
@@ -186,11 +186,11 @@
         }
 
         // Handle result faults
-        if (result instanceof ExecuteMessage.FaultResult) {
-            ExecuteMessage.FaultResult fault = (ExecuteMessage.FaultResult)result;
+        if (result instanceof ExecuteMessage.FailureResult) {
+            ExecuteMessage.FailureResult failure = (ExecuteMessage.FailureResult)result;
 
             //noinspection ThrowableResultOfMethodCallIgnored
-            throw new RemoteExecuteException(fault.getCause());
+            throw new RemoteExecuteException(failure.getCause());
         }
 
         Object rv = result.getResult();

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/CloseShellMessage.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/CloseShellMessage.java?rev=697487&r1=697486&r2=697487&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/CloseShellMessage.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/CloseShellMessage.java
Sun Sep 21 05:37:42 2008
@@ -28,4 +28,13 @@
     extends RshMessage
 {
     public CloseShellMessage() {}
+
+    /**
+     * Server to client message when remote-shell has been closed.
+     */
+    public static class Result
+        extends RshMessage
+    {
+        // Empty
+    }
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/ExecuteMessage.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/ExecuteMessage.java?rev=697487&r1=697486&r2=697487&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/ExecuteMessage.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/ExecuteMessage.java
Sun Sep 21 05:37:42 2008
@@ -126,10 +126,10 @@
     /**
      * Server to client message to pase a failure.
      */
-    public static class FaultResult
+    public static class FailureResult
         extends Result
     {
-        public FaultResult(final Throwable cause) {
+        public FailureResult(final Throwable cause) {
             super(cause);
         }
 

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/OpenShellMessage.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/OpenShellMessage.java?rev=697487&r1=697486&r2=697487&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/OpenShellMessage.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/OpenShellMessage.java
Sun Sep 21 05:37:42 2008
@@ -28,4 +28,13 @@
     extends RshMessage
 {
     public OpenShellMessage() {}
+
+    /**
+     * Server to client message when remote-shell has been opened.
+     */
+    public static class Result
+        extends RshMessage
+    {
+        // Empty
+    }
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/CloseShellHandler.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/CloseShellHandler.java?rev=697487&r1=697486&r2=697487&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/CloseShellHandler.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/CloseShellHandler.java
Sun Sep 21 05:37:42 2008
@@ -20,7 +20,6 @@
 package org.apache.geronimo.gshell.remote.server.handler;
 
 import org.apache.geronimo.gshell.remote.message.CloseShellMessage;
-import org.apache.geronimo.gshell.remote.message.EchoMessage;
 import org.apache.geronimo.gshell.whisper.transport.Session;
 
 /**
@@ -40,20 +39,9 @@
         assert context != null;
         assert message != null;
 
-        context.shell.close();
-        context.shell = null;
+        context.close();
 
-        context.container.stop();
-        context.container.close();
-        context.container = null;
-
-        // context.io = null;
-
-        //
-        // TODO: Send a meaningful response
-        //
-
-        EchoMessage reply = new EchoMessage("CLOSE SHELL SUCCESS");
+        CloseShellMessage.Result reply = new CloseShellMessage.Result();
         reply.setCorrelationId(message.getId());
         session.send(reply);
     }

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ExecuteHandler.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/ExecuteHandler.java?rev=697487&r1=697486&r2=697487&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ExecuteHandler.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ExecuteHandler.java
Sun Sep 21 05:37:42 2008
@@ -55,9 +55,9 @@
             reply = new ExecuteMessage.NotificationResult(n);
         }
         catch (Throwable t) {
-            log.debug("Fault: " + t);
+            log.debug("Failure: " + t);
 
-            reply = new ExecuteMessage.FaultResult(t);
+            reply = new ExecuteMessage.FailureResult(t);
         }
 
         reply.setCorrelationId(message.getId());

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=697487&r1=697486&r2=697487&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
Sun Sep 21 05:37:42 2008
@@ -61,17 +61,10 @@
         // Setup the I/O context (w/o auto-flushing)
         context.io = new RemoteIO(session);
 
-        // FIXME:
-        // context.variables =
-        
         // Create a new shell instance
         context.shell = context.container.getBean("remoteShell", RemoteShell.class);
-
-        //
-        // TODO: Send a meaningful response
-        //
-
-        EchoMessage reply = new EchoMessage("OPEN SHELL SUCCESS");
+        
+        OpenShellMessage.Result reply = new OpenShellMessage.Result();
         reply.setCorrelationId(message.getId());
         session.send(reply);
     }

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=697487&r1=697486&r2=697487&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
Sun Sep 21 05:37:42 2008
@@ -63,7 +63,18 @@
 
     public RemoteIO io;
 
-    // public RemoteVariables variables;
-
     public RemoteShell shell;
+
+    public void close() {
+        shell.close();
+        shell = null;
+
+        container.stop();
+        container.close();
+        container = null;
+
+        io = null;
+        pk = null;
+        identity = null;
+    }
 }

Modified: geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseService.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseService.java?rev=697487&r1=697486&r2=697487&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseService.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseService.java
Sun Sep 21 05:37:42 2008
@@ -173,7 +173,7 @@
         log.debug("Configure: {}", chain);
 
         //
-        // HACK: For right now just add a few hard codded to test with
+        // HACK: For right now just add a few hard codded to test with, need to make all
this spring configured
         //
 
         chain.addLast(SessionBindingFilter.class.getSimpleName(), new SessionBindingFilter());



Mime
View raw message