org.wildfly.swarm.config.jgroups.Property Maven / Gradle / Ivy
The newest version!
package org.wildfly.swarm.config.jgroups;
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.Addresses;
import org.wildfly.swarm.config.runtime.ResourceType;
import java.beans.PropertyChangeSupport;
import java.beans.PropertyChangeListener;
import org.wildfly.swarm.config.runtime.ModelNodeBinding;
/**
* A protocol property with name and value.
*/
@Addresses({"/subsystem=jgroups/stack=*/protocol=*/property=*",
"/subsystem=jgroups/stack=*/transport=*/property=*",
"/subsystem=jgroups/channel=*/fork=*/protocol=*/property=*"})
@ResourceType("property")
public class Property>
implements
org.wildfly.swarm.config.runtime.Keyed {
private String key;
private PropertyChangeSupport pcs;
@AttributeDocumentation("The value of a protocol property.")
private String value;
public Property(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 value of a protocol property.
*/
@ModelNodeBinding(detypedName = "value")
public String value() {
return this.value;
}
/**
* The value of a protocol property.
*/
@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;
}
}