Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package com.sun.enterprise.deployment.runtime;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;
import org.glassfish.deployment.common.Descriptor;
/**
* This base class defines common behaviour and data for all runtime
* descriptors.
*
* @author Jerome Dochez
*/
public abstract class RuntimeDescriptor extends Descriptor {
private static final long serialVersionUID = 1L;
private final PropertyChangeSupport propListeners;
/** Creates a new instance of RuntimeDescriptor */
public RuntimeDescriptor(RuntimeDescriptor other) {
super(other);
propListeners = new PropertyChangeSupport(this);
}
/** Creates a new instance of RuntimeDescriptor */
public RuntimeDescriptor() {
propListeners = new PropertyChangeSupport(this);
}
/**
* Add a property listener for this bean
*
* @param l the property listener
*/
public void addPropertyChangeListener(PropertyChangeListener l) {
propListeners.addPropertyChangeListener(l);
}
/**
* removes a property listener for this bean
*
* @param l the property listener to remove
*/
public void removePropertyChangeListener(PropertyChangeListener l) {
propListeners.removePropertyChangeListener(l);
}
/**
* Add a property listener for a specific property name
*
* @param n the property name
* @param l the property listener
*/
public void addPropertyChangeListener(String n, PropertyChangeListener l) {
propListeners.addPropertyChangeListener(n, l);
}
/**
* Remover a property listener for specific property name
*
* @param n the property name
* @param l the property listener
*/
public void removePropertyChangeListener(String n, PropertyChangeListener l) {
propListeners.removePropertyChangeListener(n, l);
}
/**
* Sets a property value
*
* @param name the property name
* @param value the property value
*/
public void setValue(String name, Object value) {
Object oldValue = getExtraAttribute(name);
addExtraAttribute(name, value);
propListeners.firePropertyChange(name, oldValue, value);
}
/**
* @return a property value
*/
public T getValue(String name) {
return getExtraAttribute(name);
}
/**
* indexed property support
*/
protected void setValue(String name, int index, Object value) {
List