Search in sources :

Example 1 with GroupingHandlerConfiguration

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);
    }
}
Also used : GroupingHandlerConfiguration(org.apache.activemq.artemis.core.server.group.impl.GroupingHandlerConfiguration) SimpleString(org.apache.activemq.artemis.api.core.SimpleString) ModelNode(org.jboss.dmr.ModelNode) Property(org.jboss.dmr.Property)

Aggregations

SimpleString (org.apache.activemq.artemis.api.core.SimpleString)1 GroupingHandlerConfiguration (org.apache.activemq.artemis.core.server.group.impl.GroupingHandlerConfiguration)1 ModelNode (org.jboss.dmr.ModelNode)1 Property (org.jboss.dmr.Property)1