/* (non-Javadoc) * @see org.csstudio.dal.impl.SimplePropertyImpl#initialize(org.csstudio.dal.proxy.PropertyProxy, org.csstudio.dal.proxy.DirectoryProxy) */ @Override public void initialize(PropertyProxy<T, ?> proxy, DirectoryProxy<?> dirProxy) { if (this.proxy != null) { this.proxy.removeProxyListener(proxyListener); if (this.directoryProxy != null && this.directoryProxy != this.proxy) { this.directoryProxy.removeProxyListener(proxyListener); } } else { setConnectionState(ConnectionState.CONNECTING, null); } super.initialize(proxy, dirProxy); // if proxy already has some value, it shoudl share Response<T> res = proxy.getLatestValueResponse(); if (res != null) { updateLastValueCache(res, res.success(), true); } if (proxy != null) { proxy.addProxyListener(proxyListener); if (dirProxy != null && dirProxy != proxy) { dirProxy.addProxyListener(proxyListener); } } }
/* (non-Javadoc) * @see org.csstudio.dal.AsynchronousContext#getLatestSuccess() */ public boolean getLatestSuccess() { return lastResponse == null ? true : lastResponse.success(); }
void updateLastValueCache(Response<T> r, boolean success, boolean change) { lastValueResponse = r; updateLastValueCache(r.getValue(), r.getTimestamp(), success, change); }