}
else
{
invalidate();
// Destination '{id}' must specify at least one adapter.
ConfigurationException ex = new ConfigurationException();
ex.setMessage(ConfigurationConstants.DEST_NEEDS_ADAPTER, new Object[]{getId()});
throw ex;
}
}
if (channelIds != null)
{
List brokerChannelIds = getService().getMessageBroker().getChannelIds();
for (Iterator iter = channelIds.iterator(); iter.hasNext();)
{
String id = (String) iter.next();
if (brokerChannelIds == null || !brokerChannelIds.contains(id))
{
iter.remove();
if (Log.isWarn())
{
Log.getLogger(getLogCategory()).warn("No channel with id '{0}' is known by the MessageBroker." +
" Removing the channel.",
new Object[]{id});
}
}
}
}
// Set the default channels if needed
if (channelIds == null)
{
List defaultChannelIds = getService().getDefaultChannels();
if (defaultChannelIds != null && defaultChannelIds.size() > 0)
{
setChannels(defaultChannelIds);
}
else
{
invalidate();
// Destination '{id}' must specify at least one channel.
ConfigurationException ex = new ConfigurationException();
ex.setMessage(ConfigurationConstants.DEST_NEEDS_CHANNEL, new Object[]{getId()});
throw ex;
}
}
MessageBroker broker = getService().getMessageBroker();