Skip to content
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

WFLY-17419 Eliminate static references to JSF ResourceDefinition instances #16392

Merged
merged 1 commit into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static StandardResourceDescriptionResolver getResourceDescriptionResolver(final
public void initialize(final ExtensionContext context) {
JSFLogger.ROOT_LOGGER.debug("Activating JSF(Mojarra) Extension");
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
subsystem.registerSubsystemModel(JSFResourceDefinition.INSTANCE);
subsystem.registerSubsystemModel(new JSFResourceDefinition());
subsystem.registerXMLElementWriter(JSFSubsystemParser_1_1.INSTANCE);
}

Expand All @@ -87,7 +87,7 @@ static class JSFSubsystemParser_1_0 extends PersistentResourceXMLParser {
private static final PersistentResourceXMLDescription xmlDescription;

static {
xmlDescription = builder(JSFResourceDefinition.INSTANCE.getPathElement(), NAMESPACE_1_0)
xmlDescription = builder(PATH_SUBSYSTEM, NAMESPACE_1_0)
.addAttributes(JSFResourceDefinition.DEFAULT_JSF_IMPL_SLOT)
.build();
}
Expand All @@ -104,7 +104,7 @@ static class JSFSubsystemParser_1_1 extends PersistentResourceXMLParser {
private static final PersistentResourceXMLDescription xmlDescription;

static {
xmlDescription = builder(JSFResourceDefinition.INSTANCE.getPathElement(), NAMESPACE_1_1)
xmlDescription = builder(PATH_SUBSYSTEM, NAMESPACE_1_1)
.addAttributes(JSFResourceDefinition.DEFAULT_JSF_IMPL_SLOT)
.addAttributes(JSFResourceDefinition.DISALLOW_DOCTYPE_DECL)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ public class JSFResourceDefinition extends PersistentResourceDefinition {
.addRequirements(Capabilities.WELD_CAPABILITY_NAME)
.build();

public static final JSFResourceDefinition INSTANCE = new JSFResourceDefinition();

protected static final SimpleAttributeDefinition DEFAULT_JSF_IMPL_SLOT =
new SimpleAttributeDefinitionBuilder(DEFAULT_SLOT_ATTR_NAME, ModelType.STRING, true)
.setAllowExpression(true)
Expand All @@ -65,7 +63,7 @@ public class JSFResourceDefinition extends PersistentResourceDefinition {
.setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES)
.build();

private JSFResourceDefinition() {
JSFResourceDefinition() {
super(new SimpleResourceDefinition.Parameters(JSFExtension.PATH_SUBSYSTEM, JSFExtension.getResourceDescriptionResolver())
.setAddHandler(JSFSubsystemAdd.INSTANCE)
.setRemoveHandler(ReloadRequiredRemoveStepHandler.INSTANCE)
Expand Down