public static Property getProperty(PropertyBag me, String name) { for (Property prop : me.getProperty()) { if (prop.getName().equals(name)) { return prop; } } return null; }
@Override public Property getProperty(PropertyBag me, String name) { return me.lookupProperty(name); }
throws PropertyVetoException for (Iterator<Property> it = resource.getProperty().iterator(); it.hasNext();) if (!data.getProperty().contains(prop)) { it.remove(); } else { String oldValue = prop.getValue(); String newValue = data.getPropertyValue(prop.getName()); if (!nullSafeEquals(oldValue, newValue)) { prop.setValue(newValue); for (Property prop : data.getProperty()) { String value = resource.getPropertyValue(prop.getName()); if (value == null) { if(resource instanceof ConfigBeanProxy) { newProp.setName(prop.getName()); newProp.setValue(prop.getValue()); resource.getProperty().add(newProp); } catch(TransactionFailure x) { throw new PropertyVetoException(
public static Property getProperty(PropertyBag me, String name) { for (Property prop : me.getProperty()) { if (prop.getName().equals(name)) { return prop; } } return null; }
@Override public Property getProperty(PropertyBag me, String name) { return me.lookupProperty(name); }
public static Property getProperty(PropertyBag me, String name) { for (Property prop : me.getProperty()) { if (prop.getName().equals(name)) { return prop; } } return null; }
@Override public Property getProperty(PropertyBag me, String name) { return me.lookupProperty(name); }
public Object run(ConfigBeanProxy param) { PropertyBag bag = (PropertyBag) param; final List<Property> propertyList = new ArrayList<Property>(bag.getProperty()); final Iterator<Property> it = propertyList.iterator(); boolean done = false; while (!done && it.hasNext()) { Property prop = it.next(); if (property.equals(prop.getName())) { done = true; it.remove(); } } bag.getProperty().clear(); bag.getProperty().addAll(propertyList); return param; } }, target);
public Object run(ConfigBeanProxy param) { PropertyBag bag = (PropertyBag) param; final List<Property> propertyList = new ArrayList<Property>(bag.getProperty()); final Iterator<Property> it = propertyList.iterator(); boolean done = false; while (!done && it.hasNext()) { Property prop = it.next(); if (property.equals(prop.getName())) { done = true; it.remove(); } } bag.getProperty().clear(); bag.getProperty().addAll(propertyList); return param; } }, target);
public static Property getProperty(PropertyBag me, String name) { for (Property prop : me.getProperty()) { if (prop.getName().equals(name)) { return prop; } } return null; }
public Object run(ConfigBeanProxy param) { PropertyBag bag = (PropertyBag) param; final List<Property> propertyList = new ArrayList<Property>(bag.getProperty()); setProperty(target, attribute, getValue(propertyList, property)); final String message = MessageFormat.format("Moved {0}.property.{1} to {0}.{2}", Dom.convertName(Dom.unwrap(target).getProxyType().getSimpleName()), property, Dom.convertName(attribute)); report(context, message); bag.getProperty().clear(); bag.getProperty().addAll(propertyList); return param; } }, target);
public Object run(ConfigBeanProxy param) { PropertyBag bag = (PropertyBag) param; final List<Property> propertyList = new ArrayList<Property>(bag.getProperty()); setProperty(target, attribute, getValue(propertyList, property)); final String message = MessageFormat.format("Moved {0}.property.{1} to {0}.{2}", Dom.convertName(Dom.unwrap(target).getProxyType().getSimpleName()), property, Dom.convertName(attribute)); report(context, message); bag.getProperty().clear(); bag.getProperty().addAll(propertyList); return param; } }, target);
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; }
/** * 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; }
/** * 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; }