-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from gaol/issue-25
[issue-25] Move to the new subsystem API
- Loading branch information
Showing
20 changed files
with
271 additions
and
293 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
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
57 changes: 0 additions & 57 deletions
57
subsystem/src/main/java/org/wildfly/extension/vertx/VertxSubsystemParser_1_0.java
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
subsystem/src/main/java/org/wildfly/extension/vertx/VertxSubsystemRegistrar.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,28 @@ | ||
/* | ||
* Copyright The WildFly Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package org.wildfly.extension.vertx; | ||
|
||
import org.jboss.as.controller.SubsystemRegistration; | ||
import org.jboss.as.controller.descriptions.ParentResourceDescriptionResolver; | ||
import org.jboss.as.controller.descriptions.SubsystemResourceDescriptionResolver; | ||
import org.jboss.as.controller.registry.ManagementResourceRegistration; | ||
import org.wildfly.subsystem.resource.ManagementResourceRegistrationContext; | ||
import org.wildfly.subsystem.resource.SubsystemResourceDefinitionRegistrar; | ||
|
||
import static org.wildfly.extension.vertx.VertxSubsystemExtension.SUBSYSTEM_NAME; | ||
|
||
/** | ||
* @author <a href="mailto:aoingl@gmail.com">Lin Gao</a> | ||
*/ | ||
public class VertxSubsystemRegistrar implements SubsystemResourceDefinitionRegistrar { | ||
static final ParentResourceDescriptionResolver RESOLVER = new SubsystemResourceDescriptionResolver(SUBSYSTEM_NAME, | ||
VertxSubsystemRegistrar.class); | ||
|
||
@Override | ||
public ManagementResourceRegistration register(SubsystemRegistration parent, | ||
ManagementResourceRegistrationContext managementResourceRegistrationContext) { | ||
return parent.registerSubsystemModel(VertxSubsystemDefinition.INSTANCE); | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
subsystem/src/main/java/org/wildfly/extension/vertx/VertxSubsystemSchema.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,66 @@ | ||
/* | ||
* Copyright The WildFly Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package org.wildfly.extension.vertx; | ||
|
||
import org.jboss.as.controller.AttributeDefinition; | ||
import org.jboss.as.controller.PersistentResourceXMLDescription; | ||
import org.jboss.as.controller.PersistentSubsystemSchema; | ||
import org.jboss.as.controller.SubsystemSchema; | ||
import org.jboss.as.controller.xml.VersionedNamespace; | ||
import org.jboss.as.version.Stability; | ||
import org.jboss.staxmapper.IntVersion; | ||
|
||
import static org.jboss.as.controller.PersistentResourceXMLDescription.builder; | ||
import static org.jboss.as.controller.PersistentResourceXMLDescription.decorator; | ||
import static org.wildfly.extension.vertx.VertxConstants.ELEMENT_VERTX_OPTIONS; | ||
import static org.wildfly.extension.vertx.VertxSubsystemExtension.SUBSYSTEM_NAME; | ||
import static org.wildfly.extension.vertx.VertxSubsystemExtension.SUBSYSTEM_PATH; | ||
|
||
/** | ||
* @author <a href="mailto:aoingl@gmail.com">Lin Gao</a> | ||
*/ | ||
enum VertxSubsystemSchema implements PersistentSubsystemSchema<VertxSubsystemSchema> { | ||
VERSION_1_0_PREVIEW(1, 0,Stability.PREVIEW), | ||
; | ||
|
||
static final VertxSubsystemSchema CURRENT = VERSION_1_0_PREVIEW; | ||
|
||
private final VersionedNamespace<IntVersion, VertxSubsystemSchema> namespace; | ||
|
||
VertxSubsystemSchema(int major, int minor, Stability stability) { | ||
this.namespace = SubsystemSchema.createSubsystemURN(SUBSYSTEM_NAME, stability, | ||
new IntVersion(major, minor)); | ||
} | ||
|
||
@Override | ||
public VersionedNamespace<IntVersion, VertxSubsystemSchema> getNamespace() { | ||
return namespace; | ||
} | ||
|
||
@Override | ||
public PersistentResourceXMLDescription getXMLDescription() { | ||
return builder(SUBSYSTEM_PATH, namespace) | ||
.addChild( | ||
builder(VertxResourceDefinition.INSTANCE.getPathElement()) | ||
.addAttributes(VertxAttributes.getSimpleAttributes().toArray(new AttributeDefinition[0])) | ||
) | ||
.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])) | ||
) | ||
.addChild( | ||
builder(AddressResolverResourceDefinition.INSTANCE.getPathElement()) | ||
.addAttributes(AddressResolverResourceDefinition.getVertxAddressResolverOptionsAttrs().toArray(new AttributeDefinition[0])) | ||
) | ||
) | ||
.build(); | ||
} | ||
} |
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
53 changes: 53 additions & 0 deletions
53
subsystem/src/test/java/org/wildfly/extension/vertx/SubsystemTestCase.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,53 @@ | ||
/* | ||
* Copyright The WildFly Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package org.wildfly.extension.vertx; | ||
|
||
import org.jboss.as.controller.capability.registry.RuntimeCapabilityRegistry; | ||
import org.jboss.as.controller.extension.ExtensionRegistry; | ||
import org.jboss.as.controller.registry.ManagementResourceRegistration; | ||
import org.jboss.as.controller.registry.Resource; | ||
import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest; | ||
import org.jboss.as.subsystem.test.AdditionalInitialization; | ||
import org.jboss.as.version.Stability; | ||
|
||
import java.io.IOException; | ||
|
||
import static org.wildfly.extension.vertx.VertxSubsystemExtension.SUBSYSTEM_NAME; | ||
|
||
/** | ||
* Standard subsystem test. | ||
* | ||
* @author <a href="aoingl@gmail.com">Lin Gao</a> | ||
*/ | ||
public class SubsystemTestCase extends AbstractSubsystemBaseTest { | ||
|
||
public SubsystemTestCase() { | ||
super(SUBSYSTEM_NAME, new VertxSubsystemExtension(), Stability.PREVIEW); | ||
} | ||
|
||
@Override | ||
protected String getSubsystemXml() throws IOException { | ||
// test configuration put in standalone.xml | ||
return readResource("vertx-options-full.xml"); | ||
} | ||
|
||
@Override | ||
protected String getSubsystemXsdPath() { | ||
return "schema/wildfly-vertx_1_0_0.xsd"; | ||
} | ||
|
||
protected AdditionalInitialization createAdditionalInitialization() { | ||
return new AdditionalInitialization.ManagementAdditionalInitialization(Stability.PREVIEW) { | ||
|
||
@Override | ||
protected void initializeExtraSubystemsAndModel(ExtensionRegistry extensionRegistry, Resource rootResource, | ||
ManagementResourceRegistration rootRegistration, RuntimeCapabilityRegistry capabilityRegistry) { | ||
super.initializeExtraSubystemsAndModel(extensionRegistry, rootResource, rootRegistration, capabilityRegistry); | ||
registerCapabilities(capabilityRegistry, "org.wildfly.weld"); | ||
} | ||
}; | ||
} | ||
|
||
} |
Oops, something went wrong.