-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WFCORE-6741] [WFCORE-6652] Improve user experience when using extension or namespace of unsupported stability. #5899
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
1641122
WFCORE-6652 Improve user experience when using extension or namespace…
pferraro 791455d
Log warning when encountering extension not enabled by the stabilty l…
pferraro 9e50fa6
WFCORE-6741 ExtensionContext.getStability() always returns Stability.…
pferraro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...ler/src/main/java/org/jboss/as/controller/extension/UnstableSubsystemNamespaceParser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright The WildFly Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.jboss.as.controller.extension; | ||
|
||
import java.util.List; | ||
|
||
import javax.xml.stream.XMLStreamException; | ||
|
||
import org.jboss.as.controller.logging.ControllerLogger; | ||
import org.jboss.dmr.ModelNode; | ||
import org.jboss.staxmapper.XMLElementReader; | ||
import org.jboss.staxmapper.XMLExtendedStreamReader; | ||
|
||
/** | ||
* A placeholder parser for a subsystem namespace not enabled by the stability level of the current process. | ||
*/ | ||
public class UnstableSubsystemNamespaceParser implements XMLElementReader<List<ModelNode>> { | ||
private final String subsystemName; | ||
|
||
public UnstableSubsystemNamespaceParser(String subsystemName) { | ||
this.subsystemName = subsystemName; | ||
} | ||
|
||
@Override | ||
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> value) throws XMLStreamException { | ||
throw ControllerLogger.ROOT_LOGGER.unstableSubsystemNamespace(this.subsystemName, reader.getNamespaceURI()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Autocloseable interface is used to mark objects that could hold resources, here it is used to invoke the ExtensionParsingContext#attemptCurrentParserInitialization(), since the abstract class does nothing on its close() method.
Is that usage correct? It looks inappropriate. I don't see where ExtensionParsingContext#attemptCurrentParserInitialization() was trying to release resources that can justify the movement to an Autocloseable.close() implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.