geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r582034 [1/2] - in /geronimo/sandbox/gshell/trunk: gshell-remote/gshell-remote-client/ gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/ gshell-remote/gshell-remote-client/src/main/java/org/apache/ge...
Date Fri, 05 Oct 2007 00:08:21 GMT
Author: jdillon
Date: Thu Oct  4 17:08:17 2007
New Revision: 582034

URL: http://svn.apache.org/viewvc?rev=582034&view=rev
Log:
Adding Session abstraction to hook up some higher-level features (like req/resp and soon to include the session context muck)

Added:
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/CloseFileMessage.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/FileSegmentMessage.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/GetFileMessage.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/OpenFileMessage.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/PutFileMessage.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileFilter.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLConnection.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLStreamHandler.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Session.java
      - copied, changed from r580765, geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Transport.java
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/SessionAdapter.java   (contents, props changed)
      - copied, changed from r580765, geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportAdapter.java
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/SessionBindingFilter.java   (with props)
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/ThreadPoolModel.java   (contents, props changed)
      - copied, changed from r580765, geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/session/ThreadPoolModel.java
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/util/
      - copied from r580765, geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/session/
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/util/
      - copied from r580765, geronimo/sandbox/gshell/trunk/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/session/
Removed:
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/session/
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportAdapter.java
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/util/ThreadPoolModel.java
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/util/package-info.java
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/session/
Modified:
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/pom.xml
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshClient.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshCommand.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/auth/RemoteLoginModule.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/ClientMessageHandler.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/ClientMessageHandlerSupport.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/ClientSessionContext.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/EchoHandler.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/pom.xml
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/pom.xml
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RemoteIO.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServer.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerCommand.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/CloseShellHandler.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ConnectHandler.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/EchoHandler.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ExecuteHandler.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/OpenShellHandler.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandler.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandlerSupport.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerSessionContext.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/DefaultTimeoutManager.java
    geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/TimeoutManager.java
    geronimo/sandbox/gshell/trunk/gshell-whisper/pom.xml
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/request/RequestManager.java
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/request/Requestor.java
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/stream/SessionInputStream.java
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/stream/SessionOutputStream.java
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Transport.java
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseService.java
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransport.java
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportServer.java
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/util/SessionAttributeBinder.java
    geronimo/sandbox/gshell/trunk/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/message/PingPongProtocolTester.java

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/pom.xml?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/pom.xml Thu Oct  4 17:08:17 2007
@@ -60,7 +60,7 @@
                 <executions>
                     <execution>
                         <goals>
-                            <goal>commands-descriptor</goal>
+                            <goal>descriptor</goal>
                         </goals>
                     </execution>
                 </executions>

Modified: geronimo/sandbox/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/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshClient.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshClient.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshClient.java Thu Oct  4 17:08:17 2007
@@ -40,6 +40,7 @@
 import org.apache.geronimo.gshell.remote.message.OpenShellMessage;
 import org.apache.geronimo.gshell.whisper.message.Message;
 import org.apache.geronimo.gshell.whisper.message.MessageHandler;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 import org.apache.geronimo.gshell.whisper.transport.Transport;
 import org.apache.geronimo.gshell.whisper.transport.TransportFactory;
 import org.apache.geronimo.gshell.whisper.transport.TransportFactoryLocator;
@@ -71,6 +72,8 @@
 
     private Transport transport;
 
+    private Session session;
+
     @Requirement(role=ClientMessageHandler.class)
     private List<ClientMessageHandler> handlers;
 
@@ -82,16 +85,17 @@
         TransportFactory factory = locator.locate(remote);
 
         transport = factory.connect(remote, local, new Handler());
+        session = transport.getSession();
 
         log.debug("Connected to: {}", remote);
     }
 
     public InputStream getInputStream() {
-        return transport.getInputStream();
+        return session.getInputStream();
     }
 
     public OutputStream getOutputStream() {
-        return transport.getOutputStream();
+        return session.getOutputStream();
     }
 
     public Transport getTransport() {
@@ -110,9 +114,9 @@
     private void doHandshake() throws Exception {
         log.debug("Handshaking");
 
-        ClientSessionContext context = ClientSessionContext.BINDER.lookup(transport.getSession());
+        ClientSessionContext context = ClientSessionContext.BINDER.lookup(session.getSession());
 
-        Message response = transport.request(new ConnectMessage(crypto.getPublicKey()));
+        Message response = session.request(new ConnectMessage(crypto.getPublicKey()));
 
         if (response instanceof ConnectMessage.Result) {
             ConnectMessage.Result result = (ConnectMessage.Result)response;
@@ -126,7 +130,7 @@
     private void doLogin(final String username, final String password) throws Exception {
         log.debug("Logging in: {}", username);
 
-        ClientSessionContext context = ClientSessionContext.BINDER.lookup(transport.getSession());
+        ClientSessionContext context = ClientSessionContext.BINDER.lookup(session.getSession());
 
         CallbackHandler callbackHandler = new UsernamePasswordCallbackHandler(username, password);
         LoginContext loginContext = new LoginContext("RshClient", callbackHandler);
@@ -148,13 +152,13 @@
         
         log.debug("Echoing: {}", text);
 
-        transport.send(new EchoMessage(text)).join();
+        session.send(new EchoMessage(text)).join();
     }
 
     public void openShell() throws Exception {
         log.debug("Opening remote shell");
 
-        Message resp = transport.request(new OpenShellMessage());
+        Message resp = session.request(new OpenShellMessage());
 
         //
         // TODO: Need some context from the response
@@ -166,7 +170,7 @@
     public void closeShell() throws Exception {
         log.debug("Closing remote shell");
 
-        Message resp = transport.request(new CloseShellMessage());
+        Message resp = session.request(new CloseShellMessage());
 
         //
         // TODO: Need some context from the response
@@ -178,7 +182,7 @@
     private Object doExecute(final ExecuteMessage msg) throws Exception {
         assert msg != null;
 
-        ExecuteMessage.Result result = (ExecuteMessage.Result) transport.request(msg);
+        ExecuteMessage.Result result = (ExecuteMessage.Result) session.request(msg);
 
         // Handle result notifications
         if (result instanceof ExecuteMessage.Notification) {

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshCommand.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshCommand.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshCommand.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshCommand.java Thu Oct  4 17:08:17 2007
@@ -31,8 +31,8 @@
 import org.apache.geronimo.gshell.clp.Option;
 import org.apache.geronimo.gshell.command.CommandSupport;
 import org.apache.geronimo.gshell.command.annotation.CommandComponent;
+import org.apache.geronimo.gshell.command.annotation.Requirement;
 import org.apache.geronimo.gshell.remote.client.proxy.RemoteShellProxy;
-import org.codehaus.plexus.component.annotations.Requirement;
 
 /**
  * Command to connect to a remote shell server.

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/auth/RemoteLoginModule.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/auth/RemoteLoginModule.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/auth/RemoteLoginModule.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/auth/RemoteLoginModule.java Thu Oct  4 17:08:17 2007
@@ -34,6 +34,7 @@
 
 import org.apache.geronimo.gshell.remote.message.LoginMessage;
 import org.apache.geronimo.gshell.whisper.message.Message;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 import org.apache.geronimo.gshell.whisper.transport.Transport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -72,6 +73,7 @@
     public boolean login() throws LoginException {
         // Get a handle on our transport
         Transport transport = getTransport();
+        Session session = transport.getSession();
 
         // Process the username + password callbacks
         Callback[] callbacks = {
@@ -95,7 +97,7 @@
         // Send the login message
         Message response;
         try {
-            response = transport.request(new LoginMessage(username, password));
+            response = session.request(new LoginMessage(username, password));
         }
         catch (Exception e) {
             throw new LoginException(e.getMessage());

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/ClientMessageHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/ClientMessageHandler.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/ClientMessageHandler.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/ClientMessageHandler.java Thu Oct  4 17:08:17 2007
@@ -21,7 +21,7 @@
 
 import org.apache.geronimo.gshell.whisper.message.Message;
 import org.apache.geronimo.gshell.whisper.message.MessageHandler;
-import org.apache.mina.common.IoSession;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 
 /**
  * ???
@@ -31,5 +31,5 @@
 public interface ClientMessageHandler<T extends Message>
     extends MessageHandler<T>
 {
-    void handle(final IoSession session, final ClientSessionContext context, final T message) throws Exception;
+    void handle(final Session session, final ClientSessionContext context, final T message) throws Exception;
 }

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/ClientMessageHandlerSupport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/ClientMessageHandlerSupport.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/ClientMessageHandlerSupport.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/ClientMessageHandlerSupport.java Thu Oct  4 17:08:17 2007
@@ -21,6 +21,7 @@
 
 import org.apache.geronimo.gshell.whisper.message.Message;
 import org.apache.geronimo.gshell.whisper.message.MessageHandlerSupport;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 import org.apache.mina.common.IoSession;
 
 /**
@@ -39,6 +40,8 @@
     public void messageReceived(final IoSession session, final T message) throws Exception {
         ClientSessionContext context = ClientSessionContext.BINDER.lookup(session);
 
-        handle(session, context, message);
+        Session s = Session.BINDER.lookup(session);
+
+        handle(s, context, message);
     }
 }

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/ClientSessionContext.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/ClientSessionContext.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/ClientSessionContext.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/ClientSessionContext.java Thu Oct  4 17:08:17 2007
@@ -24,7 +24,7 @@
 import javax.security.auth.Subject;
 
 import org.apache.geronimo.gshell.remote.client.auth.ClientPrincipal;
-import org.apache.geronimo.gshell.whisper.session.SessionAttributeBinder;
+import org.apache.geronimo.gshell.whisper.util.SessionAttributeBinder;
 
 /**
  * ???

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/EchoHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/EchoHandler.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/EchoHandler.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/handler/EchoHandler.java Thu Oct  4 17:08:17 2007
@@ -20,7 +20,7 @@
 package org.apache.geronimo.gshell.remote.client.handler;
 
 import org.apache.geronimo.gshell.remote.message.EchoMessage;
-import org.apache.mina.common.IoSession;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 import org.codehaus.plexus.component.annotations.Component;
 
 /**
@@ -36,7 +36,7 @@
         super(EchoMessage.class);
     }
 
-    public void handle(final IoSession session, final ClientSessionContext context, final EchoMessage message) throws Exception {
+    public void handle(final Session session, final ClientSessionContext context, final EchoMessage message) throws Exception {
         log.info("\n\nECHO: {}\n\n", message.getText());
     }
 }

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/pom.xml?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-common/pom.xml Thu Oct  4 17:08:17 2007
@@ -43,11 +43,13 @@
             <artifactId>gshell-whisper</artifactId>
             <version>${version}</version>
         </dependency>
-        
+
+        <!--
         <dependency>
             <groupId>blissed</groupId>
             <artifactId>blissed</artifactId>
         </dependency>
+        -->
     </dependencies>
 
 </project>

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/pom.xml?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/pom.xml Thu Oct  4 17:08:17 2007
@@ -60,7 +60,7 @@
                 <executions>
                     <execution>
                         <goals>
-                            <goal>commands-descriptor</goal>
+                            <goal>descriptor</goal>
                         </goals>
                     </execution>
                 </executions>

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RemoteIO.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/RemoteIO.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RemoteIO.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RemoteIO.java Thu Oct  4 17:08:17 2007
@@ -22,7 +22,7 @@
 import org.apache.geronimo.gshell.command.IO;
 import org.apache.geronimo.gshell.whisper.stream.SessionInputStream;
 import org.apache.geronimo.gshell.whisper.stream.SessionOutputStream;
-import org.apache.mina.common.IoSession;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 
 /**
  * Container for <em>remote</em> input/output handles.
@@ -36,7 +36,7 @@
     // TODO: Figure out how to hook up STDERR to all of this muck
     //
     
-    public RemoteIO(final IoSession session) {
-        super(SessionInputStream.BINDER.lookup(session), SessionOutputStream.BINDER.lookup(session), false);
+    public RemoteIO(final Session session) {
+        super(SessionInputStream.BINDER.lookup(session.getSession()), SessionOutputStream.BINDER.lookup(session.getSession()), false);
     }
 }

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServer.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/RshServer.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServer.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServer.java Thu Oct  4 17:08:17 2007
@@ -28,6 +28,7 @@
 import org.apache.geronimo.gshell.remote.server.handler.ServerSessionContext;
 import org.apache.geronimo.gshell.remote.server.timeout.TimeoutManager;
 import org.apache.geronimo.gshell.whisper.message.MessageHandler;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 import org.apache.geronimo.gshell.whisper.transport.TransportFactory;
 import org.apache.geronimo.gshell.whisper.transport.TransportFactoryLocator;
 import org.apache.geronimo.gshell.whisper.transport.TransportServer;
@@ -118,14 +119,16 @@
         public void sessionOpened(final IoSession session) throws Exception {
             assert session != null;
 
+            final Session s = Session.BINDER.lookup(session);
+
             // Install the session context
             ServerSessionContext context = ServerSessionContext.BINDER.bind(session, new ServerSessionContext());
             log.debug("Created session context: {}", context);
             
             // Schedule a task to timeout the handshake process
-            timeoutManager.scheduleTimeout(session, AUTH_TIMEOUT, new Runnable() {
+            timeoutManager.scheduleTimeout(s, AUTH_TIMEOUT, new Runnable() {
                 public void run() {
-                    log.error("Timeout waiting for handshake from: {}", session.getRemoteAddress());
+                    log.error("Timeout waiting for handshake from: {}", s);
 
                     session.close();
                 }

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerCommand.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/RshServerCommand.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerCommand.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServerCommand.java Thu Oct  4 17:08:17 2007
@@ -25,7 +25,7 @@
 import org.apache.geronimo.gshell.clp.Option;
 import org.apache.geronimo.gshell.command.CommandSupport;
 import org.apache.geronimo.gshell.command.annotation.CommandComponent;
-import org.codehaus.plexus.component.annotations.Requirement;
+import org.apache.geronimo.gshell.command.annotation.Requirement;
 
 /**
  * Command to start a remote shell server.

Modified: geronimo/sandbox/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/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/CloseShellHandler.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/CloseShellHandler.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/CloseShellHandler.java Thu Oct  4 17:08:17 2007
@@ -21,7 +21,7 @@
 
 import org.apache.geronimo.gshell.remote.message.CloseShellMessage;
 import org.apache.geronimo.gshell.remote.message.EchoMessage;
-import org.apache.mina.common.IoSession;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 import org.codehaus.plexus.component.annotations.Component;
 
 /**
@@ -37,7 +37,7 @@
         super(CloseShellMessage.class);
     }
 
-    public void handle(final IoSession session, final ServerSessionContext context, final CloseShellMessage message) throws Exception {
+    public void handle(final Session session, final ServerSessionContext context, final CloseShellMessage message) throws Exception {
         context.shell.close();
         context.shell = null;
 
@@ -50,6 +50,6 @@
 
         EchoMessage reply = new EchoMessage("CLOSE SHELL SUCCESS");
         reply.setCorrelationId(message.getId());
-        session.write(reply);
+        session.send(reply);
     }
 }

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ConnectHandler.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/handler/ConnectHandler.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ConnectHandler.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ConnectHandler.java Thu Oct  4 17:08:17 2007
@@ -23,7 +23,7 @@
 import org.apache.geronimo.gshell.remote.message.ConnectMessage;
 import org.apache.geronimo.gshell.remote.server.RshServer;
 import org.apache.geronimo.gshell.remote.server.timeout.TimeoutManager;
-import org.apache.mina.common.IoSession;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
 
@@ -46,7 +46,7 @@
         super(ConnectMessage.class);
     }
 
-    public void handle(final IoSession session, final ServerSessionContext context, final ConnectMessage message) throws Exception {
+    public void handle(final Session session, final ServerSessionContext context, final ConnectMessage message) throws Exception {
         // Try to cancel the timeout task
         if (!timeoutManager.cancelTimeout(session)) {
             log.warn("Aborting handshake processing; timeout has triggered");
@@ -58,12 +58,13 @@
             // Reply to the client with some details about the connection
             ConnectMessage.Result reply = new ConnectMessage.Result(crypto.getPublicKey());
             reply.setCorrelationId(message.getId());
-            session.write(reply);
+            session.send(reply);
 
             // Schedule a task to timeout the login process
             timeoutManager.scheduleTimeout(session, RshServer.AUTH_TIMEOUT, new Runnable() {
                 public void run() {
-                    log.error("Timeout waiting for login from: {}", session.getRemoteAddress());
+                    log.error("Timeout waiting for login from: {}", session);
+                    
                     session.close();
                 }
             });

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/EchoHandler.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/handler/EchoHandler.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/EchoHandler.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/EchoHandler.java Thu Oct  4 17:08:17 2007
@@ -20,7 +20,7 @@
 package org.apache.geronimo.gshell.remote.server.handler;
 
 import org.apache.geronimo.gshell.remote.message.EchoMessage;
-import org.apache.mina.common.IoSession;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 import org.codehaus.plexus.component.annotations.Component;
 
 /**
@@ -36,9 +36,9 @@
         super(EchoMessage.class);
     }
 
-    public void handle(final IoSession session, final ServerSessionContext context, final EchoMessage message) throws Exception {
+    public void handle(final Session session, final ServerSessionContext context, final EchoMessage message) throws Exception {
         EchoMessage reply = new EchoMessage(message.getText());
         reply.setCorrelationId(message.getId());
-        session.write(reply);
+        session.send(reply);
     }
 }

Modified: geronimo/sandbox/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/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ExecuteHandler.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ExecuteHandler.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ExecuteHandler.java Thu Oct  4 17:08:17 2007
@@ -23,7 +23,7 @@
 import org.apache.geronimo.gshell.lookup.EnvironmentLookup;
 import org.apache.geronimo.gshell.lookup.IOLookup;
 import org.apache.geronimo.gshell.remote.message.ExecuteMessage;
-import org.apache.mina.common.IoSession;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 import org.codehaus.plexus.component.annotations.Component;
 
 /**
@@ -39,7 +39,7 @@
         super(ExecuteMessage.class);
     }
 
-    public void handle(final IoSession session, final ServerSessionContext context, final ExecuteMessage message) throws Exception {
+    public void handle(final Session session, final ServerSessionContext context, final ExecuteMessage message) throws Exception {
         // Need to make sure that the execuing thread has the right I/O and environment in context
         IOLookup.set(context.container, context.io);
         EnvironmentLookup.set(context.container, context.env);
@@ -65,6 +65,6 @@
         }
 
         reply.setCorrelationId(message.getId());
-        session.write(reply);
+        session.send(reply);
     }
 }

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.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/handler/LoginHandler.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java Thu Oct  4 17:08:17 2007
@@ -28,7 +28,7 @@
 import org.apache.geronimo.gshell.remote.jaas.UsernamePasswordCallbackHandler;
 import org.apache.geronimo.gshell.remote.message.LoginMessage;
 import org.apache.geronimo.gshell.remote.server.timeout.TimeoutManager;
-import org.apache.mina.common.IoSession;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
@@ -55,7 +55,7 @@
         new JaasConfigurationHelper("server.login.conf").initialize();
     }
 
-    public void handle(final IoSession session, final ServerSessionContext context, final LoginMessage message) throws Exception {
+    public void handle(final Session session, final ServerSessionContext context, final LoginMessage message) throws Exception {
         // Try to cancel the timeout task
         if (!timeoutManager.cancelTimeout(session)) {
             log.warn("Aborting login processing; timeout has triggered");
@@ -80,7 +80,7 @@
 
                 LoginMessage.Success reply = new LoginMessage.Success(context.identity.getToken());
                 reply.setCorrelationId(message.getId());
-                session.write(reply);
+                session.send(reply);
             }
             catch (LoginException e) {
                 String reason = e.toString();
@@ -88,7 +88,7 @@
 
                 LoginMessage.Failure reply = new LoginMessage.Failure(reason);
                 reply.setCorrelationId(message.getId());
-                session.write(reply);
+                session.send(reply);
             }
         }
     }

Modified: geronimo/sandbox/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/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/OpenShellHandler.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/OpenShellHandler.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/OpenShellHandler.java Thu Oct  4 17:08:17 2007
@@ -27,7 +27,7 @@
 import org.apache.geronimo.gshell.remote.message.OpenShellMessage;
 import org.apache.geronimo.gshell.remote.server.RemoteIO;
 import org.apache.geronimo.gshell.remote.server.RemoteShellContainer;
-import org.apache.mina.common.IoSession;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.classworlds.ClassWorld;
 import org.codehaus.plexus.component.annotations.Component;
@@ -49,7 +49,7 @@
         super(OpenShellMessage.class);
     }
 
-    public void handle(final IoSession session, final ServerSessionContext context, final OpenShellMessage message) throws Exception {
+    public void handle(final Session session, final ServerSessionContext context, final OpenShellMessage message) throws Exception {
         // Create a new container which will be the parent for our remote shells
         ClassWorld classWorld = container.getContainerRealm().getWorld();
         context.container = RemoteShellContainer.create(classWorld);
@@ -71,6 +71,6 @@
 
         EchoMessage reply = new EchoMessage("OPEN SHELL SUCCESS");
         reply.setCorrelationId(message.getId());
-        session.write(reply);
+        session.send(reply);
     }
 }

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandler.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/handler/ServerMessageHandler.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandler.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandler.java Thu Oct  4 17:08:17 2007
@@ -21,7 +21,7 @@
 
 import org.apache.geronimo.gshell.whisper.message.Message;
 import org.apache.geronimo.gshell.whisper.message.MessageHandler;
-import org.apache.mina.common.IoSession;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 
 /**
  * ???
@@ -31,5 +31,5 @@
 public interface ServerMessageHandler<T extends Message>
     extends MessageHandler<T>
 {
-    void handle(final IoSession session, final ServerSessionContext context, final T message) throws Exception;
+    void handle(final Session session, final ServerSessionContext context, final T message) throws Exception;
 }

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandlerSupport.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/handler/ServerMessageHandlerSupport.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandlerSupport.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerMessageHandlerSupport.java Thu Oct  4 17:08:17 2007
@@ -21,6 +21,7 @@
 
 import org.apache.geronimo.gshell.whisper.message.Message;
 import org.apache.geronimo.gshell.whisper.message.MessageHandlerSupport;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 import org.apache.mina.common.IoSession;
 
 /**
@@ -39,6 +40,8 @@
     public void messageReceived(final IoSession session, final T message) throws Exception {
         ServerSessionContext context = ServerSessionContext.BINDER.lookup(session);
 
-        handle(session, context, message);
+        Session s = Session.BINDER.lookup(session);
+
+        handle(s, context, message);
     }
 }

Modified: geronimo/sandbox/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/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerSessionContext.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerSessionContext.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ServerSessionContext.java Thu Oct  4 17:08:17 2007
@@ -29,7 +29,7 @@
 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.whisper.session.SessionAttributeBinder;
+import org.apache.geronimo.gshell.whisper.util.SessionAttributeBinder;
 
 /**
  * ???

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/DefaultTimeoutManager.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/timeout/DefaultTimeoutManager.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/DefaultTimeoutManager.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/DefaultTimeoutManager.java Thu Oct  4 17:08:17 2007
@@ -25,8 +25,8 @@
 
 import org.apache.geronimo.gshell.common.Duration;
 import org.apache.geronimo.gshell.common.NamedThreadFactory;
-import org.apache.geronimo.gshell.whisper.session.SessionAttributeBinder;
-import org.apache.mina.common.IoSession;
+import org.apache.geronimo.gshell.whisper.transport.Session;
+import org.apache.geronimo.gshell.whisper.util.SessionAttributeBinder;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
@@ -53,22 +53,22 @@
         scheduler = new ScheduledThreadPoolExecutor(Runtime.getRuntime().availableProcessors(), tf);
     }
 
-    public ScheduledFuture scheduleTimeout(final IoSession session, final Duration timeout, final Runnable task) {
+    public ScheduledFuture scheduleTimeout(final Session session, final Duration timeout, final Runnable task) {
         assert session != null;
         assert timeout != null;
         assert task != null;
 
         ScheduledFuture tf = scheduler.schedule(task, timeout.value, timeout.unit);
 
-        TIMEOUT.rebind(session, tf);
+        TIMEOUT.rebind(session.getSession(), tf);
 
         return tf;
     }
 
-    public boolean cancelTimeout(final IoSession session) {
+    public boolean cancelTimeout(final Session session) {
         assert session != null;
 
-        ScheduledFuture tf = TIMEOUT.lookup(session);
+        ScheduledFuture tf = TIMEOUT.lookup(session.getSession());
 
         return tf.cancel(false);
     }

Modified: geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/TimeoutManager.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/timeout/TimeoutManager.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/TimeoutManager.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/timeout/TimeoutManager.java Thu Oct  4 17:08:17 2007
@@ -22,7 +22,7 @@
 import java.util.concurrent.ScheduledFuture;
 
 import org.apache.geronimo.gshell.common.Duration;
-import org.apache.mina.common.IoSession;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 
 /**
  * ???
@@ -31,7 +31,7 @@
  */
 public interface TimeoutManager
 {
-    ScheduledFuture scheduleTimeout(IoSession session, Duration timeout, Runnable task);
+    ScheduledFuture scheduleTimeout(Session session, Duration timeout, Runnable task);
 
-    boolean cancelTimeout(IoSession session);
+    boolean cancelTimeout(Session session);
 }

Modified: geronimo/sandbox/gshell/trunk/gshell-whisper/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/pom.xml?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/pom.xml Thu Oct  4 17:08:17 2007
@@ -75,6 +75,11 @@
         </dependency>
 
         <dependency>
+            <groupId>commons-vfs</groupId>
+            <artifactId>commons-vfs</artifactId>
+        </dependency>
+
+        <dependency>
             <groupId>org.codehaus.plexus</groupId>
             <artifactId>plexus-container-default</artifactId>
             <scope>test</scope>

Modified: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/request/RequestManager.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/request/RequestManager.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/request/RequestManager.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/request/RequestManager.java Thu Oct  4 17:08:17 2007
@@ -33,7 +33,7 @@
 import org.apache.geronimo.gshell.common.tostring.ToStringBuilder;
 import org.apache.geronimo.gshell.common.tostring.ToStringStyle;
 import org.apache.geronimo.gshell.whisper.message.Message;
-import org.apache.geronimo.gshell.whisper.session.SessionAttributeBinder;
+import org.apache.geronimo.gshell.whisper.util.SessionAttributeBinder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/request/Requestor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/request/Requestor.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/request/Requestor.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/request/Requestor.java Thu Oct  4 17:08:17 2007
@@ -23,7 +23,7 @@
 
 import org.apache.geronimo.gshell.common.Duration;
 import org.apache.geronimo.gshell.whisper.message.Message;
-import org.apache.geronimo.gshell.whisper.transport.Transport;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 import org.apache.mina.common.IoFutureListener;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.WriteFuture;
@@ -54,8 +54,8 @@
         this(session, DEFAULT_TIMEOUT);
     }
 
-    public Requestor(final Transport transport) {
-        this(transport.getSession(), DEFAULT_TIMEOUT);
+    public Requestor(final Session session) {
+        this(session.getSession(), DEFAULT_TIMEOUT);
     }
 
     public Duration getTimeout() {

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/CloseFileMessage.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/CloseFileMessage.java?rev=582034&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/CloseFileMessage.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/CloseFileMessage.java Thu Oct  4 17:08:17 2007
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.whisper.rfile;
+
+import org.apache.geronimo.gshell.whisper.message.BaseMessage;
+
+/**
+ * Message sent after we are all finished with the <tt>rfile</tt> connection.
+ *
+ * @version $Rev$ $Date$
+ */
+public class CloseFileMessage
+    extends BaseMessage
+{
+    //
+    // TODO: ???
+    //
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/CloseFileMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/CloseFileMessage.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/CloseFileMessage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/FileSegmentMessage.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/FileSegmentMessage.java?rev=582034&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/FileSegmentMessage.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/FileSegmentMessage.java Thu Oct  4 17:08:17 2007
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.whisper.rfile;
+
+import org.apache.geronimo.gshell.whisper.message.BaseMessage;
+
+/**
+ * Holds onto a segment of a transfered file.
+ *
+ * @version $Rev$ $Date$
+ */
+public class FileSegmentMessage
+    extends BaseMessage
+{
+    //
+    // TODO: Add EOF and Fault responses ?
+    //
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/FileSegmentMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/FileSegmentMessage.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/FileSegmentMessage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/GetFileMessage.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/GetFileMessage.java?rev=582034&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/GetFileMessage.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/GetFileMessage.java Thu Oct  4 17:08:17 2007
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.whisper.rfile;
+
+import org.apache.geronimo.gshell.whisper.message.BaseMessage;
+
+/**
+ * Message to initate a file transfer from remote to local.
+ *
+ * @version $Rev$ $Date$
+ */
+public class GetFileMessage
+    extends BaseMessage
+{
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/GetFileMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/GetFileMessage.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/GetFileMessage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/OpenFileMessage.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/OpenFileMessage.java?rev=582034&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/OpenFileMessage.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/OpenFileMessage.java Thu Oct  4 17:08:17 2007
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.whisper.rfile;
+
+import org.apache.geronimo.gshell.whisper.message.BaseMessage;
+
+/**
+ * Message sent to initiate an <tt>rfile</tt> connection.
+ *
+ * @version $Rev$ $Date$
+ */
+public class OpenFileMessage
+    extends BaseMessage
+{
+    //
+    // TODO: Response should contain file details or denial
+    //
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/OpenFileMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/OpenFileMessage.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/OpenFileMessage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/PutFileMessage.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/PutFileMessage.java?rev=582034&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/PutFileMessage.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/PutFileMessage.java Thu Oct  4 17:08:17 2007
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.whisper.rfile;
+
+import org.apache.geronimo.gshell.whisper.message.BaseMessage;
+
+/**
+ * Message to initate a file transfer from local to remote.
+ *
+ * @version $Rev$ $Date$
+ */
+public class PutFileMessage
+    extends BaseMessage
+{
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/PutFileMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/PutFileMessage.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/PutFileMessage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileFilter.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileFilter.java?rev=582034&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileFilter.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileFilter.java Thu Oct  4 17:08:17 2007
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.whisper.rfile;
+
+import org.apache.mina.common.IoFilterAdapter;
+
+/**
+ * Filter which handles the details of the <tt>rfile</tt> (remote-file) protocol.
+ *
+ * @version $Rev$ $Date$
+ */
+public class RemoteFileFilter
+    extends IoFilterAdapter
+{
+    //
+    // TODO: Probably want to duplicate the StreamWriteHandler and massage it for our needs...
+    //
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileFilter.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileFilter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLConnection.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLConnection.java?rev=582034&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLConnection.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLConnection.java Thu Oct  4 17:08:17 2007
@@ -0,0 +1,217 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.whisper.rfile;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.net.URLConnection;
+import java.security.Permission;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * URL connection <tt>rfile</tt> (remote-file) protocol.
+ *
+ * @version $Rev$ $Date$
+ */
+public class RemoteFileURLConnection
+    extends URLConnection
+{
+    private final Logger log = LoggerFactory.getLogger(getClass());
+    
+    RemoteFileURLConnection(final URL url /* TODO: We need a session and some details */) {
+        super(url);
+
+        //
+        // TODO: Probably need to have the session passed in?  And some initial file state details er something?
+        //
+    }
+
+    @Override
+    public void connect() throws IOException {
+        //
+        // TODO:
+        //
+    }
+
+    //
+    // TODO: May want to lean on the Session<Input|Output>Stream impl here...
+    //
+
+    @Override
+    public InputStream getInputStream() throws IOException {
+        if (!connected) {
+            connect();
+        }
+
+        //
+        // TODO:
+        //
+
+        return null;
+    }
+
+    @Override
+    public OutputStream getOutputStream() throws IOException {
+        if (!connected) {
+            connect();
+        }
+
+        //
+        // TODO:
+        //
+
+        return null;
+    }
+
+    @Override
+    public Permission getPermission() throws IOException {
+        //
+        // TODO:
+        //
+        
+        /*
+        // Detect if we have read/write perms
+        String perms = null;
+
+        if (file.canRead()) {
+            perms = "read";
+        }
+
+        if (file.canWrite()) {
+            if (perms != null) {
+                perms += ",write";
+            }
+            else {
+                perms = "write";
+            }
+        }
+
+        // File perms need filename to be in system format
+        String filename = ParseUtil.decode(url.getPath());
+        if (File.separatorChar != '/') {
+            filename.replace('/', File.separatorChar);
+        }
+
+        return new FilePermission(filename, perms);
+        */
+
+        return null;
+    }
+
+    @Override
+    public long getLastModified() {
+        //
+        // TODO:
+        //
+
+        return -1;
+    }
+
+    @Override
+    public long getDate() {
+        //
+        // TODO:
+        //
+
+        return -1;
+    }
+
+    @Override
+    public int getContentLength() {
+        //
+        // TODO:
+        //
+
+        return -1;
+
+        /*
+        final long value = file.length();
+        if (value > Integer.MAX_VALUE || value < Integer.MIN_VALUE) {
+            throw new IllegalStateException("Can not safly convert to int: " + value);
+        }
+
+        return (int) value;
+        */
+    }
+
+    @Override
+    public String getContentType() {
+        //return getFileNameMap().getContentTypeFor(file.getName());
+
+        //
+        // TODO:
+        //
+
+        return null;
+    }
+
+    @Override
+    public String getHeaderField(final String name) {
+        assert name != null;
+
+        String headerName = name.toLowerCase();
+
+        if (headerName.equals("last-modified")) {
+            return String.valueOf(getLastModified());
+        }
+        else if (headerName.equals("content-length")) {
+            return String.valueOf(getContentLength());
+        }
+        else if (headerName.equals("content-type")) {
+            return getContentType();
+        }
+        else if (headerName.equals("date")) {
+            return String.valueOf(getDate());
+        }
+
+        return super.getHeaderField(name);
+    }
+
+    @Override
+    public Map<String,List<String>> getHeaderFields() {
+        Map<String,List<String>> headers = new HashMap<String,List<String>>();
+
+        String[] headerNames = {
+            "last-modified",
+            "content-length",
+            "content-type",
+            "date"
+        };
+
+        for (String name : headerNames) {
+            List<String> list = new ArrayList<String>(1);
+
+            list.add(getHeaderField(name));
+
+            headers.put(name, Collections.unmodifiableList(list));
+        }
+
+        return Collections.unmodifiableMap(headers);
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLConnection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLConnection.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLConnection.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLStreamHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLStreamHandler.java?rev=582034&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLStreamHandler.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLStreamHandler.java Thu Oct  4 17:08:17 2007
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.whisper.rfile;
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+
+import org.codehaus.plexus.component.annotations.Component;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * URL stream handler for the <tt>rfile</tt> (remote-file) protocol.
+ *
+ * @version $Rev$ $Date$
+ */
+@Component(role=URLStreamHandler.class, hint="rfile", instantiationStrategy="singleton")
+public class RemoteFileURLStreamHandler
+    extends URLStreamHandler
+{
+    public static final String PROTOCOL = "rfile";
+
+    private final Logger log = LoggerFactory.getLogger(getClass());
+    
+    //
+    // TODO: We are going to need to get a handle on the current session to communicate with...
+    //
+
+    protected URLConnection openConnection(final URL url) throws IOException {
+        assert url != null;
+
+        String protocol = url.getProtocol();
+
+        if (!PROTOCOL.equals(protocol)) {
+            throw new IllegalArgumentException("Invalid protocol: " + protocol);
+        }
+
+        log.debug("Opening connection: {}", url);
+        
+        //
+        // TODO: Need to request the remote file transfer, and get back the basic file details
+        //       and then provide the connection below with the info and session to talk over
+        //
+        // OpenFileMessage msg = new OpenFileMessage();
+
+        return new RemoteFileURLConnection(url /* TODO: Pass in state */);
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLStreamHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLStreamHandler.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/rfile/RemoteFileURLStreamHandler.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/stream/SessionInputStream.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/stream/SessionInputStream.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/stream/SessionInputStream.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/stream/SessionInputStream.java Thu Oct  4 17:08:17 2007
@@ -29,7 +29,7 @@
 import org.apache.geronimo.gshell.common.NestedIOException;
 import org.apache.geronimo.gshell.common.tostring.ReflectionToStringBuilder;
 import org.apache.geronimo.gshell.common.tostring.ToStringStyle;
-import org.apache.geronimo.gshell.whisper.session.SessionAttributeBinder;
+import org.apache.geronimo.gshell.whisper.util.SessionAttributeBinder;
 import org.apache.mina.common.ByteBuffer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/stream/SessionOutputStream.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/stream/SessionOutputStream.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/stream/SessionOutputStream.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/stream/SessionOutputStream.java Thu Oct  4 17:08:17 2007
@@ -28,7 +28,7 @@
 
 import org.apache.geronimo.gshell.common.tostring.ReflectionToStringBuilder;
 import org.apache.geronimo.gshell.common.tostring.ToStringStyle;
-import org.apache.geronimo.gshell.whisper.session.SessionAttributeBinder;
+import org.apache.geronimo.gshell.whisper.util.SessionAttributeBinder;
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.WriteFuture;

Copied: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Session.java (from r580765, geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Transport.java)
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Session.java?p2=geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Session.java&p1=geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Transport.java&r1=580765&r2=582034&rev=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Transport.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Session.java Thu Oct  4 17:08:17 2007
@@ -22,37 +22,27 @@
 import java.io.Closeable;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.net.URI;
-import java.util.EventListener;
 
 import org.apache.geronimo.gshell.common.Duration;
 import org.apache.geronimo.gshell.whisper.message.Message;
-import org.apache.mina.common.IoConnector;
-import org.apache.mina.common.IoHandler;
+import org.apache.geronimo.gshell.whisper.util.SessionAttributeBinder;
 import org.apache.mina.common.IoSession;
-import org.apache.mina.common.ThreadModel;
 import org.apache.mina.common.WriteFuture;
 
 /**
- * Provides the client-side protocol interface.
+ * ???
  *
  * @version $Rev$ $Date$
  */
-public interface Transport<T extends IoConnector>
+public interface Session
     extends Closeable
 {
-    URI getRemote();
-
-    URI getLocal();
-
-    T getConnector();
+    SessionAttributeBinder<Session> BINDER = new SessionAttributeBinder<Session>(Session.class);
 
     IoSession getSession();
 
     void close();
 
-    // Messages
-
     WriteFuture send(Object msg) throws Exception;
 
     Message request(Message msg, Duration timeout) throws Exception;
@@ -60,47 +50,13 @@
     Message request(Message msg) throws Exception;
 
     //
-    // Streams
+    // NOTE: This could handle setting the correlationId ???
     //
+    // WriteFuture reply(Message reply, Message replyTo) throws Exception;
 
     InputStream getInputStream();
 
     OutputStream getOutputStream();
 
     OutputStream getErrorStream();
-
-    //
-    // Listeners
-    //
-
-    void addListener(Listener listener);
-
-    void removeListener(Listener listener);
-
-    interface Listener
-        extends EventListener
-    {
-        //
-        // TODO:
-        //
-    }
-    
-    //
-    // Configuration
-    //
-
-    void setConfiguration(Configuration config);
-
-    Configuration getConfiguration();
-
-    interface Configuration
-    {
-        IoHandler getHandler();
-
-        void setHandler(IoHandler handler);
-
-        ThreadModel getThreadModel();
-
-        void setThreadModel(ThreadModel threadModel);
-    }
 }

Modified: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Transport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Transport.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Transport.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/Transport.java Thu Oct  4 17:08:17 2007
@@ -47,27 +47,9 @@
 
     T getConnector();
 
-    IoSession getSession();
+    Session getSession();
 
     void close();
-
-    // Messages
-
-    WriteFuture send(Object msg) throws Exception;
-
-    Message request(Message msg, Duration timeout) throws Exception;
-
-    Message request(Message msg) throws Exception;
-
-    //
-    // Streams
-    //
-
-    InputStream getInputStream();
-
-    OutputStream getOutputStream();
-
-    OutputStream getErrorStream();
 
     //
     // Listeners

Modified: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseService.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseService.java?rev=582034&r1=582033&r2=582034&view=diff
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseService.java (original)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseService.java Thu Oct  4 17:08:17 2007
@@ -25,6 +25,7 @@
 import org.apache.geronimo.gshell.common.tostring.ToStringStyle;
 import org.apache.geronimo.gshell.whisper.request.RequestResponseFilter;
 import org.apache.geronimo.gshell.whisper.stream.SessionStreamFilter;
+import org.apache.geronimo.gshell.whisper.transport.Session;
 import org.apache.geronimo.gshell.whisper.transport.Transport;
 import org.apache.geronimo.gshell.whisper.transport.TransportExceptionMonitor;
 import org.apache.geronimo.gshell.whisper.transport.TransportServer;
@@ -137,10 +138,14 @@
                 for (IoFilterChain.Entry entry : session.getFilterChain().getAll()) {
                     log.debug("    {}", entry);
                 }
+
+                // Session.BINDER.bind(session, new SessionAdapter(session));
             }
 
             public void sessionDestroyed(final IoSession session) {
                 log.debug("Session destroyed: {}", session);
+
+                // Session.BINDER.unbind(session);
             }
         });
 
@@ -171,6 +176,8 @@
         //
         // HACK: For right now just add a few hard codded to test with
         //
+
+        chain.addLast(SessionBindingFilter.class.getSimpleName(), new SessionBindingFilter());
 
         chain.addLast(ProtocolCodecFilter.class.getSimpleName(), new ProtocolCodecFilter(new ObjectSerializationCodecFactory()));
 



Mime
View raw message