Examples of WeakIdentityMap


Examples of com.sun.jini.collection.WeakIdentityMap

     * 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);
  }
    }
View Full Code Here

Examples of com.sun.jini.collection.WeakIdentityMap

     * 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);
  }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.