Author: pferraro
Date: 2008-09-25 11:35:33 -0400 (Thu, 25 Sep 2008)
New Revision: 1904
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
Log:
Create socket and i/o streams atomically
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
===================================================================
---
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-09-25
15:12:06 UTC (rev 1903)
+++
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-09-25
15:35:33 UTC (rev 1904)
@@ -947,6 +947,8 @@
{
this.socket = this.socketFactory.createSocket(this.address, this.port);
this.socket.setSoTimeout(this.socketTimeout);
+ this.reader = new BufferedReader(new
InputStreamReader(this.socket.getInputStream()));
+ this.writer = new BufferedWriter(new
OutputStreamWriter(this.socket.getOutputStream()));
}
return this.socket;
}
@@ -954,24 +956,16 @@
/**
* Convenience method that returns a reader to the proxy.
*/
- synchronized BufferedReader getConnectionReader() throws IOException
+ BufferedReader getConnectionReader()
{
- if (this.reader == null)
- {
- this.reader = new BufferedReader(new
InputStreamReader(this.getConnection().getInputStream()));
- }
return this.reader;
}
/**
* Convenience method that returns a writer to the proxy.
*/
- synchronized BufferedWriter getConnectionWriter() throws IOException
+ BufferedWriter getConnectionWriter()
{
- if (this.writer == null)
- {
- this.writer = new BufferedWriter(new
OutputStreamWriter(this.getConnection().getOutputStream()));
- }
return this.writer;
}
Show replies by date