Author: clebert.suconic(a)jboss.com
Date: 2011-11-18 17:13:21 -0500 (Fri, 18 Nov 2011)
New Revision: 11719
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/recovery/AS7RecoveryRegistry.java
Log:
getXAResourceRecovery shouldn't NPE if module wasn't setup yet
Modified:
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/recovery/AS7RecoveryRegistry.java
===================================================================
---
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/recovery/AS7RecoveryRegistry.java 2011-11-18
22:11:50 UTC (rev 11718)
+++
branches/Branch_2_2_AS7/src/main/org/hornetq/integration/jboss/recovery/AS7RecoveryRegistry.java 2011-11-18
22:13:21 UTC (rev 11719)
@@ -21,7 +21,6 @@
*/
package org.hornetq.integration.jboss.recovery;
-
import org.hornetq.jms.server.recovery.HornetQResourceRecovery;
import org.hornetq.jms.server.recovery.RecoveryRegistry;
import org.jboss.msc.service.ServiceName;
@@ -36,6 +35,7 @@
public class AS7RecoveryRegistry implements RecoveryRegistry
{
public static final ServiceName RECOVERY_MANAGER =
ServiceName.JBOSS.append("txn").append("ArjunaRecoveryManager");
+
public static volatile ServiceContainer container;
private XAResourceRecoveryRegistry registry;
@@ -61,8 +61,15 @@
private static XAResourceRecoveryRegistry getXAResourceRecoveryRegistry()
{
- @SuppressWarnings("unchecked")
- ServiceController<XAResourceRecoveryRegistry> service =
(ServiceController<XAResourceRecoveryRegistry>)
container.getService(RECOVERY_MANAGER);
- return service == null ? null : service.getValue();
+ if (container == null)
+ {
+ return null;
+ }
+ else
+ {
+ @SuppressWarnings("unchecked")
+ ServiceController<XAResourceRecoveryRegistry> service =
(ServiceController<XAResourceRecoveryRegistry>)
container.getService(RECOVERY_MANAGER);
+ return service == null ? null : service.getValue();
+ }
}
}
Show replies by date