Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 231916 - Serialization support for ServiceModelManager
Summary: Serialization support for ServiceModelManager
Status: RESOLVED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: RDT (show other bugs)
Version: 2.1M2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.1   Edit
Assignee: Chris Recoskie CLA
QA Contact: Greg Watson CLA
URL:
Whiteboard:
Keywords:
Depends on: 231910
Blocks:
  Show dependency tree
 
Reported: 2008-05-13 15:22 EDT by Jason Montojo CLA
Modified: 2011-05-14 06:35 EDT (History)
0 users

See Also:


Attachments
Proposed patch (13.26 KB, patch)
2008-05-13 15:22 EDT, Jason Montojo CLA
no flags Details | Diff
Proposed patch 2 (14.57 KB, patch)
2008-05-13 16:21 EDT, Jason Montojo CLA
no flags Details | Diff
Test suite/plugin for RDT services (10.52 KB, application/zip)
2008-05-13 16:23 EDT, Jason Montojo CLA
no flags Details
Proposed patch - IMemento version (16.99 KB, patch)
2008-05-15 17:24 EDT, Jason Montojo CLA
g.watson: iplog+
Details | Diff
Updated tests (10.85 KB, application/zip)
2008-05-15 17:25 EDT, Jason Montojo CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Montojo CLA 2008-05-13 15:22:19 EDT
Created attachment 100023 [details]
Proposed patch

This patch persists the RDT service model between Eclipse sessions.  Zip file for test plugin to follow.
Comment 1 Jason Montojo CLA 2008-05-13 15:23:29 EDT
FYI, this patch will cause compilation errors unless the one in bug 231910 has been applied as well.
Comment 2 Jason Montojo CLA 2008-05-13 16:21:20 EDT
Created attachment 100040 [details]
Proposed patch 2

This patch is the same as the first but adds an implementation of equals() and hashcode() to Service.  This is necessary for the (soon-to-be-posted) test suite to pass.
Comment 3 Jason Montojo CLA 2008-05-13 16:23:25 EDT
Created attachment 100042 [details]
Test suite/plugin for RDT services

This zip file contains a plugin project that houses tests for the RDT services plugin.
Comment 4 Greg Watson CLA 2008-05-13 18:49:58 EDT
Moving to 2.1
Comment 5 Greg Watson CLA 2008-05-13 18:55:33 EDT
Hi Jason, is there some reason you're using a File rather than a Memento to persist the model?
Comment 6 Jason Montojo CLA 2008-05-14 09:46:16 EDT
Hi Greg,

I'm implementing ISaveParticipant in order to be notified of workspace save/load events.  That interface uses a series of files to store data.  I don't think it supports IMemento...
Comment 7 Greg Watson CLA 2008-05-14 14:59:08 EDT
I'm getting an error when I try to apply the patch. It's complaining about the patch to ServiceModelManager. I applied 231910 first, is this likely to be the problem?
Comment 8 Jason Montojo CLA 2008-05-14 15:47:24 EDT
Thanks, Greg.  I think I'll have to respin the patch.  I made it before 231910 was applied and they both affect the same file so I'm sure the offsets will be off.

Chris mentioned that this patch doesn't provide hooks to allow service providers an opportunity to serialize their state.  I think that using IMemento would be more appropriate in this case, since it provides a general way of persisting structured data.  I'll rework this and submit a new patch.
Comment 9 Jason Montojo CLA 2008-05-15 17:24:34 EDT
Created attachment 100555 [details]
Proposed patch - IMemento version

This uses IMementos to allow service provider implementations to persist their state along with the service model.
Comment 10 Jason Montojo CLA 2008-05-15 17:25:05 EDT
Created attachment 100556 [details]
Updated tests

Updated test suite plugin.
Comment 11 Greg Watson CLA 2008-05-16 16:27:02 EDT
Committed, thanks! Would you mind making sure that all methods have javadoc or non-javadoc comments (not necessary in test plugin)?
Comment 12 Greg Watson CLA 2008-07-31 09:42:24 EDT
Closing