use of org.jboss.as.controller.transform.PathAddressTransformer in project wildfly by wildfly.
the class TimerServiceResourceDefinition method registerDataStoreTransformers.
private static void registerDataStoreTransformers(ResourceTransformationDescriptionBuilder timerService) {
DataStoreTransformer dataStoreTransformer = new DataStoreTransformer();
timerService.getAttributeBuilder().setDiscard(DiscardAttributeChecker.ALWAYS, //this is ok, as default-data-store only has any sense with new model, but it is always set!
EJB3SubsystemModel.DEFAULT_DATA_STORE).end();
timerService.discardOperations(ModelDescriptionConstants.ADD);
timerService.setCustomResourceTransformer(dataStoreTransformer);
timerService.rejectChildResource(EJB3SubsystemModel.DATABASE_DATA_STORE_PATH);
ResourceTransformationDescriptionBuilder fileDataStore = timerService.addChildRedirection(EJB3SubsystemModel.FILE_DATA_STORE_PATH, new PathAddressTransformer() {
@Override
public PathAddress transform(PathElement current, Builder builder) {
return builder.getCurrent();
}
});
fileDataStore.addOperationTransformationOverride(ModelDescriptionConstants.ADD).inheritResourceAttributeDefinitions().setCustomOperationTransformer(dataStoreTransformer).end();
}
use of org.jboss.as.controller.transform.PathAddressTransformer in project wildfly by wildfly.
the class BackupsResourceDefinition method buildTransformation.
static void buildTransformation(ModelVersion version, ResourceTransformationDescriptionBuilder parent) {
PathAddressTransformer addressTransformer = new PathAddressTransformer() {
@Override
public PathAddress transform(PathElement current, Builder builder) {
return builder.next();
}
};
ResourceTransformationDescriptionBuilder builder = InfinispanModel.VERSION_4_0_0.requiresTransformation(version) ? parent.addChildRedirection(PATH, addressTransformer) : parent.addChildResource(PATH);
BackupResourceDefinition.buildTransformation(version, builder);
}
Aggregations