public String listPolicyDetails() { return policy.toLongString(); }
public void clearBlackList(String name) { if (blackList != null) { boolean trace = log.isTraceEnabled(); if (trace) log.trace(this + " removing from blacklist " + name); blackList.remove(name); policy.clearBlackList(name); } }
/** * Get the system classloader * * @return the classloader */ private ClassLoader getSystemClassLoader() { SecurityManager sm = System.getSecurityManager(); if (sm == null) return ClassLoader.getSystemClassLoader(); return AccessController.doPrivileged(GetSystemClassLoader.INSTANCE, getAccessControlContext()); }
@Override protected void toLongString(StringBuilder builder) { builder.append(" delegates=").append(getDelegates()); String[] packageNames = getPackageNames(); if (packageNames != null) builder.append(" exported=").append(Arrays.asList(packageNames)); boolean importAll = isImportAll(); if (importAll) builder.append(" <IMPORT-ALL>"); }
/** * Get the resource as a stream<p> * * Uses {@link #getResource(String)} by default * * @param path the path * @return the stream or null if not found */ public InputStream getResourceAsStream(String path) { URL url = getResource(path); if (url != null) { try { return url.openStream(); } catch (IOException e) { log.debug("Unable to open URL: " + url + " for path " + path + " from " + toLongString()); } } return null; }
BaseDelegateLoader exported = policy.getExported(); if (exported != null && exported.getPolicy() == null) throw new IllegalStateException("The exported delegate " + exported + " is too lazy for " + policy.toLongString()); String[] packageNames = policy.getPackageNames(); if (packageNames != null && info.getExported() != null) ClassLoaderCache cache = policy.getCache(); if (cache != null) cache.flushCaches();
BaseDelegateLoader exported = policy.getExported(); if (exported != null && exported.getPolicy() == null) throw new IllegalStateException("The exported delegate " + exported + " is too lazy for " + policy.toLongString()); String[] packageNames = policy.getPackageNames(); if (packageNames != null && info.getExported() != null)
@Override protected DelegateLoader getExported() { if (getExportAll() != null) return new FilteredDelegateLoader(this, ClassFilter.EVERYTHING); return super.getExported(); }
public Set<String> listExportedPackages() { HashSet<String> result = new HashSet<String>(); String[] packageNames = policy.getPackageNames(); if (packageNames != null) Collections.addAll(result, packageNames); return result; }
public String getName() { return policy.getName(); }
public ObjectName getObjectName() { return policy.getObjectName(); }
/** * Get the package information for a class<p> * * The default is to invoke getPackageInformation for the class's package * * @param className name the class name * @param packageName the package information * @return the information or null if there is none */ public PackageInformation getClassPackageInformation(String className, String packageName) { return getPackageInformation(packageName); }
PackageInformation pi = policy.getClassPackageInformation(className, packageName);
@Override protected void toLongString(StringBuilder builder) { List<? extends DelegateLoader> delegates = getDelegates(); if (delegates != null && delegates.isEmpty() == false) { builder.append(" delegates=["); boolean first = true; for (DelegateLoader delegate : delegates) { if (first == false) builder.append(','); first = false; builder.append(delegate.toLongString()); } builder.append(']'); } String[] packageNames = getPackageNames(); if (packageNames != null) builder.append(" exported=").append(Arrays.asList(packageNames)); boolean importAll = isImportAll(); if (importAll) builder.append(" <IMPORT-ALL>"); }
/** * Get the resource as a stream<p> * * Uses {@link #getResource(String)} by default * * @param path the path * @return the stream or null if not found */ public InputStream getResourceAsStream(String path) { URL url = getResource(path); if (url != null) { try { return url.openStream(); } catch (IOException e) { log.debug("Unable to open URL: " + url + " for path " + path + " from " + toLongString()); } } return null; }
@Override public DelegateLoader getExported() { if (getExportAll() != null) return new FilteredDelegateLoader(this, ClassFilterUtils.EVERYTHING); return super.getExported(); }
public Set<String> listExportedPackages() { HashSet<String> result = new HashSet<String>(); String[] packageNames = policy.getPackageNames(); if (packageNames != null) Collections.addAll(result, packageNames); return result; }
public String getName() { return policy.getName(); }
public ObjectName getObjectName() { return policy.getObjectName(); }
/** * Get the package information for a class<p> * * The default is to invoke getPackageInformation for the class's package * * @param className name the class name * @param packageName the package information * @return the information or null if there is none */ public PackageInformation getClassPackageInformation(String className, String packageName) { return getPackageInformation(packageName); }