/** * Create a mock classloading system<p> * * No security problem. A user can create their own classloader system, so what? * * @return the new classloading system */ public static ClassLoaderSystem createMockClassLoaderSystem() { return new DefaultClassLoaderSystem(); }
/** * Create a ClassLoaderSystem with the default ClassLoaderDomain set to use * a AFTER ParentPolicy. * * @return ClassLoaderSystem instance */ public static ClassLoaderSystem getClassLoaderSystem() { DefaultClassLoaderSystem system = new DefaultClassLoaderSystem(); ClassLoaderDomain defaultDomain = system.getDefaultDomain(); defaultDomain.setParentPolicy(ParentPolicy.AFTER); return system; }
/** * Get the classloading system instance * * @return the instance * @throws SecurityException if the caller does not have authority to create a classloader */ public static final ClassLoaderSystem getInstance() { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkCreateClassLoader(); return builder.get(); }
/** * Create a mock classloading system<p> * * No security problem. A user can create their own classloader system, so what? * * @return the new classloading system */ public static ClassLoaderSystem createMockClassLoaderSystem() { return new DefaultClassLoaderSystem(); }
/** * Get the classloading system instance * * @return the instance * @throws SecurityException if the caller does not have authority to create a classloader */ public static final ClassLoaderSystem getInstance() { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkCreateClassLoader(); return ClassLoaderSystemBuilder.get(); }
/** * Initialize the classloader system * * @param clazz the original clazz * @param parentFilter the parent filter * @param policy the policy * @return the clazz loaded from the new classloading system */ public Class<?> initializeClassLoader(Class<?> clazz, ClassFilter parentFilter, ClassLoaderPolicy policy) { ClassLoaderSystem system = new DefaultClassLoaderSystem(); return initializeClassLoader(clazz, system, parentFilter, policy); }
/** * Initialize the classloader system * * @param clazz the original clazz * @param parentFilter the parent filter * @param policy the policy * @return the clazz loaded from the new classloading system */ public Class<?> initializeClassLoader(Class<?> clazz, ClassFilter parentFilter, ClassLoaderPolicy policy) { ClassLoaderSystem system = new DefaultClassLoaderSystem(); return initializeClassLoader(clazz, system, parentFilter, policy); }
/** * Initialize the classloader system * * @param clazz the original clazz * @param policy the policy * @return the clazz loaded from the new classloading system */ public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderPolicy policy) { ClassLoaderSystem system = new DefaultClassLoaderSystem(); return initializeClassLoader(clazz, system, policy, getParentPackages()); }
/** * Initialize the classloader system * * @param clazz the original clazz * @param policy the policy * @return the clazz loaded from the new classloading system */ public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderPolicy policy) { ClassLoaderSystem system = new DefaultClassLoaderSystem(); return initializeClassLoader(clazz, system, policy, getParentPackages()); }