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

org.wildfly.swarm.config.jgroups.stack.transport.OobThreadPool Maven / Gradle / Ivy

package org.wildfly.swarm.config.jgroups.stack.transport;

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 org.wildfly.swarm.config.runtime.Implicit;
import java.beans.PropertyChangeSupport;
import java.beans.PropertyChangeListener;
import org.wildfly.swarm.config.runtime.ModelNodeBinding;

/**
 * A thread pool executor
 */
@Address("/subsystem=jgroups/stack=*/transport=*/thread-pool=oob")
@ResourceType("thread-pool")
@Implicit
public class OobThreadPool>
		implements
			org.wildfly.swarm.config.runtime.Keyed {

	private String key;
	private PropertyChangeSupport pcs;
	@AttributeDocumentation("Used to specify the amount of milliseconds that pool threads should be kept running when idle; if not specified, threads will run until the executor is shut down.")
	private Long keepaliveTime;
	@AttributeDocumentation("The maximum thread pool size.")
	private Integer maxThreads;
	@AttributeDocumentation("The core thread pool size which is smaller than the maximum pool size. If undefined, the core thread pool size is the same as the maximum thread pool size.")
	private Integer minThreads;
	@AttributeDocumentation("The queue length.")
	private Integer queueLength;

	public OobThreadPool() {
		super();
		this.key = "oob";
		this.pcs = new PropertyChangeSupport(this);
	}

	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);
	}

	/**
	 * Used to specify the amount of milliseconds that pool threads should be
	 * kept running when idle; if not specified, threads will run until the
	 * executor is shut down.
	 * 
	 * @deprecated This thread pool type is deprecated.
	 */
	@Deprecated
	@ModelNodeBinding(detypedName = "keepalive-time")
	public Long keepaliveTime() {
		return this.keepaliveTime;
	}

	/**
	 * Used to specify the amount of milliseconds that pool threads should be
	 * kept running when idle; if not specified, threads will run until the
	 * executor is shut down.
	 * 
	 * @deprecated This thread pool type is deprecated.
	 */
	@SuppressWarnings("unchecked")
	@Deprecated
	public T keepaliveTime(java.lang.Long value) {
		Object oldValue = this.keepaliveTime;
		this.keepaliveTime = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("keepaliveTime", oldValue, value);
		return (T) this;
	}

	/**
	 * The maximum thread pool size.
	 * 
	 * @deprecated This thread pool type is deprecated.
	 */
	@Deprecated
	@ModelNodeBinding(detypedName = "max-threads")
	public Integer maxThreads() {
		return this.maxThreads;
	}

	/**
	 * The maximum thread pool size.
	 * 
	 * @deprecated This thread pool type is deprecated.
	 */
	@SuppressWarnings("unchecked")
	@Deprecated
	public T maxThreads(java.lang.Integer value) {
		Object oldValue = this.maxThreads;
		this.maxThreads = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("maxThreads", oldValue, value);
		return (T) this;
	}

	/**
	 * The core thread pool size which is smaller than the maximum pool size. If
	 * undefined, the core thread pool size is the same as the maximum thread
	 * pool size.
	 * 
	 * @deprecated This thread pool type is deprecated.
	 */
	@Deprecated
	@ModelNodeBinding(detypedName = "min-threads")
	public Integer minThreads() {
		return this.minThreads;
	}

	/**
	 * The core thread pool size which is smaller than the maximum pool size. If
	 * undefined, the core thread pool size is the same as the maximum thread
	 * pool size.
	 * 
	 * @deprecated This thread pool type is deprecated.
	 */
	@SuppressWarnings("unchecked")
	@Deprecated
	public T minThreads(java.lang.Integer value) {
		Object oldValue = this.minThreads;
		this.minThreads = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("minThreads", oldValue, value);
		return (T) this;
	}

	/**
	 * The queue length.
	 * 
	 * @deprecated Deprecated. JGroups thread-pools are always queue-less.
	 */
	@Deprecated
	@ModelNodeBinding(detypedName = "queue-length")
	public Integer queueLength() {
		return this.queueLength;
	}

	/**
	 * The queue length.
	 * 
	 * @deprecated Deprecated. JGroups thread-pools are always queue-less.
	 */
	@SuppressWarnings("unchecked")
	@Deprecated
	public T queueLength(java.lang.Integer value) {
		Object oldValue = this.queueLength;
		this.queueLength = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("queueLength", oldValue, value);
		return (T) this;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy