当前位置: 首页>>代码示例>>Java>>正文


Java Module.loadServiceFromCallerModuleLoader方法代码示例

本文整理汇总了Java中org.jboss.modules.Module.loadServiceFromCallerModuleLoader方法的典型用法代码示例。如果您正苦于以下问题:Java Module.loadServiceFromCallerModuleLoader方法的具体用法?Java Module.loadServiceFromCallerModuleLoader怎么用?Java Module.loadServiceFromCallerModuleLoader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.modules.Module的用法示例。


在下文中一共展示了Module.loadServiceFromCallerModuleLoader方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadPlugInProvider

import org.jboss.modules.Module; //导入方法依赖的package包/类
private List<PlugInProvider> loadPlugInProvider(final String name) {
    synchronized (cachedProviders) {
        List<PlugInProvider> response;
        if (cachedProviders.containsKey(name)) {
            response = cachedProviders.get(name);
        } else {
            List<PlugInProvider> providers = new LinkedList<PlugInProvider>();
            try {
                for (PlugInProvider current : Module.loadServiceFromCallerModuleLoader(ModuleIdentifier.fromString(name),
                        PlugInProvider.class)) {
                    providers.add(current);
                }
            } catch (ModuleLoadException e) {
                throw DomainManagementLogger.ROOT_LOGGER.unableToLoadPlugInProviders(name, e.getMessage());
            }
            if (providers.size() > 0) {
                cachedProviders.put(name, providers);
                response = providers;
            } else {
                throw DomainManagementLogger.ROOT_LOGGER.noPlugInProvidersLoaded(name);
            }
        }
        return response;
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:26,代码来源:PlugInLoaderService.java

示例2: initializeExtension

import org.jboss.modules.Module; //导入方法依赖的package包/类
protected void initializeExtension(String module, ManagementResourceRegistration rootRegistration) throws OperationFailedException {
    try {
        for (final Extension extension : Module.loadServiceFromCallerModuleLoader(ModuleIdentifier.fromString(module), Extension.class)) {
            ClassLoader oldTccl = SecurityActions.setThreadContextClassLoader(extension.getClass());
            try {
                extension.initializeParsers(extensionRegistry.getExtensionParsingContext(module, null));
                extension.initialize(extensionRegistry.getExtensionContext(module, rootRegistration, ExtensionRegistryType.SLAVE));
            } finally {
                SecurityActions.setThreadContextClassLoader(oldTccl);
            }
        }
    } catch (ModuleLoadException e) {
        throw DomainControllerLogger.ROOT_LOGGER.failedToLoadModule(e, module);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:16,代码来源:ApplyExtensionsHandler.java

示例3: loadAndRegisterTransformers

import org.jboss.modules.Module; //导入方法依赖的package包/类
public void loadAndRegisterTransformers(String name, ModelVersion subsystemVersion, String extensionModuleName) {
    try {
        SubsystemTransformerRegistration transformerRegistration = new SubsystemTransformerRegistrationImpl(name, subsystemVersion);
        if (Module.getCallerModule() != null) { //only register when running in modular environment, testsuite does its own loading
            for (ExtensionTransformerRegistration registration : Module.loadServiceFromCallerModuleLoader(ModuleIdentifier.fromString(extensionModuleName), ExtensionTransformerRegistration.class)) {
                if (registration.getSubsystemName().equals(name)) { //to prevent registering transformers for different subsystems
                    registration.registerTransformers(transformerRegistration);
                }
            }
        }
    } catch (ModuleLoadException e) {
        throw ControllerLogger.ROOT_LOGGER.couldNotLoadModuleForTransformers(extensionModuleName, e);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:15,代码来源:TransformerRegistry.java


注:本文中的org.jboss.modules.Module.loadServiceFromCallerModuleLoader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。