Dangling reference to workspace
![]()
Hello to the forum members,
I have a reference to IWorkspace instance in my RTC extension. User may delete the workspace, resulting in dangling reference to IWorkspace. Is there an API to recognize such dangling reference ? Currently, my way of recognizing such case is using code like: try{ final IWorkspaceManager wsmgr = SCMPlatform..getWorkspaceManager((ITeamRepository) workspace.getOrigin()); final IWorkspaceConnection wsc = wsmgr.getWorkspaceConnection(workspace, null); //Throws ItemNotFoundException //Do something with the workspace } catch (ItemNotFoundException e) { //Update reference to workspace to null } If there is a more direct API to check validity of IWorkspace reference I'll be grateful for your comments. If there's an event I can listen to when workspace is deleted, that will be great as well. Thanks, Gidi |
Accepted answer
![]()
Ralph Schoon (62.3k●3●36●43)
| answered Nov 21 '14, 7:41 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Gidi, I don't think there is a more direct way. In https://rsjazz.wordpress.com/2013/09/24/managing-workspaces-streams-and-components-using-the-plain-java-client-libraries/ it works for me.
Gidi Gal selected this answer as the correct answer
|