Skip to content

Commit

Permalink
[WFLY-9433] apply InfiniteOrPositiveValidators to messaging attribute…
Browse files Browse the repository at this point in the history
…s allow valid value -1
  • Loading branch information
soul2zimate committed Nov 21, 2017
1 parent 5303f8d commit 8df30a7
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 1 deletion.
Expand Up @@ -77,6 +77,7 @@ public class BridgeDefinition extends PersistentResourceDefinition {
.setRequired(false)
.setDefaultValue(new ModelNode().set(ActiveMQDefaultConfiguration.getDefaultBridgeInitialConnectAttempts()))
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.setRestartAllServices()
.build();

Expand All @@ -90,6 +91,7 @@ public class BridgeDefinition extends PersistentResourceDefinition {
.setMeasurementUnit(BYTES)
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.setRestartAllServices()
.build();

Expand Down Expand Up @@ -130,6 +132,7 @@ public class BridgeDefinition extends PersistentResourceDefinition {
.setRequired(false)
.setDefaultValue(new ModelNode().set(ActiveMQDefaultConfiguration.getDefaultBridgeReconnectAttempts()))
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.setRestartAllServices()
.build();

Expand Down
Expand Up @@ -98,6 +98,7 @@ public class ClusterConnectionDefinition extends PersistentResourceDefinition {
.setMeasurementUnit(MILLISECONDS)
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.LONG_INSTANCE)
.setRestartAllServices()
.build();

Expand Down Expand Up @@ -133,6 +134,7 @@ public class ClusterConnectionDefinition extends PersistentResourceDefinition {
.setDefaultValue(new ModelNode(ActiveMQDefaultConfiguration.getDefaultClusterInitialConnectAttempts()))
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.setRestartAllServices()
.build();

Expand Down Expand Up @@ -172,6 +174,7 @@ public class ClusterConnectionDefinition extends PersistentResourceDefinition {
.setMeasurementUnit(BYTES)
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.setRestartAllServices()
.build();

Expand All @@ -187,6 +190,7 @@ public class ClusterConnectionDefinition extends PersistentResourceDefinition {
.setDefaultValue(new ModelNode(ActiveMQDefaultConfiguration.getDefaultClusterReconnectAttempts()))
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.setRestartAllServices()
.build();

Expand Down
Expand Up @@ -80,6 +80,7 @@ public interface CommonAttributes {
.setRequired(false)
.setAllowExpression(true)
.setMeasurementUnit(MILLISECONDS)
.setValidator(InfiniteOrPositiveValidators.LONG_INSTANCE)
.setFlags(RESTART_ALL_SERVICES)
.build();

Expand All @@ -98,13 +99,15 @@ public interface CommonAttributes {
.setMeasurementUnit(BYTES)
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.setRestartAllServices()
.build();

SimpleAttributeDefinition CONNECTION_TTL = create("connection-ttl", LONG)
.setDefaultValue(new ModelNode().set(ActiveMQClient.DEFAULT_CONNECTION_TTL))
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.LONG_INSTANCE)
.setMeasurementUnit(MILLISECONDS)
.setRestartAllServices()
.build();
Expand Down
Expand Up @@ -67,6 +67,7 @@ public class GroupingHandlerDefinition extends PersistentResourceDefinition {
.setMeasurementUnit(MILLISECONDS)
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.LONG_INSTANCE)
.setRestartAllServices()
.build();

Expand Down
Expand Up @@ -20,7 +20,7 @@
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/

package org.wildfly.extension.messaging.activemq.jms.bridge;
package org.wildfly.extension.messaging.activemq;

import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.operations.validation.ModelTypeValidator;
Expand Down
Expand Up @@ -109,6 +109,7 @@ public class ServerDefinition extends PersistentResourceDefinition {
.setDefaultValue(new ModelNode().set(ActiveMQDefaultConfiguration.getDefaultScheduledThreadPoolMaxSize()))
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.setRestartAllServices()
.build();
public static final SimpleAttributeDefinition SECURITY_DOMAIN = create("security-domain", ModelType.STRING)
Expand Down Expand Up @@ -137,6 +138,7 @@ public class ServerDefinition extends PersistentResourceDefinition {
.setDefaultValue(new ModelNode().set(ActiveMQDefaultConfiguration.getDefaultThreadPoolMaxSize()))
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.setRestartAllServices()
.build();
public static final SimpleAttributeDefinition OVERRIDE_IN_VM_SECURITY = create("override-in-vm-security", BOOLEAN)
Expand Down Expand Up @@ -303,6 +305,7 @@ public class ServerDefinition extends PersistentResourceDefinition {
.setDefaultValue(new ModelNode(ActiveMQDefaultConfiguration.getDefaultJournalPoolFiles()))
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.setRestartAllServices()
.build();
public static final SimpleAttributeDefinition JOURNAL_SYNC_NON_TRANSACTIONAL = create("journal-sync-non-transactional", BOOLEAN)
Expand Down Expand Up @@ -344,6 +347,7 @@ public class ServerDefinition extends PersistentResourceDefinition {
.setMeasurementUnit(MILLISECONDS)
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.LONG_INSTANCE)
.setRestartAllServices()
.build();
public static final SimpleAttributeDefinition ASYNC_CONNECTION_EXECUTION_ENABLED = create("async-connection-execution-enabled", BOOLEAN)
Expand Down Expand Up @@ -407,6 +411,7 @@ public class ServerDefinition extends PersistentResourceDefinition {
.setDefaultValue(new ModelNode(ActiveMQDefaultConfiguration.getDefaultJournalPerfBlastPages()))
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.setRestartAllServices()
.build();
public static final SimpleAttributeDefinition RUN_SYNC_SPEED_TEST = create("run-sync-speed-test", BOOLEAN)
Expand All @@ -422,6 +427,7 @@ public class ServerDefinition extends PersistentResourceDefinition {
.setMeasurementUnit(MILLISECONDS)
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.LONG_INSTANCE)
.setRestartAllServices()
.build();
public static final SimpleAttributeDefinition MEMORY_MEASURE_INTERVAL = create("memory-measure-interval", LONG)
Expand All @@ -430,6 +436,7 @@ public class ServerDefinition extends PersistentResourceDefinition {
.setMeasurementUnit(MILLISECONDS)
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.LONG_INSTANCE)
.setRestartAllServices()
.build();
public static final SimpleAttributeDefinition MEMORY_WARNING_THRESHOLD = create("memory-warning-threshold", INT)
Expand Down
Expand Up @@ -38,6 +38,7 @@
import org.jboss.dmr.ModelNode;
import org.jboss.dmr.ModelType;
import org.wildfly.extension.messaging.activemq.CommonAttributes;
import org.wildfly.extension.messaging.activemq.InfiniteOrPositiveValidators;

/**
* @author <a href="http://jmesnil.net/">Jeff Mesnil</a> (c) 2014 Red Hat inc.
Expand All @@ -62,6 +63,7 @@ public class HAAttributes {
.setDefaultValue(new ModelNode(ActiveMQDefaultConfiguration.getDefaultHapolicyBackupRequestRetries()))
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.setRestartAllServices()
.build();

Expand Down
Expand Up @@ -50,6 +50,7 @@
import org.jboss.as.controller.security.CredentialReference;
import org.jboss.dmr.ModelNode;
import org.wildfly.extension.messaging.activemq.CommonAttributes;
import org.wildfly.extension.messaging.activemq.InfiniteOrPositiveValidators;

public interface ConnectionFactoryAttributes {

Expand Down Expand Up @@ -89,6 +90,7 @@ interface Common {
.setMeasurementUnit(MILLISECONDS)
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.LONG_INSTANCE)
.build();

AttributeDefinition COMPRESS_LARGE_MESSAGES = SimpleAttributeDefinitionBuilder.create("compress-large-messages", BOOLEAN)
Expand All @@ -102,6 +104,7 @@ interface Common {
.setMeasurementUnit(BYTES)
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.build();

AttributeDefinition CONNECTION_LOAD_BALANCING_CLASS_NAME = SimpleAttributeDefinitionBuilder.create("connection-load-balancing-policy-class-name", STRING)
Expand All @@ -114,6 +117,7 @@ interface Common {
.setDefaultValue(new ModelNode().set(ActiveMQClient.DEFAULT_CONNECTION_TTL))
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.LONG_INSTANCE)
.setMeasurementUnit(MILLISECONDS)
.build();

Expand All @@ -130,6 +134,7 @@ interface Common {
.setMeasurementUnit(PER_SECOND)
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.build();

AttributeDefinition CONSUMER_WINDOW_SIZE = SimpleAttributeDefinitionBuilder.create("consumer-window-size", INT)
Expand Down Expand Up @@ -214,6 +219,7 @@ interface Common {
.setMeasurementUnit(PER_SECOND)
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.build();

AttributeDefinition PRODUCER_WINDOW_SIZE = SimpleAttributeDefinitionBuilder.create("producer-window-size", INT)
Expand Down Expand Up @@ -250,12 +256,14 @@ interface Common {
.setDefaultValue(new ModelNode().set(ActiveMQDefaultConfiguration.getDefaultScheduledThreadPoolMaxSize()))
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.build();

AttributeDefinition THREAD_POOL_MAX_SIZE = SimpleAttributeDefinitionBuilder.create("thread-pool-max-size", INT)
.setDefaultValue(new ModelNode().set(ActiveMQDefaultConfiguration.getDefaultThreadPoolMaxSize()))
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.build();

AttributeDefinition TRANSACTION_BATCH_SIZE = SimpleAttributeDefinitionBuilder.create("transaction-batch-size", INT)
Expand Down
Expand Up @@ -57,6 +57,7 @@
import org.jboss.as.controller.security.CredentialReference;
import org.jboss.dmr.ModelNode;
import org.wildfly.extension.messaging.activemq.CommonAttributes;
import org.wildfly.extension.messaging.activemq.InfiniteOrPositiveValidators;
import org.wildfly.extension.messaging.activemq.MessagingExtension;

/**
Expand Down
Expand Up @@ -58,6 +58,7 @@
import org.jboss.dmr.ModelNode;
import org.jboss.dmr.ModelType;
import org.wildfly.extension.messaging.activemq.CommonAttributes;
import org.wildfly.extension.messaging.activemq.InfiniteOrPositiveValidators;
import org.wildfly.extension.messaging.activemq.MessagingExtension;
import org.wildfly.extension.messaging.activemq.jms.Validators;

Expand Down Expand Up @@ -106,6 +107,7 @@ public class LegacyConnectionFactoryDefinition extends PersistentResourceDefinit
.setMeasurementUnit(MILLISECONDS)
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.LONG_INSTANCE)
.setRestartAllServices()
.build();

Expand All @@ -121,6 +123,7 @@ public class LegacyConnectionFactoryDefinition extends PersistentResourceDefinit
.setMeasurementUnit(BYTES)
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.setRestartAllServices()
.build();

Expand All @@ -135,6 +138,7 @@ public class LegacyConnectionFactoryDefinition extends PersistentResourceDefinit
.setDefaultValue(new ModelNode().set(HornetQClient.DEFAULT_CONNECTION_TTL))
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.LONG_INSTANCE)
.setMeasurementUnit(MILLISECONDS)
.setRestartAllServices()
.build();
Expand All @@ -144,6 +148,7 @@ public class LegacyConnectionFactoryDefinition extends PersistentResourceDefinit
.setMeasurementUnit(PER_SECOND)
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.setRestartAllServices()
.build();

Expand Down Expand Up @@ -241,6 +246,7 @@ public class LegacyConnectionFactoryDefinition extends PersistentResourceDefinit
.setMeasurementUnit(PER_SECOND)
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.setRestartAllServices()
.build();

Expand Down Expand Up @@ -279,13 +285,15 @@ public class LegacyConnectionFactoryDefinition extends PersistentResourceDefinit
.setDefaultValue(new ModelNode().set(ActiveMQDefaultConfiguration.getDefaultScheduledThreadPoolMaxSize()))
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.setRestartAllServices()
.build();

public static AttributeDefinition THREAD_POOL_MAX_SIZE = SimpleAttributeDefinitionBuilder.create("thread-pool-max-size", INT)
.setDefaultValue(new ModelNode().set(ActiveMQDefaultConfiguration.getDefaultThreadPoolMaxSize()))
.setRequired(false)
.setAllowExpression(true)
.setValidator(InfiniteOrPositiveValidators.INT_INSTANCE)
.setRestartAllServices()
.build();

Expand Down

0 comments on commit 8df30a7

Please sign in to comment.