All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wildfly.swarm.config.undertow.configuration.RequestLimit Maven / Gradle / Ivy

The newest version!
package org.wildfly.swarm.config.undertow.configuration;

import org.wildfly.swarm.config.runtime.AttributeDocumentation;
import org.wildfly.swarm.config.runtime.ResourceDocumentation;
import org.wildfly.swarm.config.runtime.SingletonResource;
import org.wildfly.swarm.config.runtime.Address;
import org.wildfly.swarm.config.runtime.ResourceType;
import java.beans.PropertyChangeSupport;
import java.beans.PropertyChangeListener;
import org.wildfly.swarm.config.runtime.ModelNodeBinding;

/**
 * Concurrent request limiter handler
 */
@Address("/subsystem=undertow/configuration=filter/request-limit=*")
@ResourceType("request-limit")
public class RequestLimit>
		implements
			org.wildfly.swarm.config.runtime.Keyed {

	private String key;
	private PropertyChangeSupport pcs;
	@AttributeDocumentation("Maximum number of concurrent requests")
	private Integer maxConcurrentRequests;
	@AttributeDocumentation("Number of requests to queue before they start being rejected")
	private Integer queueSize;

	public RequestLimit(java.lang.String key) {
		super();
		this.key = key;
	}

	public String getKey() {
		return this.key;
	}

	/**
	 * Adds a property change listener
	 */
	public void addPropertyChangeListener(PropertyChangeListener listener) {
		if (null == this.pcs)
			this.pcs = new PropertyChangeSupport(this);
		this.pcs.addPropertyChangeListener(listener);
	}

	/**
	 * Removes a property change listener
	 */
	public void removePropertyChangeListener(
			java.beans.PropertyChangeListener listener) {
		if (this.pcs != null)
			this.pcs.removePropertyChangeListener(listener);
	}

	/**
	 * Maximum number of concurrent requests
	 */
	@ModelNodeBinding(detypedName = "max-concurrent-requests")
	public Integer maxConcurrentRequests() {
		return this.maxConcurrentRequests;
	}

	/**
	 * Maximum number of concurrent requests
	 */
	@SuppressWarnings("unchecked")
	public T maxConcurrentRequests(java.lang.Integer value) {
		Object oldValue = this.maxConcurrentRequests;
		this.maxConcurrentRequests = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("maxConcurrentRequests", oldValue,
					value);
		return (T) this;
	}

	/**
	 * Number of requests to queue before they start being rejected
	 */
	@ModelNodeBinding(detypedName = "queue-size")
	public Integer queueSize() {
		return this.queueSize;
	}

	/**
	 * Number of requests to queue before they start being rejected
	 */
	@SuppressWarnings("unchecked")
	public T queueSize(java.lang.Integer value) {
		Object oldValue = this.queueSize;
		this.queueSize = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("queueSize", oldValue, value);
		return (T) this;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy