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

org.wildfly.swarm.config.datasources.xa_data_source.XADatasourceProperties Maven / Gradle / Ivy

package org.wildfly.swarm.config.datasources.xa_data_source;

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;

/**
 * List of xa-datasource-property
 */
@Address("/subsystem=datasources/xa-data-source=*/xa-datasource-properties=*")
@ResourceType("xa-datasource-properties")
public class XADatasourceProperties>
		implements
			org.wildfly.swarm.config.runtime.Keyed {

	private String key;
	private PropertyChangeSupport pcs;
	@AttributeDocumentation("Specifies a property value to assign to the XADataSource implementation class. Each property is identified by the name attribute and the property value is given by the xa-datasource-property element content. The property is mapped onto the XADataSource implementation by looking for a JavaBeans style getter method for the property name. If found, the value of the property is set using the JavaBeans setter with the element text translated to the true property type using the java.beans.PropertyEditor")
	private String value;

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

	/**
	 * Specifies a property value to assign to the XADataSource implementation
	 * class. Each property is identified by the name attribute and the property
	 * value is given by the xa-datasource-property element content. The
	 * property is mapped onto the XADataSource implementation by looking for a
	 * JavaBeans style getter method for the property name. If found, the value
	 * of the property is set using the JavaBeans setter with the element text
	 * translated to the true property type using the java.beans.PropertyEditor
	 */
	@ModelNodeBinding(detypedName = "value")
	public String value() {
		return this.value;
	}

	/**
	 * Specifies a property value to assign to the XADataSource implementation
	 * class. Each property is identified by the name attribute and the property
	 * value is given by the xa-datasource-property element content. The
	 * property is mapped onto the XADataSource implementation by looking for a
	 * JavaBeans style getter method for the property name. If found, the value
	 * of the property is set using the JavaBeans setter with the element text
	 * translated to the true property type using the java.beans.PropertyEditor
	 */
	@SuppressWarnings("unchecked")
	public T value(java.lang.String value) {
		Object oldValue = this.value;
		this.value = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("value", oldValue, value);
		return (T) this;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy