Author: clebert.suconic(a)jboss.com
Date: 2011-04-04 14:45:27 -0400 (Mon, 04 Apr 2011)
New Revision: 10444
Modified:
branches/Branch_2_2_EAP/build-hornetq.xml
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/utils/InflaterReader.java
branches/Branch_2_2_EAP/src/main/org/hornetq/utils/InflaterWriter.java
Log:
JBPAPP-6240 - Fixing HQ JDK 1.5 client API
Modified: branches/Branch_2_2_EAP/build-hornetq.xml
===================================================================
--- branches/Branch_2_2_EAP/build-hornetq.xml 2011-04-04 18:44:51 UTC (rev 10443)
+++ branches/Branch_2_2_EAP/build-hornetq.xml 2011-04-04 18:45:27 UTC (rev 10444)
@@ -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:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-04-04
18:44:51 UTC (rev 10443)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ServerLocatorImpl.java 2011-04-04
18:45:27 UTC (rev 10444)
@@ -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: branches/Branch_2_2_EAP/src/main/org/hornetq/utils/InflaterReader.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/utils/InflaterReader.java 2011-04-04
18:44:51 UTC (rev 10443)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/utils/InflaterReader.java 2011-04-04
18:45:27 UTC (rev 10444)
@@ -62,7 +62,9 @@
}
catch (DataFormatException e)
{
- throw new IOException(e);
+ IOException e2 = new IOException(e.getMessage());
+ e2.initCause(e);
+ throw e2;
}
}
Modified: branches/Branch_2_2_EAP/src/main/org/hornetq/utils/InflaterWriter.java
===================================================================
--- branches/Branch_2_2_EAP/src/main/org/hornetq/utils/InflaterWriter.java 2011-04-04
18:44:51 UTC (rev 10443)
+++ branches/Branch_2_2_EAP/src/main/org/hornetq/utils/InflaterWriter.java 2011-04-04
18:45:27 UTC (rev 10444)
@@ -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;
}
}
}