Search in sources :

Example 1 with PropertyBag

use of org.jvnet.hk2.config.types.PropertyBag in project Payara by payara.

the class ConnectorsUtil method isDynamicReconfigurationEnabled.

public static boolean isDynamicReconfigurationEnabled(ResourcePool pool) {
    boolean enabled = false;
    if (pool instanceof PropertyBag) {
        PropertyBag properties = (PropertyBag) pool;
        Property property = properties.getProperty(ConnectorConstants.DYNAMIC_RECONFIGURATION_FLAG);
        if (property != null) {
            try {
                if (Long.parseLong(property.getValue()) > 0) {
                    enabled = true;
                }
            } catch (NumberFormatException nfe) {
                _logger.log(Level.WARNING, "invalid.dynamic-reconfig.value", property.getValue());
            }
        }
    }
    return enabled;
}
Also used : PropertyBag(org.jvnet.hk2.config.types.PropertyBag) Property(org.jvnet.hk2.config.types.Property) EnvironmentProperty(com.sun.enterprise.deployment.EnvironmentProperty)

Example 2 with PropertyBag

use of org.jvnet.hk2.config.types.PropertyBag in project Payara by payara.

the class UpgradeService method addProperty.

/**
 * Adds a property with the specified name and value to a writable config
 * object.
 * @param <T> the type of the config object
 * @param propName name of the property to add
 * @param propValue value of the property to add
 * @param owner_w the owning config object
 * @return the added Property object
 * @throws TransactionFailure
 * @throws PropertyVetoException
 */
private <T extends PropertyBag & ConfigBeanProxy> Property addProperty(final String propName, final String propValue, final T owner_w) throws TransactionFailure, PropertyVetoException {
    final Property p = owner_w.createChild(Property.class);
    p.setName(propName);
    p.setValue(propValue);
    owner_w.getProperty().add(p);
    return p;
}
Also used : Property(org.jvnet.hk2.config.types.Property)

Aggregations

Property (org.jvnet.hk2.config.types.Property)2 EnvironmentProperty (com.sun.enterprise.deployment.EnvironmentProperty)1 PropertyBag (org.jvnet.hk2.config.types.PropertyBag)1