本文整理汇总了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;
}
}
示例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);
}
}
示例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);
}
}