ResourceTransformationDescriptionBuilder builder = parentBuilder.addChildResource(PathElement.pathElement(RESOURCEADAPTER_NAME)) .getAttributeBuilder() .setValueConverter(AttributeConverter.Factory.createHardCoded(new ModelNode(0), true), INITIAL_POOL_SIZE) .end();
ResourceTransformationDescriptionBuilder builder = parentBuilder.addChildResource(PathElement.pathElement(RESOURCEADAPTER_NAME)) .getAttributeBuilder() .setValueConverter(AttributeConverter.Factory.createHardCoded(new ModelNode(0), true), INITIAL_POOL_SIZE) .end();
static void buildTransformation(ModelVersion version, ResourceTransformationDescriptionBuilder builder) { if (InfinispanModel.VERSION_6_0_0.requiresTransformation(version)) { builder.getAttributeBuilder() .setValueConverter(AttributeConverter.Factory.createHardCoded(new ModelNode(Mode.SYNC.name())), DeprecatedAttribute.MODE.getDefinition()) .end(); } if (InfinispanModel.VERSION_5_0_0.requiresTransformation(version)) { builder.getAttributeBuilder() .setValueConverter(new DefaultValueAttributeConverter(Attribute.REMOTE_TIMEOUT.getDefinition()), Attribute.REMOTE_TIMEOUT.getDefinition()) .end(); } CacheResourceDefinition.buildTransformation(version, builder); }
/** * Creates an AttributeConverter where the conversion is to a hard-coded value * * @param hardCodedValue the value to set the attribute to * @return the created attribute converter */ public static AttributeConverter createHardCoded(final ModelNode hardCodedValue) { return createHardCoded(hardCodedValue, false); }
/** * Creates an AttributeConverter where the conversion is to a hard-coded value * * @param hardCodedValue the value to set the attribute to * @return the created attribute converter */ public static AttributeConverter createHardCoded(final ModelNode hardCodedValue) { return createHardCoded(hardCodedValue, false); }
/** * Creates an AttributeConverter where the conversion is to a hard-coded value * * @param hardCodedValue the value to set the attribute to * @return the created attribute converter */ public static AttributeConverter createHardCoded(final ModelNode hardCodedValue) { return createHardCoded(hardCodedValue, false); }
private static void registerTransformers_3_0_0(SubsystemTransformerRegistration subsystemRegistration) { final ResourceTransformationDescriptionBuilder builder = TransformationDescriptionBuilder.Factory.createSubsystemInstance(); builder.getAttributeBuilder().setValueConverter(AttributeConverter.Factory.createHardCoded(new ModelNode("hornetq-ra"), true), EJB3SubsystemRootResourceDefinition.DEFAULT_RESOURCE_ADAPTER_NAME) .end(); builder.getAttributeBuilder().setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(false)), EJB3SubsystemRootResourceDefinition.ALLOW_EJB_NAME_REGEX); builder.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, EJB3SubsystemRootResourceDefinition.ALLOW_EJB_NAME_REGEX); builder.getAttributeBuilder().setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(false)), EJB3SubsystemRootResourceDefinition.ENABLE_GRACEFUL_TXN_SHUTDOWN); builder.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, EJB3SubsystemRootResourceDefinition.ENABLE_GRACEFUL_TXN_SHUTDOWN); registerMdbDeliveryGroupTransformers(builder); registerRemoteTransformers(builder); registerStrictMaxPoolTransformers(builder); registerApplicationSecurityDomainDTransformers(builder); registerIdentityTransformers(builder); // Rename new statistics-enabled attribute to old enable-statistics builder.getAttributeBuilder().addRename(EJB3SubsystemModel.STATISTICS_ENABLED, EJB3SubsystemModel.ENABLE_STATISTICS); TransformationDescription.Tools.register(builder.build(), subsystemRegistration, VERSION_3_0_0); }
static void buildTransformation(ModelVersion version, ResourceTransformationDescriptionBuilder builder) { if (InfinispanModel.VERSION_6_0_0.requiresTransformation(version)) { builder.getAttributeBuilder() .setValueConverter(AttributeConverter.Factory.createHardCoded(new ModelNode(Mode.SYNC.name())), DeprecatedAttribute.MODE.getDefinition()) .end(); } if (InfinispanModel.VERSION_5_0_0.requiresTransformation(version)) { builder.getAttributeBuilder() .setValueConverter(new DefaultValueAttributeConverter(Attribute.REMOTE_TIMEOUT.getDefinition()), Attribute.REMOTE_TIMEOUT.getDefinition()) .end(); } CacheResourceDefinition.buildTransformation(version, builder); }
@SuppressWarnings("deprecation") private static void registerPassivationStoreTransformers_1_2_1_and_1_3_0(ResourceTransformationDescriptionBuilder parent) { ResourceTransformationDescriptionBuilder child = parent.addChildRedirection(PassivationStoreResourceDefinition.INSTANCE.getPathElement(), PathElement.pathElement(EJB3SubsystemModel.CLUSTER_PASSIVATION_STORE)); child.getAttributeBuilder() .setValueConverter(AttributeConverter.Factory.createHardCoded(new ModelNode(true), true), EJB3SubsystemModel.PASSIVATE_EVENTS_ON_REPLICATE) .setValueConverter(AttributeConverter.Factory.createHardCoded(new ModelNode("default"), true), EJB3SubsystemModel.CLIENT_MAPPINGS_CACHE) .setValueConverter(AttributeConverter.Factory.createHardCoded(new ModelNode().set(Long.valueOf(Integer.MAX_VALUE)), true), EJB3SubsystemModel.IDLE_TIMEOUT) .setValueConverter(AttributeConverter.Factory.createHardCoded(new ModelNode().set(TimeUnit.SECONDS.name()), true), EJB3SubsystemModel.IDLE_TIMEOUT_UNIT) ; }