Proxy replaced = null;
if (proxy != null) {
replaced = (Proxy)proxies.put(proxy.getId(), proxy);
// Create a ProxyManagerAdapter around an old style Proxy.
ProxyManager manager = new ProxyManagerAdapter(proxy);
// Store the manager with the specified id.
proxyManagers.put(proxy.getId(), manager);
}