Class ExtensionRegistry


  • public final class ExtensionRegistry
    extends Object
    A registry for information about Extensions to the core application server. In server/standalone mode there will be one extension registry for the whole server process. In domain mode, there will be:
    • One extension registry for extensions in the domain model
    • One extension registry for extension in the host model
    Author:
    Brian Stansberry (c) 2011 Red Hat Inc.
    • Constructor Detail

      • ExtensionRegistry

        public ExtensionRegistry​(ProcessType processType,
                                 RunningModeControl runningModeControl,
                                 ManagedAuditLogger auditLogger,
                                 JmxAuthorizer authorizer,
                                 Supplier<org.wildfly.security.auth.server.SecurityIdentity> securityIdentitySupplier,
                                 RuntimeHostControllerInfoAccessor hostControllerInfoAccessor)
        Constructor
        Parameters:
        processType - the type of the process
        runningModeControl - the process' running mode
        auditLogger - logger for auditing changes
        authorizer - hook for exposing access control information to the JMX subsystem
        hostControllerInfoAccessor - the host controller
      • ExtensionRegistry

        @Deprecated
        public ExtensionRegistry​(ProcessType processType,
                                 RunningModeControl runningModeControl)
        Deprecated.
        Here for core-model-test and subsystem-test backwards compatibility
        Constructor
        Parameters:
        processType - the type of the process
        runningModeControl - the process' running mode
    • Method Detail

      • getExtensionModuleNames

        public Set<String> getExtensionModuleNames()
        Gets the module names of all known Extensions.
        Returns:
        the names. Will not return null
      • getAvailableSubsystems

        public Map<String,​SubsystemInformation> getAvailableSubsystems​(String moduleName)
        Gets information about the subsystems provided by a given Extension.
        Parameters:
        moduleName - the name of the extension's module. Cannot be null
        Returns:
        map of subsystem names to information about the subsystem.
      • initializeParsers

        public final void initializeParsers​(Extension extension,
                                            String moduleName,
                                            org.jboss.staxmapper.XMLMapper xmlMapper)
        Ask the given extension to initialize its parsers. Should be used in preference to calling getExtensionParsingContext(String, XMLMapper) and passing the returned value to Extension#initializeParsers(context) as this method allows the registry to take additional action when the extension is done.
        Parameters:
        extension - the extension. Cannot be null
        moduleName - the name of the extension's module. Cannot be null
        xmlMapper - the XMLMapper handling the extension parsing. Can be null if there won't be any actual parsing (e.g. in a slave Host Controller or in a server in a managed domain)
      • getExtensionContext

        public ExtensionContext getExtensionContext​(String moduleName,
                                                    ManagementResourceRegistration rootRegistration,
                                                    ExtensionRegistryType extensionRegistryType)
        Gets an ExtensionContext for use when handling an add operation for a resource representing an Extension.
        Parameters:
        moduleName - the name of the extension's module. Cannot be null
        rootRegistration - the root management resource registration
        extensionRegistryType - the type of registry we are working on, which has an effect on things like whether extensions get registered etc.
        Returns:
        the ExtensionContext. Will not return null
      • removeExtension

        public void removeExtension​(Resource rootResource,
                                    String moduleName,
                                    ManagementResourceRegistration rootRegistration)
                             throws IllegalStateException
        Cleans up a extension module's subsystems from the resource registration model.
        Parameters:
        rootResource - the model root resource
        moduleName - the name of the extension's module. Cannot be null
        Throws:
        IllegalStateException - if the extension still has subsystems present in rootResource or its children
      • clear

        public void clear()
        Clears the registry to prepare for re-registration (e.g. as part of a reload).
      • recordSubsystemVersions

        public void recordSubsystemVersions​(String moduleName,
                                            org.jboss.dmr.ModelNode subsystems)
        Records the versions of the subsystems associated with the given moduleName as properties in the provided ModelNode. Each subsystem property key will be the subsystem name and the value will be a string composed of the subsystem major version dot appended to its minor version.
        Parameters:
        moduleName - the name of the extension module
        subsystems - a model node of type ModelType.UNDEFINED or type ModelType.OBJECT