*
* @param topics the topics to configure
*/
protected void configureTopics(AdministeredTopic[] topics) {
for (int i = 0; i < topics.length; ++i) {
final AdministeredTopic topic = topics[i];
final String name = topics[i].getName();
if (_destinations.getDestination(name) == null) {
final JmsTopic destination = new JmsTopic(name);
destination.setPersistent(true);
try {
_destinations.createDestination(destination);
// register the subscribers for each topic.
int scount = topic.getSubscriberCount();
for (int sindex = 0; sindex < scount; sindex++) {
Subscriber subscriber = topic.getSubscriber(sindex);
_consumers.subscribe(destination,
subscriber.getName(), null);
}
} catch (JMSException exception) {
_log.error("Failed to register persistent topic " + name,