public <T extends ConfigBeanProxy> Class<T> getProxyType() { return bean.getProxyType(); }
public static void deleteChild( final ConfigBean parent, final ConfigBean child) throws TransactionFailure { ConfigBeanProxy readableView = parent.getProxy(parent.getProxyType()); apply(new SingleConfigCode<ConfigBeanProxy>() { public Object run(ConfigBeanProxy param) throws PropertyVetoException, TransactionFailure { // remove the child from the parent. WriteableView writeableParent = (WriteableView) Proxy.getInvocationHandler(param); _deleteChild(parent, writeableParent, child); return child; } }, readableView); }
private ConfigBean _createAndSet( final ConfigBean parent, final Class<? extends ConfigBeanProxy> childType, final List<AttributeChanges> attributes, final TransactionCallBack<WriteableView> runnable) throws TransactionFailure { ConfigBeanProxy readableView = parent.getProxy(parent.getProxyType()); ConfigBeanProxy readableChild = (ConfigBeanProxy) apply(new SingleConfigCode<ConfigBeanProxy>() { public Object run(ConfigBeanProxy param) throws PropertyVetoException, TransactionFailure { return addChildWithAttributes(param, parent, childType, attributes, runnable); } }, readableView); return (ConfigBean) Dom.unwrap(readableChild); }
private void handleValidation(ConfigModel.Property property, Object value) throws ConstraintViolationException { // First check for dataType constraints -- as was done for v3 Prelude // These validations could be transformed into BV custom annotations // such as AssertBoolean, AssertInteger etc. But since GUI and other // config clients such as AMX need dataType key in @Attribute it's been // decided to validate using existing annotation information Set<ConstraintViolation<?>> constraintViolations = new HashSet<ConstraintViolation<?>>(); if (property instanceof ConfigModel.AttributeLeaf) { ConfigModel.AttributeLeaf al = (ConfigModel.AttributeLeaf)property; if (!al.isReference()) { ConstraintViolation cv = validateDataType(al, value.toString()); if (cv!=null) { constraintViolations.add(cv); } } } constraintViolations.addAll( beanValidator.validateValue( bean.getProxyType(), toCamelCase(property.xmlName()), value)); handleValidationException(constraintViolations); }
final Class<? extends ConfigBeanProxy> childType = child.getProxyType(); Class parentProxyType = parent.getProxyType(); throw new TransactionFailure("Parent " + parent.getProxyType() + " does not have a child of type " + childType);
ConfigBeanProxy readableView = source.getProxy(source.getProxyType()); WriteableView writeable = getWriteableView(readableView, source); if (!writeable.join(t)) { t.rollback(); throw new TransactionFailure("Cannot enlist " + source.getProxyType() + " in transaction", null); ConfigModel.Property prop = writeable.getProperty(xmlName); if (prop == null) { throw new TransactionFailure("Unknown property name " + xmlName + " on " + source.getProxyType(), null); values.add(change.getValue()); } catch (NoSuchMethodException e) { throw new TransactionFailure("Unknown property name " + xmlName + " on " + source.getProxyType(), null);
throw new IllegalArgumentException("A " + master.getProxyType().getSimpleName() + " with the same key \"" + keyValue + "\" already exists in " + parent.getProxyType().getSimpleName() + " " + parent.getKey()) ;
Class parentProxyType = parent.getProxyType(); throw new TransactionFailure("Parent " + parent.getProxyType() + " does not have a child of type " + childType);
public <T extends ConfigBeanProxy> Class<T> getProxyType() { return bean.getProxyType(); }
public <T extends ConfigBeanProxy> Class<T> getProxyType() { return bean.getProxyType(); }
public <T extends ConfigBeanProxy> Class<T> getProxyType() { return bean.getProxyType(); }
if (!view.join(t)) { t.rollback(); throw new TransactionFailure("Cannot enlist " + view.getMasterView().getProxyType() + " in transaction", null);
public static ConfigBeanJMXSupport getInstance( final ConfigBean configBean ) { ConfigBeanJMXSupport helper = INSTANCES.get( configBean.getProxyType() ); if ( helper == null ) { helper = addInstance(configBean); } return helper; }
private static synchronized ConfigBeanJMXSupport addInstance( final ConfigBean configBean ) { final Class<? extends ConfigBeanProxy> intf = configBean.getProxyType(); ConfigBeanJMXSupport helper = INSTANCES.get(intf); if ( helper == null ) { helper = new ConfigBeanJMXSupport(configBean); INSTANCES.put( intf, helper ); } return helper; }
ConfigBeanJMXSupport(final ConfigBean configBean) { this(configBean.getProxyType(), nameFromKey(configBean.model.key)); //debug( "ConfigBeanJMXSupport: " + configBean.getProxyType().getName() + ": key=" + configBean.model.key + ", keyedAs=" + configBean.model.keyedAs); //debug( toString() ); }
/** */ private ConfigBean getActualParent(final ConfigBean configBean) { ConfigBean parent = asConfigBean(configBean.parent()); if (parent == null) { if (!configBean.getProxyType().getName().endsWith("Domain")) { throw new IllegalStateException("WARNING: parent is null for " + configBean.getProxyType().getName() + ", see issue #10528"); } } return parent; }
public final Map<String, String> getDefaultValues(final boolean useAMXAttributeNames) { return getDefaultValues(mConfigBean.getProxyType(), useAMXAttributeNames); }
public Applyer(final ConfigBean cb, final Transaction t) throws TransactionFailure { mConfigBean = cb; mTransaction = t; final ConfigBeanProxy readableView = cb.getProxy(cb.getProxyType()); mWriteable = getWriteableView(readableView, cb); }
public static void deleteChild( final ConfigBean parent, final ConfigBean child) throws TransactionFailure { ConfigBeanProxy readableView = parent.getProxy(parent.getProxyType()); apply(new SingleConfigCode<ConfigBeanProxy>() { public Object run(ConfigBeanProxy param) throws PropertyVetoException, TransactionFailure { // remove the child from the parent. WriteableView writeableParent = (WriteableView) Proxy.getInvocationHandler(param); _deleteChild(parent, writeableParent, child); return child; } }, readableView); }
private final ConfigBeanProxy getConfigBeanProxy() { return getConfigBean().getProxy(getConfigBean().getProxyType()); }