private void createClass2(ClassLoader cl) { String key = getKey(superClass, interfaces, signature, factoryWriteReplace); /* * Excessive concurrency causes a large memory footprint and slows the * execution speed down (with JDK 1.5). Thus, we use a jumbo lock for * reducing concrrency. */ // synchronized (proxyCache) { HashMap cacheForTheLoader = (HashMap)proxyCache.get(cl); ProxyDetails details; if (cacheForTheLoader == null) { cacheForTheLoader = new HashMap(); proxyCache.put(cl, cacheForTheLoader); } details = (ProxyDetails)cacheForTheLoader.get(key); if (details != null) { WeakReference reference = details.proxyClass; thisClass = (Class)reference.get(); if (thisClass != null) { return; } } createClass3(cl); details = new ProxyDetails(signature, thisClass, factoryWriteReplace); cacheForTheLoader.put(key, details); // } }
private Class createClass1() { Class result = thisClass; if (result == null) { ClassLoader cl = getClassLoader(); synchronized (proxyCache) { if (factoryUseCache) createClass2(cl); else createClass3(cl); result = thisClass; // don't retain any unwanted references thisClass = null; } } return result; }
private void createClass2(ClassLoader cl, Lookup lookup) { String key = getKey(superClass, interfaces, signature, factoryWriteReplace); /* * Excessive concurrency causes a large memory footprint and slows the * execution speed down (with JDK 1.5). Thus, we use a jumbo lock for * reducing concrrency. */ // synchronized (proxyCache) { Map<String,ProxyDetails> cacheForTheLoader = proxyCache.get(cl); ProxyDetails details; if (cacheForTheLoader == null) { cacheForTheLoader = new HashMap<String,ProxyDetails>(); proxyCache.put(cl, cacheForTheLoader); } details = cacheForTheLoader.get(key); if (details != null) { Reference<Class<?>> reference = details.proxyClass; thisClass = reference.get(); if (thisClass != null) { return; } } createClass3(cl, lookup); details = new ProxyDetails(signature, thisClass, factoryWriteReplace); cacheForTheLoader.put(key, details); // } }
private Class<?> createClass1(Lookup lookup) { Class<?> result = thisClass; if (result == null) { ClassLoader cl = getClassLoader(); synchronized (proxyCache) { if (factoryUseCache) createClass2(cl, lookup); else createClass3(cl, lookup); result = thisClass; // don't retain any unwanted references thisClass = null; } } return result; }
private void createClass2(ClassLoader cl) { String key = getKey(superClass, interfaces, signature, factoryWriteReplace); /* * Excessive concurrency causes a large memory footprint and slows the * execution speed down (with JDK 1.5). Thus, we use a jumbo lock for * reducing concrrency. */ // synchronized (proxyCache) { HashMap cacheForTheLoader = (HashMap)proxyCache.get(cl); ProxyDetails details; if (cacheForTheLoader == null) { cacheForTheLoader = new HashMap(); proxyCache.put(cl, cacheForTheLoader); } details = (ProxyDetails)cacheForTheLoader.get(key); if (details != null) { WeakReference reference = details.proxyClass; thisClass = (Class)reference.get(); if (thisClass != null) { return; } } createClass3(cl); details = new ProxyDetails(signature, thisClass, factoryWriteReplace); cacheForTheLoader.put(key, details); // } }
private void createClass2(ClassLoader cl) { String key = getKey(superClass, interfaces, signature, factoryWriteReplace); /* * Excessive concurrency causes a large memory footprint and slows the * execution speed down (with JDK 1.5). Thus, we use a jumbo lock for * reducing concrrency. */ // synchronized (proxyCache) { HashMap cacheForTheLoader = (HashMap)proxyCache.get(cl); ProxyDetails details; if (cacheForTheLoader == null) { cacheForTheLoader = new HashMap(); proxyCache.put(cl, cacheForTheLoader); } details = (ProxyDetails)cacheForTheLoader.get(key); if (details != null) { WeakReference reference = details.proxyClass; thisClass = (Class)reference.get(); if (thisClass != null) { return; } } createClass3(cl); details = new ProxyDetails(signature, thisClass, factoryWriteReplace); cacheForTheLoader.put(key, details); // } }
private void createClass2(ClassLoader cl) { String key = getKey(superClass, interfaces, signature, factoryWriteReplace); /* * Excessive concurrency causes a large memory footprint and slows the * execution speed down (with JDK 1.5). Thus, we use a jumbo lock for * reducing concrrency. */ // synchronized (proxyCache) { HashMap cacheForTheLoader = (HashMap)proxyCache.get(cl); ProxyDetails details; if (cacheForTheLoader == null) { cacheForTheLoader = new HashMap(); proxyCache.put(cl, cacheForTheLoader); } details = (ProxyDetails)cacheForTheLoader.get(key); if (details != null) { WeakReference reference = details.proxyClass; thisClass = (Class)reference.get(); if (thisClass != null) { return; } } createClass3(cl); details = new ProxyDetails(signature, thisClass, factoryWriteReplace); cacheForTheLoader.put(key, details); // } }
private Class createClass1() { if (thisClass == null) { ClassLoader cl = getClassLoader(); synchronized (proxyCache) { if (factoryUseCache) createClass2(cl); else createClass3(cl); } } // don't retain any unwanted references Class result = thisClass; thisClass = null; return result; }
private void createClass2(ClassLoader cl) { String key = getKey(superClass, interfaces, signature, factoryWriteReplace); /* * Excessive concurrency causes a large memory footprint and slows the * execution speed down (with JDK 1.5). Thus, we use a jumbo lock for * reducing concrrency. */ // synchronized (proxyCache) { HashMap cacheForTheLoader = (HashMap)proxyCache.get(cl); ProxyDetails details; if (cacheForTheLoader == null) { cacheForTheLoader = new HashMap(); proxyCache.put(cl, cacheForTheLoader); } details = (ProxyDetails)cacheForTheLoader.get(key); if (details != null) { WeakReference reference = details.proxyClass; thisClass = (Class)reference.get(); if (thisClass != null) { return; } } createClass3(cl); details = new ProxyDetails(signature, thisClass, factoryWriteReplace); cacheForTheLoader.put(key, details); // } }
/** * Generates a proxy class. */ public Class createClass() { if (thisClass == null) { ClassLoader cl = getClassLoader(); synchronized (proxyCache) { if (useCache) createClass2(cl); else createClass3(cl); } } return thisClass; }
private Class createClass1() { if (thisClass == null) { ClassLoader cl = getClassLoader(); synchronized (proxyCache) { if (factoryUseCache) createClass2(cl); else createClass3(cl); } } // don't retain any unwanted references Class result = thisClass; thisClass = null; return result; }
private Class createClass1() { if (thisClass == null) { ClassLoader cl = getClassLoader(); synchronized (proxyCache) { if (factoryUseCache) createClass2(cl); else createClass3(cl); } } // don't retain any unwanted references Class result = thisClass; thisClass = null; return result; }
private Class createClass1() { if (thisClass == null) { ClassLoader cl = getClassLoader(); synchronized (proxyCache) { if (factoryUseCache) createClass2(cl); else createClass3(cl); } } // don't retain any unwanted references Class result = thisClass; thisClass = null; return result; }
createClass3(cl); key.proxyClass = new WeakReference(thisClass);