static ModuleClassLoader getModuleClassLoader(final ModuleLoader loader, final String moduleSpec) throws ModuleLoadException { final Module module = loader.loadModule(ModuleIdentifier.fromString(moduleSpec)); return WildFlySecurityManager.isChecking() ? doPrivileged(new GetModuleClassLoaderAction(module)) : module.getClassLoader(); }
static ModuleClassLoader getModuleClassLoader(final String moduleSpec) throws ModuleLoadException { ModuleLoader loader = Module.getCallerModuleLoader(); final Module module = loader.loadModule(ModuleIdentifier.fromString(moduleSpec)); GetModuleClassLoaderAction action = new GetModuleClassLoaderAction(module); return WildFlySecurityManager.isChecking() ? doPrivileged(action) : action.run(); }
/** * Build this context factory. * * @return the context factory */ public DirContextFactory build() { assertNotBuilt(); if (providerUrl == null) { throw log.noProviderUrlSet(); } if(this.targetModule != null){ if(WildFlySecurityManager.isChecking()){ WildFlySecurityManager.doChecked(new GetModuleClassLoaderAction(this.targetModule)); } else { this.targetClassLoader = this.targetModule.getClassLoader(); } } else { if(WildFlySecurityManager.isChecking()){ WildFlySecurityManager.getClassLoaderPrivileged(this.getClass()); } else { this.targetClassLoader = this.getClass().getClassLoader(); } } built = true; return new SimpleDirContextFactory(); }
private static <T> T internalLoadAndInstantiateFromModule(String moduleId, final Class<T> iface, final String name) throws Exception { ModuleLoader loader = Module.getCallerModuleLoader(); final Module module = loader.loadModule(ModuleIdentifier.fromString(moduleId)); ClassLoader cl = WildFlySecurityManager.isChecking() ? doPrivileged(new GetModuleClassLoaderAction(module)) : module.getClassLoader(); Class<?> clazz = cl.loadClass(name); return iface.cast(clazz.newInstance()); }
private static <T> T internalLoadAndInstantiateFromModule(String moduleId, final Class<T> iface, final String name) throws Exception { ModuleLoader loader = Module.getCallerModuleLoader(); final Module module = loader.loadModule(ModuleIdentifier.fromString(moduleId)); ClassLoader cl = WildFlySecurityManager.isChecking() ? doPrivileged(new GetModuleClassLoaderAction(module)) : module.getClassLoader(); Class<?> clazz = cl.loadClass(name); return iface.cast(clazz.newInstance()); }
static ModuleClassLoader getModuleClassLoader(final ModuleLoader loader, final String moduleSpec) throws ModuleLoadException { final Module module = loader.loadModule(ModuleIdentifier.fromString(moduleSpec)); return WildFlySecurityManager.isChecking() ? doPrivileged(new GetModuleClassLoaderAction(module)) : module.getClassLoader(); }
private ModuleClassLoader getModuleClassLoader(final String moduleSpec) throws ModuleLoadException { ModuleLoader loader = Module.getCallerModuleLoader(); final Module module = loader.loadModule(ModuleIdentifier.fromString(moduleSpec)); return WildFlySecurityManager.isChecking() ? doPrivileged(new GetModuleClassLoaderAction(module)) : module.getClassLoader(); } }
static ModuleClassLoader getModuleClassLoader(final String moduleSpec) throws ModuleLoadException { ModuleLoader loader = Module.getCallerModuleLoader(); final Module module = loader.loadModule(ModuleIdentifier.fromString(moduleSpec)); GetModuleClassLoaderAction action = new GetModuleClassLoaderAction(module); return WildFlySecurityManager.isChecking() ? doPrivileged(action) : action.run(); }
private ModuleClassLoader getModuleClassLoader(final String moduleSpec) throws ModuleLoadException { ModuleLoader loader = Module.getCallerModuleLoader(); final Module module = loader.loadModule(ModuleIdentifier.fromString(moduleSpec)); return WildFlySecurityManager.isChecking() ? doPrivileged(new GetModuleClassLoaderAction(module)) : module.getClassLoader(); } }
/** * Build this context factory. * * @return the context factory */ public DirContextFactory build() { assertNotBuilt(); if (providerUrl == null) { throw log.noProviderUrlSet(); } if(this.targetModule != null){ this.targetClassLoader = doPrivileged(new GetModuleClassLoaderAction(this.targetModule)); } else { this.targetClassLoader = doPrivileged(new GetClassLoaderAction(this.getClass())); } built = true; return new SimpleDirContextFactory(); }
/** * Build this context factory. * * @return the context factory */ public DirContextFactory build() { assertNotBuilt(); if (providerUrl == null) { throw log.noProviderUrlSet(); } if(this.targetModule != null){ if(WildFlySecurityManager.isChecking()){ WildFlySecurityManager.doChecked(new GetModuleClassLoaderAction(this.targetModule)); } else { this.targetClassLoader = this.targetModule.getClassLoader(); } } else { if(WildFlySecurityManager.isChecking()){ WildFlySecurityManager.getClassLoaderPrivileged(this.getClass()); } else { this.targetClassLoader = this.getClass().getClassLoader(); } } built = true; return new SimpleDirContextFactory(); }
/** * Build this context factory. * * @return the context factory */ public DirContextFactory build() { assertNotBuilt(); if (providerUrl == null) { throw log.noProviderUrlSet(); } if(this.targetModule != null){ if(WildFlySecurityManager.isChecking()){ WildFlySecurityManager.doChecked(new GetModuleClassLoaderAction(this.targetModule)); } else { this.targetClassLoader = this.targetModule.getClassLoader(); } } else { if(WildFlySecurityManager.isChecking()){ WildFlySecurityManager.getClassLoaderPrivileged(this.getClass()); } else { this.targetClassLoader = this.getClass().getClassLoader(); } } built = true; return new SimpleDirContextFactory(); }