Skip to content

Commit

Permalink
AS7-4790 Restore FAILOVER_ON_SERVER_SHUTDOWN_ATTRIBUTE
Browse files Browse the repository at this point in the history
  • Loading branch information
bstansberry committed Jul 4, 2012
1 parent 08a932b commit 55fca14
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
5 changes: 5 additions & 0 deletions messaging/src/main/java/org/jboss/as/messaging/BridgeAdd.java
Expand Up @@ -78,6 +78,11 @@ protected void populateModel(ModelNode operation, ModelNode model) throws Operat
}
attributeDefinition.validateAndSet(operation, model);
}

if (operation.hasDefined(CommonAttributes.FAILOVER_ON_SERVER_SHUTDOWN.getName())) {
PathAddress pa = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR));
MessagingLogger.MESSAGING_LOGGER.deprecatedAttribute(CommonAttributes.FAILOVER_ON_SERVER_SHUTDOWN.getName(), pa);
}
}

@Override
Expand Down
Expand Up @@ -34,11 +34,16 @@

import org.hornetq.core.config.impl.ConfigurationImpl;
import org.jboss.as.controller.AttributeDefinition;
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.OperationStepHandler;
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.as.controller.SimpleAttributeDefinition;
import org.jboss.as.controller.SimpleResourceDefinition;
import org.jboss.as.controller.descriptions.DefaultOperationDescriptionProvider;
import org.jboss.as.controller.descriptions.DescriptionProvider;
import org.jboss.as.controller.descriptions.ModelDescriptionConstants;
import org.jboss.as.controller.registry.AttributeAccess;
import org.jboss.as.controller.registry.ManagementResourceRegistration;
import org.jboss.as.controller.registry.OperationEntry;
Expand Down Expand Up @@ -123,6 +128,18 @@ public void registerAttributes(ManagementResourceRegistration registry) {
if (registerRuntimeOnly) {
registry.registerReadOnlyAttribute(BridgeControlHandler.STARTED, BridgeControlHandler.INSTANCE);
}

registry.registerReadWriteAttribute(CommonAttributes.FAILOVER_ON_SERVER_SHUTDOWN, null, new OperationStepHandler() {

@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {

if (operation.hasDefined(CommonAttributes.FAILOVER_ON_SERVER_SHUTDOWN.getName())) {
PathAddress pa = PathAddress.pathAddress(operation.require(ModelDescriptionConstants.OP_ADDR));
MessagingLogger.MESSAGING_LOGGER.deprecatedAttribute(CommonAttributes.FAILOVER_ON_SERVER_SHUTDOWN.getName(), pa);
}
}
});
}

@Override
Expand All @@ -139,4 +156,4 @@ public void registerOperations(ManagementResourceRegistration registry) {

super.registerOperations(registry);
}
}
}
Expand Up @@ -179,4 +179,14 @@ public interface MessagingLogger extends BasicLogger {
@Message(id = 11611, value = "Stopped %s %s")
void stoppedService(String type, String name);

/**
* Logs a warning message indicating the management attribute with the given {@code name}
* is deprecated and will not be used anymore.
*
* @param name the name of the deprecated XML attribute
*/
@LogMessage(level = WARN)
@Message(id = 11612, value = "Attribute %s of the resource at %s is deprecated and setting its value will not be taken into account")
void deprecatedAttribute(String name, PathAddress address);

}
Expand Up @@ -322,6 +322,7 @@ bridge.transformer-class-name=The name of a user-defined class which implements
bridge.retry-interval=The period in milliseconds between subsequent reconnection attempts, if the connection to the target server has failed.
bridge.retry-interval-multiplier=A multiplier to apply to the time since the last retry to compute the time to the next retry. This allows you to implement an exponential backoff between retry attempts.
bridge.reconnect-attempts=The total number of reconnect attempts the bridge will make before giving up and shutting down. A value of -1 signifies an unlimited number of attempts.
bridge.failover-on-server-shutdown=Deprecated. Has no runtime effect and a warning will be issued if an attempt is made to set the value of this attribute.
bridge.use-duplicate-detection=Whether the bridge will automatically insert a duplicate id property into each message that it forwards.
bridge.confirmation-window-size=The confirmation-window-size to use for the connection used to forward messages to the target node.
bridge.user=The user name to use when creating the bridge connection to the remote server. If it is not specified the default cluster user specified by the cluster-user attribute in the root messaging subsystem resource will be used.
Expand Down

0 comments on commit 55fca14

Please sign in to comment.