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); }
/** * Allocate a new ConfigBean object as part of the Transaction * associated with this configuration object. This will eventually * be moved to a factory. * * @param type the request configuration object type * @return the propertly constructed configuration object * @throws TransactionFailure if the allocation failed */ public <T extends ConfigBeanProxy> T allocateProxy(Class<T> type) throws TransactionFailure { if (currentTx==null) { throw new TransactionFailure("Not part of a transaction", null); } ConfigBean newBean = bean.allocate(type); WriteableView writeableView = bean.getHabitat().<ConfigSupport>getService(ConfigSupport.class).getWriteableView(newBean.getProxy(type), newBean); writeableView.join(currentTx); return writeableView.getProxy(type); }
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); }
/** * Allocate a new ConfigBean object as part of the Transaction * associated with this configuration object. This will eventually * be moved to a factory. * * @param type the request configuration object type * @return the propertly constructed configuration object * @throws TransactionFailure if the allocation failed */ public <T extends ConfigBeanProxy> T allocateProxy(Class<T> type) throws TransactionFailure { if (currentTx==null) { throw new TransactionFailure("Not part of a transaction", null); } ConfigBean newBean = bean.allocate(type); WriteableView writeableView = bean.getHabitat().<ConfigSupport>getService(ConfigSupport.class).getWriteableView(newBean.getProxy(type), newBean); writeableView.join(currentTx); return writeableView.getProxy(type); }
ConfigBeanProxy childProxy = child.getProxy(childType);
/** * Allocate a new ConfigBean object as part of the Transaction * associated with this configuration object. This will eventually * be moved to a factory. * * @param type the request configuration object type * @return the propertly constructed configuration object * @throws TransactionFailure if the allocation failed */ public <T extends ConfigBeanProxy> T allocateProxy(Class<T> type) throws TransactionFailure { if (currentTx==null) { throw new TransactionFailure("Not part of a transaction", null); } ConfigBean newBean = bean.allocate(type); WriteableView writeableView = bean.getHabitat().getComponent(ConfigSupport.class).getWriteableView(newBean.getProxy(type), newBean); writeableView.join(currentTx); return writeableView.getProxy(type); }
ConfigBeanProxy readableView = source.getProxy(source.getProxyType()); WriteableView writeable = getWriteableView(readableView, source); if (!writeable.join(t)) {
/** * Allocate a new ConfigBean object as part of the Transaction * associated with this configuration object. This will eventually * be moved to a factory. * * @param type the request configuration object type * @return the propertly constructed configuration object * @throws TransactionFailure if the allocation failed */ public <T extends ConfigBeanProxy> T allocateProxy(Class<T> type) throws TransactionFailure { if (currentTx==null) { throw new TransactionFailure("Not part of a transaction", null); } ConfigBean newBean = bean.allocate(type); WriteableView writeableView = bean.getHabitat().getComponent(ConfigSupport.class).getWriteableView(newBean.getProxy(type), newBean); writeableView.join(currentTx); return writeableView.getProxy(type); }
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); }
/** * Allocate a new ConfigBean object as part of the Transaction * associated with this configuration object. This will eventually * be moved to a factory. * * @param type the request configuration object type * @return the propertly constructed configuration object * @throws TransactionFailure if the allocation failed */ public <T extends ConfigBeanProxy> T allocateProxy(Class<T> type) throws TransactionFailure { if (currentTx==null) { throw new TransactionFailure("Not part of a transaction", null); } ConfigBean newBean = bean.allocate(type); WriteableView writeableView = bean.getHabitat().<ConfigSupport>getService(ConfigSupport.class).getWriteableView(newBean.getProxy(type), newBean); writeableView.join(currentTx); return writeableView.getProxy(type); }
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); }
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); }
public static void deleteChild( final ConfigBean parent, final ConfigBean child) throws TransactionFailure { ConfigBeanProxy readableView = parent.getProxy(parent.getProxyType()); apply(new SingleConfigCode<ConfigBeanProxy>() { /** * Runs the following command passing the configration object. The code will be run * within a transaction, returning true will commit the transaction, false will abort * it. * * @param param is the configuration object protected by the transaction * @return any object that should be returned from within the transaction code * @throws java.beans.PropertyVetoException * if the changes cannot be applied * to the configuration */ 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); }
public static void deleteChild( final ConfigBean parent, final ConfigBean child) throws TransactionFailure { ConfigBeanProxy readableView = parent.getProxy(parent.getProxyType()); apply(new SingleConfigCode<ConfigBeanProxy>() { /** * Runs the following command passing the configration object. The code will be run * within a transaction, returning true will commit the transaction, false will abort * it. * * @param param is the configuration object protected by the transaction * @return any object that should be returned from within the transaction code * @throws java.beans.PropertyVetoException * if the changes cannot be applied * to the configuration */ 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 final ConfigBeanProxy getConfigBeanProxy() { return getConfigBean().getProxy(getConfigBean().getProxyType()); }
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); }
throws TransactionFailure { ConfigBeanProxy readableView = node.getProxy(node.getProxyType()); ConfigSupport.apply(new SingleConfigCode<ConfigBeanProxy>() {
if (nv instanceof ConfigBean) { ConfigBean nvb = (ConfigBean) nv; ConfigBeanProxy nvbp = nvb.getProxy(nvb.getProxyType()); logger.log(Level.FINE, AddingDefaultInstanceIndexFor, nvb.getProxyType().getName());
ConfigBeanProxy readableView = source.getProxy(source.getProxyType()); WriteableView writeable = getWriteableView(readableView, source); if (!writeable.join(t)) {