/** * Returns a writeable view of a configuration object * @param source the configured interface implementation * @return the new interface implementation providing write access * @throws TransactionFailure if the object cannot be enrolled (probably already enrolled in * another transaction). */ public <T extends ConfigBeanProxy> T getWriteableView(final T source) throws TransactionFailure { T configBeanProxy = revealProxy(source); ConfigView sourceBean = (ConfigView) Proxy.getInvocationHandler(configBeanProxy); WriteableView writeableView = getWriteableView(configBeanProxy, (ConfigBean) sourceBean.getMasterView()); return (T) writeableView.getProxy(sourceBean.getProxyType()); }
/** * Enroll a configuration object in a transaction and returns a writeable view of it * * @param source the configured interface implementation * @return the new interface implementation providing write access * @throws TransactionFailure if the object cannot be enrolled (probably already enrolled in * another transaction). */ public <T extends ConfigBeanProxy> T enroll(final T source) throws TransactionFailure { T configBeanProxy = ConfigSupport.revealProxy(source); ConfigView sourceBean = (ConfigView) Proxy.getInvocationHandler(configBeanProxy); WriteableView writeableView = ConfigSupport.getWriteableView(configBeanProxy, (ConfigBean) sourceBean.getMasterView()); if (!writeableView.join(this)) { throw new TransactionFailure("Cannot join transaction : " + sourceBean.getProxyType()); } return (T) writeableView.getProxy(sourceBean.getProxyType()); }
WriteableView writeable = getWriteableView(readableView, source); if (!writeable.join(t)) { t.rollback();
/** * 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); }
proxies[i] = getWriteableView(objects[i]); views[i] = (WriteableView) Proxy.getInvocationHandler(proxies[i]);
/** * Returns a writeable view of a configuration object * @param source the configured interface implementation * @return the new interface implementation providing write access * @throws TransactionFailure if the object cannot be enrolled (probably already enrolled in * another transaction). */ public <T extends ConfigBeanProxy> T getWriteableView(final T source) throws TransactionFailure { ConfigView sourceBean = (ConfigView) Proxy.getInvocationHandler(source); WriteableView writeableView = getWriteableView(source, (ConfigBean) sourceBean.getMasterView()); return (T) writeableView.getProxy(sourceBean.getProxyType()); }
/** * Returns a writeable view of a configuration object * @param source the configured interface implementation * @return the new interface implementation providing write access * @throws TransactionFailure if the object cannot be enrolled (probably already enrolled in * another transaction). */ public <T extends ConfigBeanProxy> T getWriteableView(final T source) throws TransactionFailure { ConfigView sourceBean = (ConfigView) Proxy.getInvocationHandler(source); WriteableView writeableView = getWriteableView(source, (ConfigBean) sourceBean.getMasterView()); return (T) writeableView.getProxy(sourceBean.getProxyType()); }
/** * Returns a writeable view of a configuration object * @param source the configured interface implementation * @return the new interface implementation providing write access * @throws TransactionFailure if the object cannot be enrolled (probably already enrolled in * another transaction). */ public <T extends ConfigBeanProxy> T getWriteableView(final T source) throws TransactionFailure { T configBeanProxy = revealProxy(source); ConfigView sourceBean = (ConfigView) Proxy.getInvocationHandler(configBeanProxy); WriteableView writeableView = getWriteableView(configBeanProxy, (ConfigBean) sourceBean.getMasterView()); return (T) writeableView.getProxy(sourceBean.getProxyType()); }
/** * Returns a writeable view of a configuration object * @param source the configured interface implementation * @return the new interface implementation providing write access * @throws TransactionFailure if the object cannot be enrolled (probably already enrolled in * another transaction). */ public <T extends ConfigBeanProxy> T getWriteableView(final T source) throws TransactionFailure { T configBeanProxy = revealProxy(source); ConfigView sourceBean = (ConfigView) Proxy.getInvocationHandler(configBeanProxy); WriteableView writeableView = getWriteableView(configBeanProxy, (ConfigBean) sourceBean.getMasterView()); return (T) writeableView.getProxy(sourceBean.getProxyType()); }
/** * Enroll a configuration object in a transaction and returns a writeable view of it * * @param source the configured interface implementation * @return the new interface implementation providing write access * @throws TransactionFailure if the object cannot be enrolled (probably already enrolled in * another transaction). */ public <T extends ConfigBeanProxy> T enroll(final T source) throws TransactionFailure { ConfigView sourceBean = (ConfigView) Proxy.getInvocationHandler(source); WriteableView writeableView = ConfigSupport.getWriteableView(source, (ConfigBean) sourceBean.getMasterView()); if (!writeableView.join(this)) { throw new TransactionFailure("Cannot join transaction : " + sourceBean.getProxyType()); } return (T) writeableView.getProxy(sourceBean.getProxyType()); }
/** * Enroll a configuration object in a transaction and returns a writeable view of it * * @param source the configured interface implementation * @return the new interface implementation providing write access * @throws TransactionFailure if the object cannot be enrolled (probably already enrolled in * another transaction). */ public <T extends ConfigBeanProxy> T enroll(final T source) throws TransactionFailure { ConfigView sourceBean = (ConfigView) Proxy.getInvocationHandler(source); WriteableView writeableView = ConfigSupport.getWriteableView(source, (ConfigBean) sourceBean.getMasterView()); if (!writeableView.join(this)) { throw new TransactionFailure("Cannot join transaction : " + sourceBean.getProxyType()); } return (T) writeableView.getProxy(sourceBean.getProxyType()); }
/** * Enroll a configuration object in a transaction and returns a writeable view of it * * @param source the configured interface implementation * @return the new interface implementation providing write access * @throws TransactionFailure if the object cannot be enrolled (probably already enrolled in * another transaction). */ public <T extends ConfigBeanProxy> T enroll(final T source) throws TransactionFailure { T configBeanProxy = ConfigSupport.revealProxy(source); ConfigView sourceBean = (ConfigView) Proxy.getInvocationHandler(configBeanProxy); WriteableView writeableView = ConfigSupport.getWriteableView(configBeanProxy, (ConfigBean) sourceBean.getMasterView()); if (!writeableView.join(this)) { throw new TransactionFailure("Cannot join transaction : " + sourceBean.getProxyType()); } return (T) writeableView.getProxy(sourceBean.getProxyType()); }
/** * Enroll a configuration object in a transaction and returns a writeable view of it * * @param source the configured interface implementation * @return the new interface implementation providing write access * @throws TransactionFailure if the object cannot be enrolled (probably already enrolled in * another transaction). */ public <T extends ConfigBeanProxy> T enroll(final T source) throws TransactionFailure { T configBeanProxy = ConfigSupport.revealProxy(source); ConfigView sourceBean = (ConfigView) Proxy.getInvocationHandler(configBeanProxy); WriteableView writeableView = ConfigSupport.getWriteableView(configBeanProxy, (ConfigBean) sourceBean.getMasterView()); if (!writeableView.join(this)) { throw new TransactionFailure("Cannot join transaction : " + sourceBean.getProxyType()); } return (T) writeableView.getProxy(sourceBean.getProxyType()); }
WriteableView writeable = getWriteableView(readableView, source); if (!writeable.join(t)) { t.rollback();
WriteableView writeable = getWriteableView(readableView, source); if (!writeable.join(t)) { t.rollback();
WriteableView writeable = getWriteableView(readableView, source); if (!writeable.join(t)) { t.rollback();
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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); }