List channelIds = destination.getChannels();
if (clusterId == null)
clusterId = getDefaultClusterId();
ClusterSettings cls = (ClusterSettings) clusterSettings.get(clusterId);
if (cls == null)
{
ClusterException ce = new ClusterException();
ce.setMessage(10217, new Object[] {destination.getId(), clusterId});
throw ce;
}
for (Iterator iter=channelIds.iterator(); iter.hasNext();)
{
String channelId = (String)iter.next();
Endpoint endpoint = broker.getEndpoint(channelId);
String endpointUrl = endpoint.getUrl();
int endpointPort = endpoint.getPort();
// This is only an error if we are using client side url-based load balancing. If
// there is a HW load balancer, then we can assume the server.name served up by the
// SWF can be used to access the cluster members. With client side load balancing,
// the clients need the direct URLs of all of the servers.
if (cls.getURLLoadBalancing())
{
// Ensure that the endpoint URI does not contain any replacement tokens.
int tokenStart = endpointUrl.indexOf("{");
if (tokenStart != -1)
{