}
if (destinationToKeyMap == null) {
destinationToKeyMap = new HashMap();
}
// Create and initialize a Delegate object for the endpoint
Delegate delegate = new ControllerDelegate((String) entry.getKey(), this);
delegate.setCasProcessTimeout(endpoint.getProcessRequestTimeout());
delegate.setGetMetaTimeout(endpoint.getMetadataRequestTimeout());
delegate.setEndpoint(endpoint);
// Add new delegate to the global Delegate list
delegates.add(delegate);
endpoint.setDelegateKey((String) entry.getKey());
destinationToKeyMap.put(endpoint.getEndpoint(), (String) entry.getKey());
}