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
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