public interface ExpressionResolverExtension
ExpressionResolver by handling
expression strings in formats not understood by the expression resolver.
Extension expressions must be of the form ${extensionidentifier::someextensionspecificdetails}, where
extensionidentifier is some string that identifies the desired extension. All resolver extensions in
a process must have unique identifiers. Best practice is for subsystems that register extensions to allow end user
configuration control over the identifier so they can provide non-conflicting identifiers. The
someextensionspecificdetails part of the expression is an opaque string understood by the relevant
resolver extension.
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
EXTENSION_EXPRESSION_PATTERN
A
Pattern that strings must match for any ExpressionResolverExtension to handle them. |
| Modifier and Type | Method and Description |
|---|---|
void |
initialize(OperationContext context)
Initialize the extension using the given
OperationContext. |
String |
resolveExpression(String expression,
OperationContext context)
Resolve a given simple expression string, returning
null if the string is not of a form
recognizable to the plugin. |
void initialize(OperationContext context) throws OperationFailedException
OperationContext. May be called multiple times
for a given extension, so extensions should handle that appropriately. Note that this method
may be invoked in OperationContext.Stage#MODEL. Implementations are not required to support initialization
in [@code OperationContext.Stage.MODEL} but should throw ExpressionResolver.ExpressionResolutionServerException
if they do not.context - the OperationContext. Will not be nullOperationFailedException - if a problem initializing occurs that indicates a user mistake
(e.g. an improper configuration of a resource used by the extension.)
Do not use for non-user-driven problems; use runtime exceptions for those.
Throwing a runtime exception that implements OperationClientException
is also a valid way to handle user mistakes.ExpressionResolver.ExpressionResolutionServerException - if a non-user-driven
problem occurs, including an invocation during OperationContext.Stage#MODEL
if that is not supported.String resolveExpression(String expression, OperationContext context)
null if the string is not of a form
recognizable to the plugin.
Note: A thread invoking this method must immediately precede the invocation with a call to
initialize(OperationContext).
expression - a string that matches EXTENSION_EXPRESSION_PATTERN and that does not have
any substrings that match that pattern.context - the current OperationContext to provide additional contextual information.null if expression is not of a
form understood by the plugin.ExpressionResolver.ExpressionResolutionUserException - if expression is a form understood by the plugin but in some
way is unacceptable. This should only be thrown due to flaws in the
provided expression or the configuration of resources used by
the resolver extension, which are 'user' problems. It should not
be used for internal problems in the resolver extension.ExpressionResolver.ExpressionResolutionServerException - if some other internal expression resolution failure occurs.Copyright © 2022 JBoss by Red Hat. All rights reserved.