|Re: Conditional loading of cross refs [message #1007253 is a reply to message #1007043]
||Tue, 05 February 2013 09:33
| Erdal Karaca
Registered: July 2009
That solution works.
Ed Merks wrote on Mon, 04 February 2013 09:32
On 04/02/2013 8:56 AM, Erdal Karaca wrote:
> I have a xmi file that contains changes that have to be synchronized
> with the objects contained in a CDO repository.
> The objects in the xmi file contains cross references to objects in
> the CDO repository. If the CDO repository is empty, those objects
> cannot be resolved. So, additionally, the xmi file contains the
> referenced objects as a copy that must be used instead (i.e. when they
> are not contained the CDO repository).
> When loading the xmi file using an XMIResource: what is the best way
> to conditionally resolve cross refs?
No cross references are resolved during loading...
> I.e. while the resource is loading, I would like to decide whether to
> resolve the objects to the CDO repository if they exist there, or
> resolve to the objects in the XMIResource if not found in the CDO
Perhaps instrumenting your resource set's getEObject would be best.
Proxies are resolved lazily on first access and all such access will
call ResourceSet.getEObject. It delegates to ResourceSet.getResource
which, ultimately calls ResourceSetImpl.demanLoad the first time that
resource is needed. So perhaps that's the best place to intercept the
fact that a URI referring to a CDO resource needs to be redirected in
Powered by FUDForum
. Page generated in 0.01563 seconds