mirror of https://github.com/apache/activemq.git
Make the call to adapter.getDestinations() only once. git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1344778 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7504bc7a01
commit
30f677e56a
|
@ -318,8 +318,9 @@ public class MultiKahaDBPersistenceAdapter extends DestinationMap implements Per
|
|||
private void registerExistingAdapter(FilteredKahaDBPersistenceAdapter filteredAdapter, File candidate) {
|
||||
KahaDBPersistenceAdapter adapter = adapterFromTemplate(filteredAdapter.getPersistenceAdapter(), candidate.getName());
|
||||
startAdapter(adapter, candidate.getName());
|
||||
if (adapter.getDestinations().size() != 0) {
|
||||
registerAdapter(adapter, adapter.getDestinations().toArray(new ActiveMQDestination[]{})[0]);
|
||||
Set<ActiveMQDestination> destinations = adapter.getDestinations();
|
||||
if (destinations.size() != 0) {
|
||||
registerAdapter(adapter, destinations.toArray(new ActiveMQDestination[]{})[0]);
|
||||
} else {
|
||||
stopAdapter(adapter, candidate.getName());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue