Skip to content

Commit

Permalink
[Issue-43] Drop vertx-option-file resource
Browse files Browse the repository at this point in the history
  • Loading branch information
gaol committed Nov 28, 2024
1 parent 3ef48ca commit 5ff78ff
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 137 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected AbstractVertxOptionsResourceDefinition(SimpleResourceDefinition.Parame
protected static class VertxOptionRemoveHandler extends AbstractVertxOptionRemoveHandler {
@Override
protected void doPerform(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {
ServiceName vertxServiceName = VertxOptionFileResourceDefinition.VERTX_OPTIONS_CAPABILITY.getCapabilityServiceName(context.getCurrentAddressValue());
ServiceName vertxServiceName = VERTX_OPTIONS_CAPABILITY.getCapabilityServiceName(context.getCurrentAddressValue());
context.removeService(vertxServiceName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.function.Consumer;
import java.util.function.Supplier;

import static org.wildfly.extension.vertx.AbstractVertxOptionsResourceDefinition.VERTX_OPTIONS_CAPABILITY;
import static org.wildfly.extension.vertx.VertxConstants.ATTR_FS_FILE_CACHE_DIR;
import static org.wildfly.extension.vertx.VertxConstants.ELEMENT_VERTX_OPTION_ADDRESS_RESOLVER;

Expand All @@ -36,11 +37,6 @@ public class NamedVertxOptionsService implements Service {
private final Supplier<ServerEnvironment> serverEnvironmentSupplier;
private final boolean defaultFileCacheDir;

NamedVertxOptionsService(NamedVertxOptions namedVertxOptions,
Consumer<NamedVertxOptions> consumer) {
this(namedVertxOptions, null, null, false, consumer);
}

NamedVertxOptionsService(NamedVertxOptions namedVertxOptions,
Supplier<AddressResolverOptions> addressResolverOptionsSupplier,
Supplier<ServerEnvironment> serverEnvironmentSupplier,
Expand All @@ -65,7 +61,7 @@ public class NamedVertxOptionsService implements Service {
static void installVertxOptionsService(OperationContext context, ModelNode operation) throws OperationFailedException {
final String name = context.getCurrentAddressValue();
VertxOptions vertxOptions = VertxOptionsResourceDefinition.parseOptions(operation);
ServiceName vertxServiceName = VertxOptionFileResourceDefinition.VERTX_OPTIONS_CAPABILITY.getCapabilityServiceName(name);
ServiceName vertxServiceName = VERTX_OPTIONS_CAPABILITY.getCapabilityServiceName(name);
ServiceBuilder<?> vertxServiceBuilder = context.getCapabilityServiceTarget().addService();
Supplier<AddressResolverOptions> addressResolverOptionsSupplier = null;
if (operation.hasDefined(ELEMENT_VERTX_OPTION_ADDRESS_RESOLVER)) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public class VertxSubsystemDefinition extends SimpleResourceDefinition {
public void registerChildren(ManagementResourceRegistration resourceRegistration) {
super.registerChildren(resourceRegistration);
resourceRegistration.registerSubModel(VertxResourceDefinition.INSTANCE);
resourceRegistration.registerSubModel(VertxOptionFileResourceDefinition.INSTANCE);
resourceRegistration.registerSubModel(VertxOptionsResourceDefinition.INSTANCE);
resourceRegistration.registerSubModel(AddressResolverResourceDefinition.INSTANCE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ public PersistentResourceXMLDescription getXMLDescription() {
)
.addChild(
decorator(ELEMENT_VERTX_OPTIONS)
.addChild(
builder(VertxOptionFileResourceDefinition.INSTANCE.getPathElement())
.addAttributes(VertxOptionsAttributes.getVertxOptionsFileAttributes().toArray(new AttributeDefinition[0]))
)
.addChild(
builder(VertxOptionsResourceDefinition.INSTANCE.getPathElement())
.addAttributes(VertxOptionsAttributes.getVertxOptionsAttributes().toArray(new AttributeDefinition[0]))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ vertx.remove=Remove Vertx Subsystem
vertx.vertx=The service which provides a Vert.x instance
vertx.option-name=The option name used to refer to the VertxOptions definition

vertx.vertx-option-file=VertxOptions that comes from a Json file path
vertx.vertx-option-file.add=Add a VertxOptions by specifying the json file path
vertx.vertx-option-file.remove=Remove a VertxOptions defined by a json file path
vertx.vertx-option-file.path=A JSON file path where to read the VertxOptions from

vertx.vertx-option=The VertxOptions Definition
vertx.vertx-option.add=Add a VertxOptions
vertx.vertx-option.remove=Remove a VertxOptions
Expand Down
14 changes: 0 additions & 14 deletions subsystem/src/main/resources/schema/wildfly-vertx_1_0_0.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@

<xs:complexType name="vertxOptionsType">
<xs:sequence>
<xs:element name="vertx-option-file" type="vertxOptionFileType" maxOccurs="unbounded" minOccurs="0">
<xs:annotation>
<xs:documentation>Define a VertxOptions from a Json file</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="vertx-option" type="vertxOptionType" maxOccurs="unbounded" minOccurs="0">
<xs:annotation>
<xs:documentation>Define a VertxOptions by specifying each property</xs:documentation>
Expand All @@ -48,15 +43,6 @@
</xs:sequence>
</xs:complexType>

<xs:complexType name="vertxOptionFileType">
<xs:attribute name="name" use="required" type="xs:string"/>
<xs:attribute name="path" type="xs:string">
<xs:annotation>
<xs:documentation>Specify the json file path where to read VertxOptions from.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>

<xs:complexType name="vertxOptionType">
<xs:attribute name="name" use="required" type="xs:string"/>
<xs:attribute name="event-loop-pool-size" type="xs:int"/>
Expand Down

0 comments on commit 5ff78ff

Please sign in to comment.