/** * @jmx:managed-operation * */ public Object resolveMetaData(Object key) { return metadata.get(key); }
public Class getCachedClass(String classname) { return (Class)classes.get(classname); }
public Class getCachedClass(String classname) { return (Class) classes.get(classname); }
/** Lookup a Class from the repository cache. * @param name the fully qualified class name * @return the cached Class if found, null otherwise */ public Class loadClassFromCache(String name) { Class cls = null; synchronized (classes) { cls = (Class) classes.get(name); } return cls; }
/** * Returns the bit number for the given name. If the name does not exist * a new new bit number for that name is created. * * @param name the name to lookup * @return the bit number for the given name */ private int getBitNumber(Name name) { Integer i = (Integer) nameIndex.get(name); if (i == null) { synchronized (nameIndex) { i = (Integer) nameIndex.get(name); if (i == null) { int idx = nameIndex.size(); i = new Integer(idx); nameIndex.put(name, i); if (idx >= names.length) { Name[] newNames = new Name[names.length * 2]; System.arraycopy(names, 0, newNames, 0, names.length); names = newNames; } names[idx] = name; } } } return i.intValue(); }
/** * Returns the bit number for the given name. If the name does not exist * a new new bit number for that name is created. * * @param name the name to lookup * @return the bit number for the given name */ private int getBitNumber(Name name) { Integer i = (Integer) nameIndex.get(name); if (i == null) { synchronized (nameIndex) { i = (Integer) nameIndex.get(name); if (i == null) { int idx = nameIndex.size(); i = new Integer(idx); nameIndex.put(name, i); if (idx >= names.length) { Name[] newNames = new Name[names.length * 2]; System.arraycopy(names, 0, newNames, 0, names.length); names = newNames; } names[idx] = name; } } } return i.intValue(); }
/** Called by LoadMgr to obtain all class loaders for the given className * @return Set<UnifiedClassLoader3>, may be null */ public Set getPackageClassLoaders(String className) { String pkgName = ClassLoaderUtils.getPackageName(className); // Don't try to load java.* classes, it is impossible if (pkgName.startsWith("java.")) return null; Set pkgSet = (Set) packagesMap.get(pkgName); if (dynamicClassLoaders.size() > 0) { Set<RepositoryClassLoader> newSet = ClassLoaderUtils.newPackageSet(); if(pkgSet != null) newSet.addAll(pkgSet); pkgSet = newSet; pkgSet.addAll(dynamicClassLoaders); } return pkgSet; }
return; Set<RepositoryClassLoader> pkgSet = (Set<RepositoryClassLoader>) packagesMap.get(pkgName); if( pkgSet == null )
public long getNextSequence(Object key) throws SequenceGeneratorException { Sequence seq = (Sequence) map.get(key); if (seq != null) return seq.next(); synchronized (map) { if (!map.containsKey(key)) { if (listener != null) listener.sequenceCreatedFor(key); map.put(key, (seq = new SimpleSequence())); } else { seq = (Sequence) map.get(key); } } return seq.next(); }
/** * Provides the same functionality as {@link java.net.URLClassLoader#getResource}. */ public URL getResourceLocally(String name) { URL resURL = (URL) resourceCache.get(name); if (resURL != null) return resURL; if (isResourceBlackListed(name)) return null; resURL = super.getResource(name); if( log.isTraceEnabled() == true ) log.trace("getResourceLocally("+this+"), name="+name+", resURL:"+resURL); if (resURL == null) addToResourceBlackList(name); else resourceCache.put(name, resURL); return resURL; }
log.trace("loaderKey = " + loaderKey); log.trace("filePath = " + filePath); ClassLoader loader = (ClassLoader) loaderMap.get(loaderKey);
Set pkgSet = (Set) this.packagesMap.get(pkgName); if (pkgSet != null)
Set pkgSet = (Set) packagesMap.get(pkgName); if (pkgSet != null)