Java Code Examples for org.jboss.as.controller.Extension#initializeParsers()

The following examples show how to use org.jboss.as.controller.Extension#initializeParsers() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ApplyExtensionsHandler.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
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);
    }
}
 
Example 2
Source File: StandaloneXMLParserProducer.java    From thorntail with Apache License 2.0 4 votes vote down vote up
private void add(Extension ext) {
    ParsingContext ctx = new ParsingContext();
    ext.initializeParsers(ctx);
}
 
Example 3
Source File: ExtensionRegistry.java    From wildfly-core with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * Ask the given {@code extension} to
 * {@link Extension#initializeParsers(ExtensionParsingContext) initialize its parsers}. Should be used in
 * preference to calling {@link #getExtensionParsingContext(String, XMLMapper)} and passing the returned
 * value to {@code Extension#initializeParsers(context)} as this method allows the registry to take
 * additional action when the extension is done.
 *
 * @param extension  the extension. Cannot be {@code null}
 * @param moduleName the name of the extension's module. Cannot be {@code null}
 * @param xmlMapper  the {@link XMLMapper} handling the extension parsing. Can be {@code null} if there won't
 *                   be any actual parsing (e.g. in a slave Host Controller or in a server in a managed domain)
 */
public final void initializeParsers(final Extension extension, final String moduleName, final XMLMapper xmlMapper) {
    ExtensionParsingContextImpl parsingContext = new ExtensionParsingContextImpl(moduleName, xmlMapper);
    extension.initializeParsers(parsingContext);
    parsingContext.attemptCurrentParserInitialization();
}