use of org.apache.activemq.artemis.core.server.group.impl.GroupingHandlerConfiguration in project wildfly by wildfly.
the class GroupingHandlerAdd method addGroupingHandlerConfig.
static void addGroupingHandlerConfig(final OperationContext context, final Configuration configuration, final ModelNode model) throws OperationFailedException {
if (model.hasDefined(CommonAttributes.GROUPING_HANDLER)) {
final Property prop = model.get(CommonAttributes.GROUPING_HANDLER).asProperty();
final String name = prop.getName();
final ModelNode node = prop.getValue();
final GroupingHandlerConfiguration.TYPE type = GroupingHandlerConfiguration.TYPE.valueOf(GroupingHandlerDefinition.TYPE.resolveModelAttribute(context, node).asString());
final String address = GROUPING_HANDLER_ADDRESS.resolveModelAttribute(context, node).asString();
final int timeout = TIMEOUT.resolveModelAttribute(context, node).asInt();
final long groupTimeout = GROUP_TIMEOUT.resolveModelAttribute(context, node).asLong();
final long reaperPeriod = REAPER_PERIOD.resolveModelAttribute(context, node).asLong();
final GroupingHandlerConfiguration conf = new GroupingHandlerConfiguration().setName(SimpleString.toSimpleString(name)).setType(type).setAddress(SimpleString.toSimpleString(address)).setTimeout(timeout).setGroupTimeout(groupTimeout).setReaperPeriod(reaperPeriod);
configuration.setGroupingHandlerConfiguration(conf);
}
}
Aggregations