-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate IO subsystem to SubsystemResourceXMLSchema.
- Loading branch information
Showing
12 changed files
with
69 additions
and
47 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,7 @@ | |
|
||
import org.jboss.as.controller.OperationContext; | ||
import org.jboss.as.controller.OperationFailedException; | ||
import org.jboss.as.controller.PathElement; | ||
import org.jboss.as.controller.ResourceDefinition; | ||
import org.jboss.as.controller.ResourceRegistration; | ||
import org.jboss.as.controller.SubsystemRegistration; | ||
import org.jboss.as.controller.capability.RuntimeCapability; | ||
import org.jboss.as.controller.descriptions.ParentResourceDescriptionResolver; | ||
|
@@ -38,28 +36,26 @@ | |
/** | ||
* @author <a href="mailto:[email protected]">Tomaz Cerar</a> (c) 2013 Red Hat Inc. | ||
*/ | ||
class IOSubsystemRegistrar implements SubsystemResourceDefinitionRegistrar, ResourceServiceConfigurator { | ||
class IOSubsystemResourceRegistrar implements SubsystemResourceDefinitionRegistrar, ResourceServiceConfigurator { | ||
|
||
static final String NAME = "io"; | ||
static final PathElement PATH = SubsystemResourceDefinitionRegistrar.pathElement(NAME); | ||
static final ParentResourceDescriptionResolver RESOLVER = new SubsystemResourceDescriptionResolver(NAME, IOSubsystemRegistrar.class); | ||
|
||
static final RuntimeCapability<Void> MAX_THREADS_CAPABILITY = RuntimeCapability.Builder.of(IOServiceDescriptor.MAX_THREADS).build(); | ||
static final ParentResourceDescriptionResolver RESOLVER = new SubsystemResourceDescriptionResolver(IOSubsystemResourceRegistration.INSTANCE.getName(), IOSubsystemResourceRegistrar.class); | ||
|
||
static final RuntimeCapability<Void> DEFAULT_WORKER_CAPABILITY = RuntimeCapability.Builder.of(IOServiceDescriptor.DEFAULT_WORKER).build(); | ||
|
||
static final ModelNode LEGACY_DEFAULT_WORKER = new ModelNode("default"); | ||
|
||
static final CapabilityReferenceAttributeDefinition<XnioWorker> DEFAULT_WORKER = new CapabilityReferenceAttributeDefinition.Builder<>("default-worker", CapabilityReference.builder(DEFAULT_WORKER_CAPABILITY, IOServiceDescriptor.NAMED_WORKER).build()) | ||
.setRequired(false) | ||
.build(); | ||
|
||
static final RuntimeCapability<Void> MAX_THREADS_CAPABILITY = RuntimeCapability.Builder.of(IOServiceDescriptor.MAX_THREADS).build(); | ||
|
||
static final ModelNode LEGACY_DEFAULT_WORKER = new ModelNode("default"); | ||
|
||
// Tracks max-threads for all workers | ||
private final AtomicInteger maxThreads = new AtomicInteger(); | ||
|
||
@Override | ||
public ManagementResourceRegistration register(SubsystemRegistration parent, ManagementResourceRegistrationContext context) { | ||
ManagementResourceRegistration registration = parent.registerSubsystemModel(ResourceDefinition.builder(ResourceRegistration.of(PATH), RESOLVER).build()); | ||
ManagementResourceRegistration registration = parent.registerSubsystemModel(ResourceDefinition.builder(IOSubsystemResourceRegistration.INSTANCE, RESOLVER).build()); | ||
|
||
ResourceDescriptor descriptor = ResourceDescriptor.builder(RESOLVER) | ||
.addAttributes(List.of(DEFAULT_WORKER)) | ||
|
20 changes: 20 additions & 0 deletions
20
io/subsystem/src/main/java/org/wildfly/extension/io/IOSubsystemResourceRegistration.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,20 @@ | ||
/* | ||
* Copyright The WildFly Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.wildfly.extension.io; | ||
|
||
import org.jboss.as.controller.SubsystemResourceRegistration; | ||
|
||
/** | ||
* Describes the IO subsystem resource. | ||
*/ | ||
public enum IOSubsystemResourceRegistration implements SubsystemResourceRegistration { | ||
INSTANCE; | ||
|
||
@Override | ||
public String getName() { | ||
return "io"; | ||
} | ||
} |
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
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
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
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