Author: clebert.suconic(a)jboss.com
Date: 2011-04-04 14:44:51 -0400 (Mon, 04 Apr 2011)
New Revision: 10443
Modified:
trunk/build-hornetq.xml
trunk/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
trunk/src/main/org/hornetq/utils/InflaterReader.java
trunk/src/main/org/hornetq/utils/InflaterWriter.java
Log:
client JDK 1.5 API fixes
Modified: trunk/build-hornetq.xml
===================================================================
--- trunk/build-hornetq.xml 2011-04-04 16:29:19 UTC (rev 10442)
+++ trunk/build-hornetq.xml 2011-04-04 18:44:51 UTC (rev 10443)
@@ -34,6 +34,8 @@
<property file="build-hornetq.properties" />
+ <property name="jdk5.home" value="${java.home}/../"/>
+
<!--
========================================================================================
-->
<!-- Module name(s) & version
-->
<!--
========================================================================================
-->
@@ -499,7 +501,7 @@
includeAntRuntime="${javac.include.ant.runtime}"
includeJavaRuntime="${javac.include.java.runtime}"
encoding="${javac.encoding}"
- failonerror="${javac.fail.onerror}">
+ failonerror="${javac.fail.onerror}" fork="true"
executable="${jdk5.home}/bin/javac">
<src>
<pathelement path="${build.src.dir}"/>
<pathelement path="${src.main.dir}"/>
Modified: trunk/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-04-04 16:29:19
UTC (rev 10442)
+++ trunk/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-04-04 18:44:51
UTC (rev 10443)
@@ -1344,10 +1344,17 @@
try
{
- List<Future<ClientSessionFactory>> futures =
threadPool.invokeAll(connectors);
- for (int i = 0, futuresSize = futures.size(); i < futuresSize; i++)
+
+ List<Future<ClientSessionFactory>> futuresList = new
ArrayList<Future<ClientSessionFactory>>();
+
+ for (Connector conn : connectors)
{
- Future<ClientSessionFactory> future = futures.get(i);
+ futuresList.add(threadPool.submit(conn));
+ }
+
+ for (int i = 0, futuresSize = futuresList.size(); i < futuresSize; i++)
+ {
+ Future<ClientSessionFactory> future = futuresList.get(i);
try
{
csf = future.get();
@@ -1364,7 +1371,7 @@
throw new HornetQException(HornetQException.NOT_CONNECTED, "Failed to
connect to any static connectors");
}
}
- catch (InterruptedException e)
+ catch (Exception e)
{
throw new HornetQException(HornetQException.NOT_CONNECTED, "Failed to
connect to any static connectors", e);
}
Modified: trunk/src/main/org/hornetq/utils/InflaterReader.java
===================================================================
--- trunk/src/main/org/hornetq/utils/InflaterReader.java 2011-04-04 16:29:19 UTC (rev
10442)
+++ trunk/src/main/org/hornetq/utils/InflaterReader.java 2011-04-04 18:44:51 UTC (rev
10443)
@@ -62,7 +62,9 @@
}
catch (DataFormatException e)
{
- throw new IOException(e);
+ IOException e2 = new IOException(e.getMessage());
+ e2.initCause(e);
+ throw e2;
}
}
Modified: trunk/src/main/org/hornetq/utils/InflaterWriter.java
===================================================================
--- trunk/src/main/org/hornetq/utils/InflaterWriter.java 2011-04-04 16:29:19 UTC (rev
10442)
+++ trunk/src/main/org/hornetq/utils/InflaterWriter.java 2011-04-04 18:44:51 UTC (rev
10443)
@@ -65,7 +65,9 @@
}
catch (DataFormatException e)
{
- throw new IOException("Error decompressing data", e);
+ IOException ie = new IOException ("Error decompressing data");
+ ie.initCause(e);
+ throw ie;
}
}
}
@@ -88,7 +90,9 @@
}
catch (DataFormatException e)
{
- throw new IOException(e);
+ IOException io = new IOException (e.getMessage());
+ io.initCause(e);
+ throw io;
}
}
}