[jboss-cvs] JBoss Messaging SVN: r2161 - in branches/Branch_Bisocket_Experiment/src/main/org/jboss/jms: server/remoting and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Feb 2 22:07:54 EST 2007


Author: ron_sigal
Date: 2007-02-02 22:07:54 -0500 (Fri, 02 Feb 2007)
New Revision: 2161

Removed:
   branches/Branch_Bisocket_Experiment/src/main/org/jboss/jms/client/remoting/ClientSocketWrapper.java
   branches/Branch_Bisocket_Experiment/src/main/org/jboss/jms/server/remoting/ServerSocketWrapper.java
Log:
Check for closed connection based on CLOSING byte.

Deleted: branches/Branch_Bisocket_Experiment/src/main/org/jboss/jms/client/remoting/ClientSocketWrapper.java
===================================================================
--- branches/Branch_Bisocket_Experiment/src/main/org/jboss/jms/client/remoting/ClientSocketWrapper.java	2007-02-03 02:03:19 UTC (rev 2160)
+++ branches/Branch_Bisocket_Experiment/src/main/org/jboss/jms/client/remoting/ClientSocketWrapper.java	2007-02-03 03:07:54 UTC (rev 2161)
@@ -1,126 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.jms.client.remoting;
-
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.Socket;
-import java.util.Map;
-
-import org.jboss.jms.server.remoting.ServerSocketWrapper;
-import org.jboss.logging.Logger;
-import org.jboss.remoting.transport.socket.SocketWrapper;
-
-/**
- * @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
- * @author <a href="mailto:tom.fox at jboss.com">Tim Fox</a>
- *
- * $Id$
- */
-public class ClientSocketWrapper extends SocketWrapper
-{
-   // Constants -----------------------------------------------------
-   
-   final static private Logger log = Logger.getLogger(ClientSocketWrapper.class);
-
-
-   // Static --------------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   private DataInputStream in;
-   private DataOutputStream out;
-
-   // Constructors --------------------------------------------------
-
-   public ClientSocketWrapper(Socket socket) throws IOException
-   {
-      super(socket);
-      createStreams(socket, null);
-   }
-
-   public ClientSocketWrapper(Socket socket, Map metadata, Integer timeout) throws Exception
-   {
-      super(socket, timeout);
-      createStreams(socket, metadata);
-   }
-
-   // Public --------------------------------------------------------
-
-   public OutputStream getOutputStream()
-   {
-      return out;
-   }
-
-   public InputStream getInputStream()
-   {
-      return in;
-   }
-
-   public void checkConnection() throws IOException
-   {
-      // Test to see if socket is alive by send ACK message
-      final byte ACK = 1;
-
-      out.writeByte(ACK);
-      out.flush();
-      in.readByte();
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   protected void createStreams(Socket socket, Map metadata) throws IOException
-   {
-      out = createOutputStream(socket);
-      in = createInputStream(socket);
-   }
-
-   protected DataInputStream createInputStream(Socket socket)
-         throws IOException
-   {
-      BufferedInputStream bin = new BufferedInputStream(socket.getInputStream());
-      
-      return new DataInputStream(bin);
-   }
-
-   protected DataOutputStream createOutputStream(Socket socket)
-         throws IOException
-   {
-      BufferedOutputStream bout = new BufferedOutputStream(socket.getOutputStream());
-      
-      return new DataOutputStream(bout);
-   }
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-
-}

Deleted: branches/Branch_Bisocket_Experiment/src/main/org/jboss/jms/server/remoting/ServerSocketWrapper.java
===================================================================
--- branches/Branch_Bisocket_Experiment/src/main/org/jboss/jms/server/remoting/ServerSocketWrapper.java	2007-02-03 02:03:19 UTC (rev 2160)
+++ branches/Branch_Bisocket_Experiment/src/main/org/jboss/jms/server/remoting/ServerSocketWrapper.java	2007-02-03 03:07:54 UTC (rev 2161)
@@ -1,107 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.jboss.jms.server.remoting;
-
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.EOFException;
-import java.io.IOException;
-import java.net.Socket;
-import java.util.Map;
-
-import org.jboss.jms.client.remoting.ClientSocketWrapper;
-import org.jboss.logging.Logger;
-
-/**
- * @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
- * @author <a href="mailto:tom.fox at jboss.com">Tim Fox</a>
- *
- * $Id$
- */
-public class ServerSocketWrapper extends ClientSocketWrapper
-{
-   // Constants -----------------------------------------------------
-
-   final static private Logger log = Logger.getLogger(ServerSocketWrapper.class);
-
-   // Static --------------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   private boolean trace = log.isTraceEnabled();
-
-   // Constructors --------------------------------------------------
-
-   public ServerSocketWrapper(Socket socket) throws Exception
-   {
-      super(socket);
-   }
-
-   public ServerSocketWrapper(Socket socket, Map metadata, Integer timeout) throws Exception
-   {
-      super(socket, metadata, timeout);
-   }
-
-   // Public --------------------------------------------------------
-
-   public void checkConnection() throws IOException
-   {
-      // Perform acknowledgement to convince client that the socket is still active
-      byte ACK = 0;
-
-      try
-      {
-         ACK = ((DataInputStream)getInputStream()).readByte();
-      }
-      catch(EOFException eof)
-      {
-         if (trace)
-         {
-            log.trace("socket timeout is set to: " + getTimeout());
-            log.trace("EOFException waiting on ACK in readByte().");
-         }
-         throw eof;
-      }
-      catch(IOException e)
-      {
-         log.trace("IOException when reading in ACK", e);
-         throw e;
-      }
-
-      if (trace) { log.trace("acknowledge read byte " + Thread.currentThread()); }
-
-      DataOutputStream out = (DataOutputStream)getOutputStream();
-      out.writeByte(ACK);
-      out.flush();
-   }
-
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-
-}




More information about the jboss-cvs-commits mailing list