Fixes NPE that was occurring.

This commit is contained in:
Hiram Chirino 2013-09-27 04:51:11 -04:00
parent 21fe8cac7d
commit 70c698f988
1 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ import java.util.*;
* *
* @org.apache.xbean.XBean element="mKahaDB" * @org.apache.xbean.XBean element="mKahaDB"
*/ */
public class MultiKahaDBPersistenceAdapter extends LockableServiceSupport implements PersistenceAdapter { public class MultiKahaDBPersistenceAdapter extends LockableServiceSupport implements PersistenceAdapter, BrokerServiceAware {
static final Logger LOG = LoggerFactory.getLogger(MultiKahaDBPersistenceAdapter.class); static final Logger LOG = LoggerFactory.getLogger(MultiKahaDBPersistenceAdapter.class);
final static ActiveMQDestination matchAll = new AnyDestination(new ActiveMQDestination[]{new ActiveMQQueue(">"), new ActiveMQTopic(">")}); final static ActiveMQDestination matchAll = new AnyDestination(new ActiveMQDestination[]{new ActiveMQQueue(">"), new ActiveMQTopic(">")});
@ -438,12 +438,12 @@ public class MultiKahaDBPersistenceAdapter extends LockableServiceSupport implem
@Override @Override
public void setBrokerService(BrokerService brokerService) { public void setBrokerService(BrokerService brokerService) {
this.brokerService = brokerService;
for (PersistenceAdapter persistenceAdapter : adapters) { for (PersistenceAdapter persistenceAdapter : adapters) {
if( persistenceAdapter instanceof BrokerServiceAware ) { if( persistenceAdapter instanceof BrokerServiceAware ) {
((BrokerServiceAware)persistenceAdapter).setBrokerService(getBrokerService()); ((BrokerServiceAware)persistenceAdapter).setBrokerService(getBrokerService());
} }
} }
this.brokerService = brokerService;
} }
public BrokerService getBrokerService() { public BrokerService getBrokerService() {