@Override public Module loadModule(ModuleIdentifier identifier) { try { return module.getModule(identifier); } catch (Throwable t) { throw new IllegalArgumentException(t); } }
@Override public Module loadModule(ModuleIdentifier identifier) { try { return module.getModule(identifier); } catch (Throwable t) { throw new IllegalArgumentException(t); } }
@Override public Module loadModule(ModuleIdentifier identifier) { try { return module.getModule(identifier); } catch (Throwable t) { throw new IllegalArgumentException(t); } }
/** * Get the module with the given identifier from the module loader used by this module. * * @param identifier the module identifier * @return the module * @throws ModuleLoadException if an error occurs * @deprecated Use {@link #getModule(String)} instead. */ @Deprecated public Module getModule(final ModuleIdentifier identifier) throws ModuleLoadException { return getModule(identifier.toString()); }
static ClassLoader resolveClassLoader(String module) throws ModuleLoadException { Module current = Module.getCallerModule(); if (module != null && current != null) { ModuleIdentifier mi = ModuleIdentifier.fromString(module); current = current.getModule(mi); } return current != null ? current.getClassLoader() : ClassLoadingAttributeDefinitions.class.getClassLoader(); }
private static java.security.Permission createPermission(Permission permission) throws StartException { Module currentModule = Module.getCallerModule(); if (permission.getModule() != null && currentModule != null) { ModuleIdentifier mi = ModuleIdentifier.fromString(permission.getModule()); try { currentModule = currentModule.getModule(mi); } catch (ModuleLoadException e) { // If we cannot load it, it can never be checked. throw ElytronSubsystemMessages.ROOT_LOGGER.invalidPermissionModule(permission.getModule(), e); } } ClassLoader classLoader = currentModule != null ? currentModule.getClassLoader() : PermissionMapperDefinitions.class.getClassLoader(); try { return PermissionUtil.createPermission(classLoader, permission.getClassName(), permission.getTargetName(), permission.getAction()); } catch (InvalidPermissionClassException e) { throw ElytronSubsystemMessages.ROOT_LOGGER.invalidPermissionClass(permission.getClassName()); } catch (Throwable e) { throw ElytronSubsystemMessages.ROOT_LOGGER.exceptionWhileCreatingPermission(permission.getClassName(), e); } }
ModuleIdentifier mi = ModuleIdentifier.create(moduleName); module = cm.getModule(mi); } catch (ModuleLoadException e) { throw ElytronSubsystemMessages.ROOT_LOGGER.unableToLoadModule(moduleName, e);