Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

0 votes


Accepted answer

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

0 votes

Comments

Thanks Ralph, I'll continue using this approach.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,935
× 1,202
× 233

Question asked: Nov 19 '14, 10:25 a.m.

Question was seen: 4,131 times

Last updated: Nov 27 '14, 3:42 a.m.

Confirmation Cancel Confirm