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

org.wildfly.swarm.config.ee.ManagedThreadFactory Maven / Gradle / Ivy

package org.wildfly.swarm.config.ee;

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;

/**
 * A managed thread factory
 */
@Address("/subsystem=ee/managed-thread-factory=*")
@ResourceType("managed-thread-factory")
public class ManagedThreadFactory>
		implements
			org.wildfly.swarm.config.runtime.Keyed {

	private String key;
	private PropertyChangeSupport pcs;
	@AttributeDocumentation("The name of the context service to be used by the managed thread factory")
	private String contextService;
	@AttributeDocumentation("The JNDI Name to lookup the managed thread factory.")
	private String jndiName;
	@AttributeDocumentation("The priority applied to threads created by the factory")
	private Integer priority;

	public ManagedThreadFactory(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);
	}

	/**
	 * The name of the context service to be used by the managed thread factory
	 */
	@ModelNodeBinding(detypedName = "context-service")
	public String contextService() {
		return this.contextService;
	}

	/**
	 * The name of the context service to be used by the managed thread factory
	 */
	@SuppressWarnings("unchecked")
	public T contextService(java.lang.String value) {
		Object oldValue = this.contextService;
		this.contextService = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("contextService", oldValue, value);
		return (T) this;
	}

	/**
	 * The JNDI Name to lookup the managed thread factory.
	 */
	@ModelNodeBinding(detypedName = "jndi-name")
	public String jndiName() {
		return this.jndiName;
	}

	/**
	 * The JNDI Name to lookup the managed thread factory.
	 */
	@SuppressWarnings("unchecked")
	public T jndiName(java.lang.String value) {
		Object oldValue = this.jndiName;
		this.jndiName = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("jndiName", oldValue, value);
		return (T) this;
	}

	/**
	 * The priority applied to threads created by the factory
	 */
	@ModelNodeBinding(detypedName = "priority")
	public Integer priority() {
		return this.priority;
	}

	/**
	 * The priority applied to threads created by the factory
	 */
	@SuppressWarnings("unchecked")
	public T priority(java.lang.Integer value) {
		Object oldValue = this.priority;
		this.priority = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("priority", oldValue, value);
		return (T) this;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy