Community
Participate
Working Groups
The RestoreRemoteObjects.doRestore method forces a connect when restoring a filter reference. It conditions this check based on offline flag, but doesn't check the ss.getCacheManager().isRestoreFromMemento() flag. else if (object instanceof ISystemFilterReference) { ISystemFilterReference fref = (ISystemFilterReference)object; ISubSystem ss = fref.getSubSystem(); if (!ss.isOffline()){ if (!ss.isConnected()){ try { >> ss.connect(monitor, false);
Created attachment 110582 [details] patch to check if restoring cache I don't know much about the cache manager. Don, could you tell me if this patch helps?
Created attachment 110669 [details] Restore from cache patch for SubSytsem class
Dave, your patch works for the SystemViewPart class, but there are some additional changes that were required for SubSystem (the resolveFilterStrings methods were forcing a connect as well). I've attached a patch. Required disclaimer: I, Don Yantzi, declare that I developed attached code from scratch, without referencing any 3rd party materials except material licensed under the EPL. I am authorized by my employer to make this contribution under the EPL.
Created attachment 110671 [details] Subsystem patch (with Contribution statement) As advised by Kevin, I've added the contribution statement.
I've committed the patches to cvs.
It looks like the Javadoc for ISubSystem#checkIsConnected(IProgressMonitor) should also be updated to indicate that an implicit connect is _not_ done in case the subsystem is marked offline or there is a cache manager and the contents appears to be cached?
The original patch I submitted has a bug. The ! is misplaced before getCacheManager() and there is an extra one before the call to isRestoreFromMemento: Old line: if (!isConnected() && !isOffline() && (!(getCacheManager() != null) && !getCacheManager().isRestoreFromMemento())) New line: if (!isConnected() && !isOffline() && !((getCacheManager() != null) && getCacheManager().isRestoreFromMemento())) So the second part of the check is: - if cache manager is null then the statement !((getCacheManager() != null) && getCacheManager().isRestoreFromMemento()) evaluates to true. - if cache manager is not null and isRestoreMemento is true then the overall expression is false and the if statement is skipped - if cache manager is not null and isRestoreMemento is false then the overall expression is true and the if statement is executed I'll submit an updated patch that builds on the original patch.
Created attachment 111107 [details] This is an update to the original patch (requires the original patch be applied first)
I've committed the updated patch to cvs.
Created attachment 111512 [details] Patch adding Javadocs for checkIsConnected Would attached patch for ISubSystem#checkIsConnected() be appropriate?
I committed my patch since our ramp-down plan doesn't require review yet: [244807] Improve ISubSystem#checkIsConnected() docs for offline and cache manager cases