本文整理汇总了Java中org.jboss.as.controller.Extension.initializeParsers方法的典型用法代码示例。如果您正苦于以下问题:Java Extension.initializeParsers方法的具体用法?Java Extension.initializeParsers怎么用?Java Extension.initializeParsers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.as.controller.Extension
的用法示例。
在下文中一共展示了Extension.initializeParsers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadModule
import org.jboss.as.controller.Extension; //导入方法依赖的package包/类
private XMLStreamException loadModule(final String moduleName, final XMLMapper xmlMapper) throws XMLStreamException {
// Register element handlers for this extension
try {
final Module module = moduleLoader.loadModule(ModuleIdentifier.fromString(moduleName));
boolean initialized = false;
for (final Extension extension : module.loadService(Extension.class)) {
ClassLoader oldTccl = WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(extension.getClass());
try {
extension.initializeParsers(extensionRegistry.getExtensionParsingContext(moduleName, xmlMapper));
} finally {
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldTccl);
}
if (!initialized) {
initialized = true;
}
}
if (!initialized) {
throw ControllerLogger.ROOT_LOGGER.notFound("META-INF/services/", Extension.class.getName(), module.getIdentifier());
}
return null;
} catch (final ModuleLoadException e) {
throw ControllerLogger.ROOT_LOGGER.failedToLoadModule(e);
}
}
示例2: initializeExtension
import org.jboss.as.controller.Extension; //导入方法依赖的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: add
import org.jboss.as.controller.Extension; //导入方法依赖的package包/类
private void add(Extension ext) {
ParsingContext ctx = new ParsingContext();
ext.initializeParsers(ctx);
}