public interface ExtensionContext
| Modifier and Type | Interface and Description |
|---|---|
static class |
ExtensionContext.ContextType
The various types of contexts in which an
Extension can be asked to initialize. |
| Modifier and Type | Method and Description |
|---|---|
PathManager |
getPathManager()
|
ProcessType |
getProcessType()
Gets the type of the current process.
|
RunningMode |
getRunningMode()
Gets the current running mode of the process.
|
ExtensionContext.ContextType |
getType()
Gets the type of this context.
|
boolean |
isRegisterTransformers()
Deprecated.
|
boolean |
isRuntimeOnlyRegistrationValid()
Gets whether it is valid for the extension to register resources, attributes or operations that do not
involve the persistent configuration, but rather only involve runtime services.
|
default void |
registerExpressionResolverExtension(Supplier<ExpressionResolverExtension> supplier,
Pattern expressionPattern,
boolean requiresRuntimeResolution)
Registers that the extension may provide an
ExpressionResolverExtension if one of its
subsystems is appropriately configured. |
SubsystemRegistration |
registerSubsystem(String name,
int majorVersion,
int minorVersion)
Deprecated.
|
SubsystemRegistration |
registerSubsystem(String name,
int majorVersion,
int minorVersion,
int microVersion)
Deprecated.
|
SubsystemRegistration |
registerSubsystem(String name,
int majorVersion,
int minorVersion,
int microVersion,
boolean deprecated)
Deprecated.
|
SubsystemRegistration |
registerSubsystem(String name,
ModelVersion version)
|
SubsystemRegistration |
registerSubsystem(String name,
ModelVersion version,
boolean deprecated)
Register a new subsystem type.
|
SubsystemRegistration registerSubsystem(String name, ModelVersion version)
name - the name of the subsystemversion - the version of the subsystem's management interface.SubsystemRegistrationIllegalStateException - if the subsystem name has already been registeredSubsystemRegistration registerSubsystem(String name, ModelVersion version, boolean deprecated)
The new subsystem registration must register a handler and description for the
add operation at its root address. The new subsystem registration must register a
remove operation at its root address.
name - the name of the subsystemversion - the version of the subsystem's management interface.deprecated - mark this extension as deprecatedSubsystemRegistrationIllegalStateException - if the subsystem name has already been registered@Deprecated SubsystemRegistration registerSubsystem(String name, int majorVersion, int minorVersion)
registerSubsystem(String, ModelVersion)name - the name of the subsystemmajorVersion - the major version of the subsystem's management interfaceminorVersion - the minor version of the subsystem's management interfaceSubsystemRegistrationIllegalStateException - if the subsystem name has already been registered@Deprecated SubsystemRegistration registerSubsystem(String name, int majorVersion, int minorVersion, int microVersion)
registerSubsystem(String, ModelVersion)
The new subsystem registration must register a handler and description for the
add operation at its root address. The new subsystem registration must register a
remove operation at its root address.
name - the name of the subsystemmajorVersion - the major version of the subsystem's management interfaceminorVersion - the minor version of the subsystem's management interfacemicroVersion - the micro version of the subsystem's management interfaceSubsystemRegistrationIllegalStateException - if the subsystem name has already been registered@Deprecated SubsystemRegistration registerSubsystem(String name, int majorVersion, int minorVersion, int microVersion, boolean deprecated)
registerSubsystem(String, ModelVersion, boolean)
The new subsystem registration must register a handler and description for the
add operation at its root address. The new subsystem registration must register a
remove operation at its root address.
name - the name of the subsystemmajorVersion - the major version of the subsystem's management interfaceminorVersion - the minor version of the subsystem's management interfacemicroVersion - the micro version of the subsystem's management interfacedeprecated - mark this extension as deprecatedSubsystemRegistrationIllegalStateException - if the subsystem name has already been registereddefault void registerExpressionResolverExtension(Supplier<ExpressionResolverExtension> supplier, Pattern expressionPattern, boolean requiresRuntimeResolution)
ExpressionResolverExtension if one of its
subsystems is appropriately configured. Calling this informs the management kernel that the resolver extension
may be installed at some point and provides a supplier via which the resolver extension can be obtained. It also
instructs the management kernel as to how to handle expression strings that might be of interest to the
resolver extension if it were configured.
Once this is invoked, the kernel expression resolver will begin calling the given supplier whenever it
needs to resolve an expression string. If it returns a non-null value, the returned ExpressionResolverExtension
will be invoked to ensure it is initialized and
to try and resolve the expression string.
If the given supplier returns [@code null}, that indicates the resolver extension has not yet been
configured (and perhaps never will be.) The management kernel resolver will however continue to account for the
resolver extension in the following ways:
expressionPatterns. If not
no further action is taken with respect to this resolver extension.OperationContext.Stage.MODEL, an
exception will be thrown. The effect of this is calling this method disables Stage.MODEL resolution
of expressions that match the pattern. Resolving in Stage.MODEL is generally an anti-pattern though, although
there are cases where it is attempted, particular with system-property resources.OperationContext.Stage.MODEL,
the behavior depends on the provided requiresRuntimeResolution parameter. If true, an
exception will be thrown, as the required resolution could not be performed. If false, no
resolution will be attempted and the overall resolution will continue on. Setting this to false allows
expressions that match the pattern but which aren't definitely meant for handling by the resolver extension
to still be processed.Note that if multiple callers register resolver extensions, the management kernel will apply the above logic to each in turn until one provides a resolved string or all have been given an opportunity to try. Only when all have been given an opportunity to try will any exception resulting from one of the attempts be propagated. If none provide a resolved string, but none throw an exception, the expression resolution will move on to trying the core management kernel expression resolution mechanism.
supplier - function to be checked during expression resolution to determine if the resolver extension
is available. Supplier should return null if the resolver extension isn't actually configured
by a subsystem. The supplier itself cannot be null.expressionPattern - if the supplier returns null, the pattern the kernel expression resolver
should use to determine if a given expression string would be of interest to the
resolver extension if it was available.requiresRuntimeResolution - true if the kernel resolver should throw an expression resolution
exception if the supplier returns null, the expression string
to resolves matches the given expressionPattern, and the resolution
is occuring outside of OperationContext.Stage.MODEL.ExtensionContext.ContextType getType()
nullProcessType getProcessType()
nullRunningMode getRunningMode()
nullboolean isRuntimeOnlyRegistrationValid()
PathManager getPathManager()
nullIllegalStateException - if the process is not a server@Deprecated boolean isRegisterTransformers()
ExtensionTransformerRegistration#getProcessType().isHostController() is true and the
process controller is the master domain controller.true if transformers should be registeredCopyright © 2022 JBoss by Red Hat. All rights reserved.