* method with the same name and parameter types as m that does not
* declare RemoteException or a superclass in its throws clause, or if
* any superinterface of c has its name in prohibitedProxyInterfaces.
*/
public static void checkProxyRemoteMethod(Class c, Method m) {
WeakIdentityMap map;
synchronized (proxyRemoteMethodCache) {
SoftReference ref = (SoftReference) proxyRemoteMethodCache.get(c);
map = (ref == null) ? null : (WeakIdentityMap) ref.get();
if (map == null && ref != null) {
map = new WeakIdentityMap();
proxyRemoteMethodCache.put(c, new SoftReference(map));
}
}
if (map == null) {
checkProhibitedProxyInterfaces(c);
synchronized (proxyRemoteMethodCache) {
SoftReference ref =
(SoftReference) proxyRemoteMethodCache.get(c);
map = (ref == null) ? null : (WeakIdentityMap) ref.get();
if (map == null) {
map = new WeakIdentityMap();
proxyRemoteMethodCache.put(c, new SoftReference(map));
}
}
}
synchronized (map) {
if (map.get(m) != null) {
return;
}
}
checkExceptions(c, m.getName(), m.getParameterTypes());
synchronized (map) {
map.put(m, Boolean.TRUE);
}
}