[jboss-cvs] JBoss Messaging SVN: r1579 - in branches/Branch_1_0_1_SP: . src/main/org/jboss/jms/client/remoting src/main/org/jboss/jms/server/remoting
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Nov 17 04:12:09 EST 2006
Author: ovidiu.feodorov at jboss.com
Date: 2006-11-17 04:12:05 -0500 (Fri, 17 Nov 2006)
New Revision: 1579
Modified:
branches/Branch_1_0_1_SP/build-thirdparty.xml
branches/Branch_1_0_1_SP/src/main/org/jboss/jms/client/remoting/ClientSocketWrapper.java
branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server/remoting/ServerSocketWrapper.java
Log:
updated the dependency on Remoting 2.2.0.Alpha3
Modified: branches/Branch_1_0_1_SP/build-thirdparty.xml
===================================================================
--- branches/Branch_1_0_1_SP/build-thirdparty.xml 2006-11-17 04:25:14 UTC (rev 1578)
+++ branches/Branch_1_0_1_SP/build-thirdparty.xml 2006-11-17 09:12:05 UTC (rev 1579)
@@ -90,7 +90,7 @@
<componentref name="jboss/common" version="snapshot"/>
<componentref name="jboss/aop" version="1.5.0.GA"/>
<componentref name="jboss/serialization" version="1.0.3.GA"/>
- <componentref name="jboss/remoting" version="2.2.0.Alpha2"/>
+ <componentref name="jboss/remoting" version="2.2.0.Alpha3"/>
<!-- Need this otherwise project doesn't build in Eclipse -->
<componentref name="apache-logging" version="1.0.5.GA-jboss"/>
Modified: branches/Branch_1_0_1_SP/src/main/org/jboss/jms/client/remoting/ClientSocketWrapper.java
===================================================================
--- branches/Branch_1_0_1_SP/src/main/org/jboss/jms/client/remoting/ClientSocketWrapper.java 2006-11-17 04:25:14 UTC (rev 1578)
+++ branches/Branch_1_0_1_SP/src/main/org/jboss/jms/client/remoting/ClientSocketWrapper.java 2006-11-17 09:12:05 UTC (rev 1579)
@@ -39,12 +39,22 @@
/**
* @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
+ *
+ * $Id$
*/
public class ClientSocketWrapper extends SocketWrapper
{
+ // Constants -----------------------------------------------------
+
+ // Static --------------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
private ObjectInputStream in;
private ObjectOutputStream out;
+ // Constructors --------------------------------------------------
+
public ClientSocketWrapper(Socket socket) throws IOException
{
super(socket);
@@ -57,6 +67,33 @@
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.reset();
+ out.writeByte(ACK);
+ out.flush();
+ in.readByte();
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
protected void createStreams(Socket socket, Map metadata) throws IOException
{
@@ -83,36 +120,19 @@
throws IOException
{
BufferedInputStream bin = new BufferedInputStream(socket.getInputStream());
- ObjectInputStream oin = SerializationStreamFactory.getManagerInstance(serializationType).createInput(bin, null);
- return oin;
+ return SerializationStreamFactory.getManagerInstance(serializationType).
+ createInput(bin, null);
}
protected ObjectOutputStream createOutputStream(String serializationType, Socket socket)
throws IOException
{
BufferedOutputStream bout = new BufferedOutputStream(socket.getOutputStream());
- ObjectOutputStream oout = SerializationStreamFactory.getManagerInstance(serializationType).createOutput(bout);
- return oout;
+ return SerializationStreamFactory.getManagerInstance(serializationType).createOutput(bout);
}
- public OutputStream getOutputStream()
- {
- return out;
- }
+ // Private -------------------------------------------------------
- public InputStream getInputStream()
- {
- return in;
- }
+ // Inner classes -------------------------------------------------
- public void checkConnection() throws IOException
- {
- // Test to see if socket is alive by send ACK message
- final byte ACK = 1;
-
- out.reset();
- out.writeByte(ACK);
- out.flush();
- in.readByte();
- }
}
Modified: branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server/remoting/ServerSocketWrapper.java
===================================================================
--- branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server/remoting/ServerSocketWrapper.java 2006-11-17 04:25:14 UTC (rev 1578)
+++ branches/Branch_1_0_1_SP/src/main/org/jboss/jms/server/remoting/ServerSocketWrapper.java 2006-11-17 09:12:05 UTC (rev 1579)
@@ -37,11 +37,23 @@
/**
* @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</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);
@@ -52,39 +64,23 @@
super(socket, metadata, timeout);
}
- protected ObjectInputStream createInputStream(String serializationType, Socket socket) throws IOException
- {
- BufferedInputStream bin = new BufferedInputStream(socket.getInputStream());
- ObjectInputStream oin = SerializationStreamFactory.getManagerInstance(serializationType).createInput(bin, null);
- return oin;
- }
+ // Public --------------------------------------------------------
- protected ObjectOutputStream createOutputStream(String serializationType, Socket socket)
- throws IOException
- {
- BufferedOutputStream bout = new BufferedOutputStream(socket.getOutputStream());
- ObjectOutputStream oout = SerializationStreamFactory.getManagerInstance(serializationType).createOutput(bout);
- oout.flush();
- return oout;
- }
-
public void checkConnection() throws IOException
{
- // Perform acknowledgement to convince client
- // that the socket is still active
+ // Perform acknowledgement to convince client that the socket is still active
byte ACK = 0;
- //long startWait = System.currentTimeMillis();
+
try
{
- ACK = ((ObjectInputStream) getInputStream()).readByte();
+ ACK = ((ObjectInputStream)getInputStream()).readByte();
}
catch(EOFException eof)
{
- if(log.isTraceEnabled())
+ if(trace)
{
- log.trace("socket timeout is set to : " + getTimeout());
+ log.trace("socket timeout is set to: " + getTimeout());
log.trace("EOFException waiting on ACK in readByte().");
- //log.trace("Time waited was " + (System.currentTimeMillis() - startWait));
}
throw eof;
}
@@ -94,14 +90,40 @@
throw e;
}
- if(log.isTraceEnabled())
- {
- log.trace("***acknowledge read byte" + Thread.currentThread());
- }
+ if(trace) { log.trace("acknowledge read byte " + Thread.currentThread()); }
- ObjectOutputStream out = (ObjectOutputStream) getOutputStream();
+ ObjectOutputStream out = (ObjectOutputStream)getOutputStream();
out.writeByte(ACK);
out.flush();
out.reset();
}
+
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ protected ObjectInputStream createInputStream(String serializationType, Socket socket)
+ throws IOException
+ {
+ BufferedInputStream bin = new BufferedInputStream(socket.getInputStream());
+ return SerializationStreamFactory.getManagerInstance(serializationType).
+ createInput(bin, null);
+ }
+
+ protected ObjectOutputStream createOutputStream(String serializationType, Socket socket)
+ throws IOException
+ {
+ BufferedOutputStream bout = new BufferedOutputStream(socket.getOutputStream());
+ ObjectOutputStream oout = SerializationStreamFactory.getManagerInstance(serializationType).
+ createOutput(bout);
+
+ oout.flush();
+ return oout;
+ }
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
}
More information about the jboss-cvs-commits
mailing list