[hornetq-commits] JBoss hornetq SVN: r8531 - trunk/src/main/org/hornetq/core/client/impl.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Dec 3 11:16:24 EST 2009
Author: timfox
Date: 2009-12-03 11:16:23 -0500 (Thu, 03 Dec 2009)
New Revision: 8531
Modified:
trunk/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
Log:
fix to clientsessionfactoryimpl
Modified: trunk/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2009-12-03 16:12:38 UTC (rev 8530)
+++ trunk/src/main/org/hornetq/core/client/impl/ClientSessionFactoryImpl.java 2009-12-03 16:16:23 UTC (rev 8531)
@@ -267,8 +267,7 @@
private synchronized void initialise() throws Exception
{
if (!readOnly)
- {
- readOnly = true;
+ {
setThreadPools();
instantiateLoadBalancingPolicy();
@@ -315,6 +314,7 @@
{
throw new IllegalStateException("Before using a session factory you must either set discovery address and port or " + "provide some static transport configuration");
}
+ readOnly = true;
}
}
@@ -1093,19 +1093,16 @@
{
throw new IllegalStateException("Cannot create session, factory is closed (maybe it has been garbage collected)");
}
-
- if (!readOnly)
+
+ try
{
- try
- {
- initialise();
- }
- catch (Exception e)
- {
- throw new HornetQException(HornetQException.INTERNAL_ERROR, "Failed to initialise session factory", e);
- }
+ initialise();
}
-
+ catch (Exception e)
+ {
+ throw new HornetQException(HornetQException.INTERNAL_ERROR, "Failed to initialise session factory", e);
+ }
+
if (discoveryGroup != null && !receivedBroadcast)
{
boolean ok = discoveryGroup.waitForBroadcast(discoveryInitialWaitTimeout);
More information about the hornetq-commits
mailing list