Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
AS7-5753 Reject virtual-nodes in add handler as well
  • Loading branch information
bstansberry committed Nov 27, 2012
1 parent 7c411e6 commit 9fbc0be
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -28,6 +28,7 @@


import org.infinispan.configuration.cache.CacheMode; import org.infinispan.configuration.cache.CacheMode;
import org.infinispan.configuration.cache.ConfigurationBuilder; import org.infinispan.configuration.cache.ConfigurationBuilder;
import org.jboss.as.clustering.infinispan.InfinispanMessages;
import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException; import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.operations.common.Util; import org.jboss.as.controller.operations.common.Util;
Expand Down Expand Up @@ -55,6 +56,13 @@ private DistributedCacheAdd() {
void populate(ModelNode fromModel, ModelNode toModel) throws OperationFailedException { void populate(ModelNode fromModel, ModelNode toModel) throws OperationFailedException {
super.populate(fromModel, toModel); super.populate(fromModel, toModel);


@SuppressWarnings("deprecation")
final String deprecatedKey = ModelKeys.VIRTUAL_NODES;
if (fromModel.hasDefined(deprecatedKey)
&& fromModel.get(deprecatedKey).asInt() != 1) {
throw InfinispanMessages.MESSAGES.attributeDeprecated(deprecatedKey);
}

DistributedCacheResource.OWNERS.validateAndSet(fromModel, toModel); DistributedCacheResource.OWNERS.validateAndSet(fromModel, toModel);
DistributedCacheResource.SEGMENTS.validateAndSet(fromModel, toModel); DistributedCacheResource.SEGMENTS.validateAndSet(fromModel, toModel);
DistributedCacheResource.L1_LIFESPAN.validateAndSet(fromModel, toModel); DistributedCacheResource.L1_LIFESPAN.validateAndSet(fromModel, toModel);
Expand Down

0 comments on commit 9fbc0be

Please sign in to comment.