use of org.jboss.as.controller.ModelVersion in project wildfly by wildfly.
the class MailExtension method registerTransformers.
private void registerTransformers(SubsystemRegistration subsystem) {
ChainedTransformationDescriptionBuilder chained = ResourceTransformationDescriptionBuilder.Factory.createChainedSubystemInstance(CURRENT_MODEL_VERSION);
ModelVersion MODEL_VERSION_EAP64 = ModelVersion.create(1, 4, 0);
ModelVersion MODEL_VERSION_EAP70 = ModelVersion.create(2, 0, 0);
ResourceTransformationDescriptionBuilder builder70 = chained.createBuilder(CURRENT_MODEL_VERSION, MODEL_VERSION_EAP70);
builder70.addChildResource(MAIL_SESSION_PATH).addChildResource(PathElement.pathElement(SERVER_TYPE)).getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, MailServerDefinition.CREDENTIAL_REFERENCE.getName()).setDiscard(DiscardAttributeChecker.UNDEFINED, MailServerDefinition.CREDENTIAL_REFERENCE.getName()).end().addChildResource(CUSTOM_SERVER_PATH).getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, MailServerDefinition.CREDENTIAL_REFERENCE.getName()).setDiscard(DiscardAttributeChecker.UNDEFINED, MailServerDefinition.CREDENTIAL_REFERENCE.getName());
ResourceTransformationDescriptionBuilder builder64 = chained.createBuilder(MODEL_VERSION_EAP70, MODEL_VERSION_EAP64);
ResourceTransformationDescriptionBuilder sessionBuilder = builder64.addChildResource(MAIL_SESSION_PATH).addChildResource(PathElement.pathElement(SERVER_TYPE)).getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, TLS).setDiscard(DiscardAttributeChecker.UNDEFINED, TLS).end();
sessionBuilder.discardChildResource(CUSTOM_SERVER_PATH);
chained.buildAndRegister(subsystem, new ModelVersion[] { MODEL_VERSION_EAP70, MODEL_VERSION_EAP64 });
}
use of org.jboss.as.controller.ModelVersion in project wildfly by wildfly.
the class WSExtension method registerTransformers2_0_0.
private void registerTransformers2_0_0(SubsystemRegistration registration) {
ModelVersion version = ModelVersion.create(2, 0, 0);
ResourceTransformationDescriptionBuilder builder = TransformationDescriptionBuilder.Factory.createSubsystemInstance();
builder.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.SIMPLE_EXPRESSIONS, Attributes.STATISTICS_ENABLED);
TransformationDescription.Tools.register(builder.build(), registration, version);
}
use of org.jboss.as.controller.ModelVersion in project wildfly by wildfly.
the class SingletonTransformersTestCase method testTransformation.
private void testTransformation(final ModelTestControllerVersion controller) throws Exception {
final ModelVersion version = getModelVersion(controller).getVersion();
final String subsystemXmlResource = String.format("subsystem-transform-%d_%d_%d.xml", version.getMajor(), version.getMinor(), version.getMicro());
final String[] dependencies = getDependencies(controller);
KernelServices services = this.buildKernelServices(subsystemXmlResource, controller, version, dependencies);
checkSubsystemModelTransformation(services, version, null, false);
}
use of org.jboss.as.controller.ModelVersion in project wildfly by wildfly.
the class WeldSubsystemTestCase method testTransformers10.
private void testTransformers10(ModelTestControllerVersion controllerVersion) throws Exception {
ModelVersion modelVersion = ModelVersion.create(1, 0, 0);
KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT).setSubsystemXmlResource("subsystem_3_0-transformers.xml");
//which is why we need to include the jboss-as-controller artifact.
builder.createLegacyKernelServicesBuilder(AdditionalInitialization.MANAGEMENT, controllerVersion, modelVersion).addMavenResourceURL("org.jboss.as:jboss-as-weld:" + controllerVersion.getMavenGavVersion()).skipReverseControllerCheck().dontPersistXml();
KernelServices mainServices = builder.build();
KernelServices legacyServices = mainServices.getLegacyServices(modelVersion);
assertTrue(mainServices.isSuccessfulBoot());
assertTrue(legacyServices.isSuccessfulBoot());
checkSubsystemModelTransformation(mainServices, modelVersion);
}
use of org.jboss.as.controller.ModelVersion in project wildfly by wildfly.
the class WeldSubsystemTestCase method testTransformers30.
@Test
public void testTransformers30() throws Exception {
ModelVersion modelVersion = ModelVersion.create(3, 0, 0);
KernelServicesBuilder builder = createKernelServicesBuilder(AdditionalInitialization.MANAGEMENT).setSubsystemXmlResource("subsystem_4_0-transformers.xml");
builder.createLegacyKernelServicesBuilder(AdditionalInitialization.MANAGEMENT, ModelTestControllerVersion.EAP_7_0_0, modelVersion).addMavenResourceURL("org.jboss.eap:wildfly-weld:" + ModelTestControllerVersion.EAP_7_0_0.getMavenGavVersion()).skipReverseControllerCheck().dontPersistXml();
KernelServices mainServices = builder.build();
KernelServices legacyServices = mainServices.getLegacyServices(modelVersion);
assertTrue(mainServices.isSuccessfulBoot());
assertTrue(legacyServices.isSuccessfulBoot());
checkSubsystemModelTransformation(mainServices, modelVersion);
}
Aggregations