Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] CDOPackageRegistryImpl does not delegate to EMF global registry
[CDO] CDOPackageRegistryImpl does not delegate to EMF global registry [message #423823] Tue, 07 October 2008 15:12 Go to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Hi guys,

I've been having problems with (EMF globaly) registered packages.
CDO prepares a ResourceSet by, among other things, adding it's own
implementation of EPackage.Registry (CDOPackageRegistry).

I'm trying to use a CDO-Prepared ResourceSet for both CDOResources and
XMIResources. For the first one everything works fine because the
CDO-Native package is properly registered. But when I try to get an
XMIResource, the org.eclipse.emf.ecore.xmi.impl.XMLHandler is unable to
find the proper package for my Legacy Package. This is understandable,
since that package shouldn't be in the CDOPackageRegistry (at least not
while we don't have Legacy support).

But I wonder... why CDOPackageRegistryImpl does not delegate to EMG
global registry? I modified the constructor to set the delegation, and
everything works fine.

public CDOPackageRegistryImpl()
{
delegateRegistry = EPackage.Registry.INSTANCE;
}

Is there a reason why this delegation is not being set?
In case this shouldn't be done by default, is it possible to add a
method to allow the client to specify the delegation?

Cheers,
ViK.
Re: [CDO] CDOPackageRegistryImpl does not delegate to EMF global registry [message #423830 is a reply to message #423823] Tue, 07 October 2008 16:37 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi ViK,

Have you already tried the Eager or Lazy subclasses of CDOPackageRegistry?
I think these should solve your problem.

Cheers
/Eike


Víctor Roldán Betancort schrieb:
> Hi guys,
>
> I've been having problems with (EMF globaly) registered packages.
> CDO prepares a ResourceSet by, among other things, adding it's own
> implementation of EPackage.Registry (CDOPackageRegistry).
>
> I'm trying to use a CDO-Prepared ResourceSet for both CDOResources and
> XMIResources. For the first one everything works fine because the
> CDO-Native package is properly registered. But when I try to get an
> XMIResource, the org.eclipse.emf.ecore.xmi.impl.XMLHandler is unable
> to find the proper package for my Legacy Package. This is
> understandable, since that package shouldn't be in the
> CDOPackageRegistry (at least not while we don't have Legacy support).
>
> But I wonder... why CDOPackageRegistryImpl does not delegate to EMG
> global registry? I modified the constructor to set the delegation, and
> everything works fine.
>
> public CDOPackageRegistryImpl()
> {
> delegateRegistry = EPackage.Registry.INSTANCE;
> }
>
> Is there a reason why this delegation is not being set?
> In case this shouldn't be done by default, is it possible to add a
> method to allow the client to specify the delegation?
>
> Cheers,
> ViK.


Re: [CDO] CDOPackageRegistryImpl does not delegate to EMF global registry [message #423833 is a reply to message #423830] Tue, 07 October 2008 16:49 Go to previous messageGo to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Eike,

I use Eager and it doesn't solve my problem :(
and I cannot use Lazy, since I need automatic CDO-Native package
registration.

I see that my ResourceSet's CDOViewSetPackageRegistryImpl delegates to
the session's PackageRegistry, but EagerPackageRegistry doesn't seem to
delegate to EPackage.Registry.INSTANCE. Furthermore, "delegateRegistry"
attribute is null.

Eike Stepper escribió:
> Hi ViK,
>
> Have you already tried the Eager or Lazy subclasses of CDOPackageRegistry?
> I think these should solve your problem.
>
> Cheers
> /Eike
>
>
> Víctor Roldán Betancort schrieb:
>> Hi guys,
>>
>> I've been having problems with (EMF globaly) registered packages.
>> CDO prepares a ResourceSet by, among other things, adding it's own
>> implementation of EPackage.Registry (CDOPackageRegistry).
>>
>> I'm trying to use a CDO-Prepared ResourceSet for both CDOResources and
>> XMIResources. For the first one everything works fine because the
>> CDO-Native package is properly registered. But when I try to get an
>> XMIResource, the org.eclipse.emf.ecore.xmi.impl.XMLHandler is unable
>> to find the proper package for my Legacy Package. This is
>> understandable, since that package shouldn't be in the
>> CDOPackageRegistry (at least not while we don't have Legacy support).
>>
>> But I wonder... why CDOPackageRegistryImpl does not delegate to EMG
>> global registry? I modified the constructor to set the delegation, and
>> everything works fine.
>>
>> public CDOPackageRegistryImpl()
>> {
>> delegateRegistry = EPackage.Registry.INSTANCE;
>> }
>>
>> Is there a reason why this delegation is not being set?
>> In case this shouldn't be done by default, is it possible to add a
>> method to allow the client to specify the delegation?
>>
>> Cheers,
>> ViK.
Re: [CDO] CDOPackageRegistryImpl does not delegate to EMF global registry [message #423856 is a reply to message #423833] Wed, 08 October 2008 07:47 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Víctor Roldán Betancort schrieb:
> Eike,
>
> I use Eager and it doesn't solve my problem :(
> and I cannot use Lazy, since I need automatic CDO-Native package
> registration.
>
> I see that my ResourceSet's CDOViewSetPackageRegistryImpl delegates to
> the session's PackageRegistry, but EagerPackageRegistry doesn't seem
> to delegate to EPackage.Registry.INSTANCE. Furthermore,
> "delegateRegistry" attribute is null.
CDOViewSetPackageRegistryImpl and CDOPackageRegistryImpl are completely
different and not comparable.

I know once we had the possibility to set a delegate registry.
Unfortunately I can't remember anymore the reason that led to removal of
this support. Usually I'm not a fan of the EMF global package registry
because we can't control it exclusively but maybe now that we have the
external refenrences feature it makes sense again to allow delegation to
the global registry.

Vik, can you please file a Bugzilla so that I can investigate how to
enable this (allow it only before the session is opened or even after that)?

Cheers
/Eike

>
> Eike Stepper escribió:
>> Hi ViK,
>>
>> Have you already tried the Eager or Lazy subclasses of
>> CDOPackageRegistry?
>> I think these should solve your problem.
>>
>> Cheers
>> /Eike
>>
>>
>> Víctor Roldán Betancort schrieb:
>>> Hi guys,
>>>
>>> I've been having problems with (EMF globaly) registered packages.
>>> CDO prepares a ResourceSet by, among other things, adding it's own
>>> implementation of EPackage.Registry (CDOPackageRegistry).
>>>
>>> I'm trying to use a CDO-Prepared ResourceSet for both CDOResources
>>> and XMIResources. For the first one everything works fine because
>>> the CDO-Native package is properly registered. But when I try to get
>>> an XMIResource, the org.eclipse.emf.ecore.xmi.impl.XMLHandler is
>>> unable to find the proper package for my Legacy Package. This is
>>> understandable, since that package shouldn't be in the
>>> CDOPackageRegistry (at least not while we don't have Legacy support).
>>>
>>> But I wonder... why CDOPackageRegistryImpl does not delegate to EMG
>>> global registry? I modified the constructor to set the delegation,
>>> and everything works fine.
>>>
>>> public CDOPackageRegistryImpl()
>>> {
>>> delegateRegistry = EPackage.Registry.INSTANCE;
>>> }
>>>
>>> Is there a reason why this delegation is not being set?
>>> In case this shouldn't be done by default, is it possible to add a
>>> method to allow the client to specify the delegation?
>>>
>>> Cheers,
>>> ViK.


Re: [CDO] CDOPackageRegistryImpl does not delegate to EMF global registry [message #423859 is a reply to message #423856] Wed, 08 October 2008 09:40 Go to previous message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Eike,

> Vik, can you please file a Bugzilla so that I can investigate how to
> enable this (allow it only before the session is opened or even after
> that)?

See my follow-up comments at:

Bug 250064: "CDOPackageRegistryImpl does not delegate to EMF global
registry"

https://bugs.eclipse.org/bugs/show_bug.cgi?id=250064
Previous Topic:emf compare
Next Topic:Extending LoadResourceDialog
Goto Forum:
  


Current Time: Fri Apr 19 12:48:09 GMT 2024

Powered by FUDForum. Page generated in 0.23067 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top