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 2007/09/22 08:03:59 UTC

svn commit: r578377 - in /geronimo/sandbox/gshell/trunk/gshell-remote: gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/ gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/security/ gshell-remote-common/src...

Author: jdillon
Date: Fri Sep 21 23:03:58 2007
New Revision: 578377

URL: http://svn.apache.org/viewvc?rev=578377&view=rev
Log:
Removed old executor muck, we don't need that crap anymore
Tidy and clean, blah, blah

Modified:
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/MessageSupport.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/security/SecurityFilter.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/stream/StreamFeeder.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/Transport.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/TransportCommon.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerMessageVisitor.java

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/MessageSupport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/MessageSupport.java?rev=578377&r1=578376&r2=578377&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/MessageSupport.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/message/MessageSupport.java Fri Sep 21 23:03:58 2007
@@ -221,7 +221,7 @@
         }
 
         public String toString() {
-            return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
+            return String.valueOf(value);
         }
     }
 
@@ -269,7 +269,7 @@
         }
 
         public String toString() {
-            return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
+            return String.valueOf(value);
         }
     }
 }

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/security/SecurityFilter.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/security/SecurityFilter.java?rev=578377&r1=578376&r2=578377&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/security/SecurityFilter.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/security/SecurityFilter.java Fri Sep 21 23:03:58 2007
@@ -164,9 +164,7 @@
             // And then send back our public key to the remote client
             msg.reply(new HandShakeMessage.Result(crypto.getPublicKey()));
 
-            //
-            // NOTE: Don't wait on the write future
-            //
+            // Don't wait on the write future
 
             // Schedule a task to timeout the login process
             scheduleTimeout(session);
@@ -202,9 +200,7 @@
 
                 msg.reply(new LoginMessage.Result());
 
-                //
-                // NOTE: Don't wait on the write future
-                //
+                // Don't wait on the write future
             }
         }
     }

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/stream/StreamFeeder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/stream/StreamFeeder.java?rev=578377&r1=578376&r2=578377&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/stream/StreamFeeder.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/stream/StreamFeeder.java Fri Sep 21 23:03:58 2007
@@ -27,7 +27,7 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * Feeds data from and input stream to an output stream.
+ * Feeds data from an input stream to an output stream.
  *
  * @version $Rev$ $Date$
  */

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/Transport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/Transport.java?rev=578377&r1=578376&r2=578377&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/Transport.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/Transport.java Fri Sep 21 23:03:58 2007
@@ -21,8 +21,8 @@
 
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.util.concurrent.TimeUnit;
 import java.net.URI;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.geronimo.gshell.remote.message.Message;
 import org.apache.mina.common.WriteFuture;

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/TransportCommon.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/TransportCommon.java?rev=578377&r1=578376&r2=578377&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/TransportCommon.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/transport/TransportCommon.java Fri Sep 21 23:03:58 2007
@@ -53,10 +53,6 @@
 {
     protected final Logger log = LoggerFactory.getLogger(getClass());
 
-    // protected final ExecutorService executor;
-
-    // protected final ScheduledExecutorService scheduler;
-
     // private StatCollector statCollector;
 
     private IoService service;
@@ -64,16 +60,6 @@
     protected TransportCommon() {
         ByteBuffer.setUseDirectBuffers(false);
         ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
-        
-        //
-        // TODO: Add custom thread factory ?
-        //
-
-        // executor = new ThreadPoolExecutor(1, 16, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
-
-        // executor = Executors.newCachedThreadPool();
-
-        // scheduler = Executors.newScheduledThreadPool(Runtime.getRuntime().availableProcessors() + 1);
     }
 
     public String toString() {
@@ -152,10 +138,6 @@
 
     public void close() {
         // statCollector.stop();
-
-        // executor.shutdownNow();
-
-        // scheduler.shutdownNow();
     }
 
     //

Modified: geronimo/sandbox/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/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java?rev=578377&r1=578376&r2=578377&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java Fri Sep 21 23:03:58 2007
@@ -29,7 +29,6 @@
 import org.apache.geronimo.gshell.shell.Environment;
 import org.apache.geronimo.gshell.shell.ShellInfo;
 import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.component.annotations.InstantiationStrategy;
 import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerMessageVisitor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerMessageVisitor.java?rev=578377&r1=578376&r2=578377&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerMessageVisitor.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerMessageVisitor.java Fri Sep 21 23:03:58 2007
@@ -21,8 +21,6 @@
 
 import java.io.PrintWriter;
 import java.util.Date;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
 
 import org.apache.geronimo.gshell.DefaultEnvironment;
 import org.apache.geronimo.gshell.command.IO;
@@ -223,54 +221,38 @@
         msg.reply(new EchoMessage("CLOSE SHELL SUCCESS"));
     }
 
-    private ExecutorService executor = Executors.newCachedThreadPool();
-
     public void visitExecute(final ExecuteMessage msg) throws Exception {
         assert msg != null;
 
-        log.info("EXECUTE (QUEUE): {}", msg);
-
-        final IoSession session = msg.getSession();
+        log.info("EXECUTE: {}", msg);
 
-        final RemoteShell shell = getRemoteShell(session);
+        IoSession session = msg.getSession();
 
-        Runnable task = new Runnable() {
-            public void run() {
-                log.info("EXECUTE: {}", msg);
-                
-                try {
-                    //
-                    // TODO: Need to find a better place to stash this me thinks...
-                    //
-                    
-                    // Need to make sure we bind the correct bits into the lookups, since they are thread specific
-                    PlexusContainer container = (PlexusContainer) session.getAttribute(PlexusContainer.class.getName());
+        RemoteShell shell = getRemoteShell(session);
 
-                    IO io = (IO) session.getAttribute(IO.class.getName());
-                    IOLookup.set(container, io);
+        try {
+            //
+            // TODO: Need to find a better place to stash this me thinks...
+            //
 
-                    Environment env = (Environment) session.getAttribute(Environment.class.getName());
-                    EnvironmentLookup.set(container, env);
+            // Need to make sure we bind the correct bits into the lookups, since they are thread specific
+            PlexusContainer container = (PlexusContainer) session.getAttribute(PlexusContainer.class.getName());
 
-                    Object result = msg.execute(shell);
+            IO io = (IO) session.getAttribute(IO.class.getName());
+            IOLookup.set(container, io);
 
-                    msg.reply(new ExecuteMessage.Result(result));
-                }
-                catch (Notification n) {
-                    msg.reply(new ExecuteMessage.Notification(n));
-                }
-                catch (Throwable t) {
-                    msg.reply(new ExecuteMessage.Fault(t));
-                }
-            }
-        };
+            Environment env = (Environment) session.getAttribute(Environment.class.getName());
+            EnvironmentLookup.set(container, env);
 
-        task.run();
+            Object result = msg.execute(shell);
 
-        //
-        // HACK: More blind testing...
-        //
-
-        // executor.execute(task);
+            msg.reply(new ExecuteMessage.Result(result));
+        }
+        catch (Notification n) {
+            msg.reply(new ExecuteMessage.Notification(n));
+        }
+        catch (Throwable t) {
+            msg.reply(new ExecuteMessage.Fault(t));
+        }
     }
 }