Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mdt-papyrus.dev] IMultiDiagramEditor service?

Thanks, Camille.

I think I missed the fact that the editor adds itself to the ServicesRegistry as an ad hoc service registration.  I suppose the IService[Factory] API is only required for services registered on the extension point?  That would make sense, but I wonder how the registry shutdown procedure should handle non-service(factorie)s?

In any case, it doesn't appear that this breaks my use case, which is new model creation. In that case, the ModelSet and attendant services are used in the context of a wizard, so the editor would not be expected to be available, so perhaps some accounting for that is needed. I've thought, before, that the ServicesRegistry should support optional services, returning null instead of throwing when they aren't available.  Would this be a good case for that?  I'd be happy to work up a patch, as this is a capability that I could use for my CDO work.

Thanks for attending to this!

cW




On 2013-02-20, at 4:12, LETAVERNIER Camille <Camille.LETAVERNIER@xxxxxx> wrote:

Hello Christian,

 

The IMultiDiagramEditor service is the Papyrus Editor. It should be available as soon as the editor is started (The editor registers itself as a Service in the init() method).

 

Ø  In particular, the SaveAndDirtyService attempts to get the IMultiDiagramEditor service, although it doesn't declare this service as a dependency.  

 

I’ll check and fix that.

 

Ø  .  This results in the first exception below on stderr (why not in the log?) when creating a new model using the New Papyrus Model wizard.

 

The plugin oep.infra.core (sometimes?) uses its own log which prints the errors to strerr. And It seems that I was filtering stderr when working on the Page Manager. This exception is actually caught, but is still logged. It shouldn’t be logged here at all. I will fix that.

 

Ø  I have the implementation of this interface, but it doesn't appear to be a service, so this doesn't appear to be a matter of simply registering it on the services extension point.

 

Any object can be registered as a Service, it doesn’t need to implement the Papyrus IService. The problem in this case is that some services cannot be started because they depend on a service which is not available. I won’t go into the details, but basically:

 

-          We try to initialize services that are actually not required (and not available)

-          This should be a warning instead of an error, as we’re not even using them

-          Fully removing this warning depends on pending work on the new ServicesRegistry

 

I’ll remove the logged error for now, as it is actually expected and caught.

 

Related task:

 

398712: [Core] Multiple issues with the PageManager

https://bugs.eclipse.org/bugs/show_bug.cgi?id=398712

 


Regards,
Camille

__________________________

Camille Letavernier

+33 (0)1 69 08 00 59 - camille.letavernier@xxxxxx

CEA LIST - Laboratoire d'Ingénierie dirigée par les modèles pour les Systèmes Embarqués (LISE)

Papyrus : http://www.eclipse.org/papyrus

 

De : mdt-papyrus.dev-bounces@xxxxxxxxxxx [mailto:mdt-papyrus.dev-bounces@xxxxxxxxxxx] De la part de Christian W. Damus
Envoyé : mercredi 20 février 2013 00:00
À : Papyrus Project list
Objet : [mdt-papyrus.dev] IMultiDiagramEditor service?

 

Hi, Team,

 

There seems to be an expectation in the code that there is an IMultiDiagramEditor service, but I see no sign of it.

 

In particular, the SaveAndDirtyService attempts to get the IMultiDiagramEditor service, although it doesn't declare this service as a dependency.  This results in the first exception below on stderr (why not in the log?) when creating a new model using the New Papyrus Model wizard.

 

Also, the ResourceUpdateService does declare IMultiDiagramEditor as a dependency, which (because it doesn't exist) results in the second and third exceptions below.

 

Am I missing a plug-in that provides the IMultiDiagramEditor service registration?  I have the implementation of this interface, but it doesn't appear to be a service, so this doesn't appear to be a matter of simply registering it on the services extension point.

 

Thanks,

 

Christian

 

 

-------- 8< --------

 

19-Feb-2013 5:51:49 PM org.eclipse.papyrus.infra.core.services.ServicesRegistry initServices

SEVERE: Can't initialize service 'org.eclipse.papyrus.infra.core.services.internal.StartStartupEntry@342e5233: key=org.eclipse.papyrus.infra.core.lifecycleevents.ISaveAndDirtyService'

org.eclipse.papyrus.infra.core.services.ServiceNotFoundException: No service registered under 'interface org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor'

       at org.eclipse.papyrus.infra.core.services.ServicesRegistry.getService(ServicesRegistry.java:369)

       at org.eclipse.papyrus.infra.core.lifecycleevents.SaveAndDirtyService.init(SaveAndDirtyService.java:186)

       at org.eclipse.papyrus.infra.core.services.internal.ServiceEntry.initService(ServiceEntry.java:113)

       at org.eclipse.papyrus.infra.core.services.internal.StartStartupEntry.initService(StartStartupEntry.java:60)

       at org.eclipse.papyrus.infra.core.services.ServicesRegistry.initServices(ServicesRegistry.java:935)

       at org.eclipse.papyrus.infra.core.services.ServicesRegistry.startRegistry(ServicesRegistry.java:448)

       at org.eclipse.papyrus.uml.diagram.wizards.CreateModelWizard.initServicesRegistry(CreateModelWizard.java:212)

       at org.eclipse.papyrus.uml.diagram.wizards.CreateModelWizard.createAndOpenPapyrusModel(CreateModelWizard.java:186)

       at org.eclipse.papyrus.uml.diagram.wizards.CreateModelWizard.performFinish(CreateModelWizard.java:161)

       at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)

       ...

 

19-Feb-2013 5:51:49 PM org.eclipse.papyrus.infra.core.services.ServicesRegistry initServices

SEVERE: Can't initialize service 'org.eclipse.papyrus.infra.core.services.internal.StartStartupEntry@4d16ad08: key=org.eclipse.papyrus.uml.diagram.common.resourceupdate'

org.eclipse.papyrus.infra.core.services.ServiceNotFoundException: No service registered under 'interface org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor'

       at org.eclipse.papyrus.infra.core.services.ServicesRegistry.getService(ServicesRegistry.java:369)

       at org.eclipse.papyrus.uml.diagram.common.resourceupdate.ResourceUpdateService.init(ResourceUpdateService.java:60)

       at org.eclipse.papyrus.infra.core.services.internal.ServiceEntry.initService(ServiceEntry.java:113)

       at org.eclipse.papyrus.infra.core.services.internal.StartStartupEntry.initService(StartStartupEntry.java:60)

       at org.eclipse.papyrus.infra.core.services.ServicesRegistry.initServices(ServicesRegistry.java:935)

       at org.eclipse.papyrus.infra.core.services.ServicesRegistry.startRegistry(ServicesRegistry.java:448)

       at org.eclipse.papyrus.uml.diagram.wizards.CreateModelWizard.initServicesRegistry(CreateModelWizard.java:212)

       at org.eclipse.papyrus.uml.diagram.wizards.CreateModelWizard.createAndOpenPapyrusModel(CreateModelWizard.java:186)

       at org.eclipse.papyrus.uml.diagram.wizards.CreateModelWizard.performFinish(CreateModelWizard.java:161)

       at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)

       ...

 

19-Feb-2013 5:57:05 PM org.eclipse.papyrus.infra.core.services.ServicesRegistry disposeServices

SEVERE: Can't dispose service'org.eclipse.papyrus.uml.diagram.common.resourceupdate'

java.lang.NullPointerException

       at org.eclipse.papyrus.uml.diagram.common.resourceupdate.ResourceUpdateService.deactivate(ResourceUpdateService.java:179)

       at org.eclipse.papyrus.uml.diagram.common.resourceupdate.ResourceUpdateService.disposeService(ResourceUpdateService.java:188)

       at org.eclipse.papyrus.infra.core.services.internal.ServiceEntry.disposeService(ServiceEntry.java:155)

       at org.eclipse.papyrus.infra.core.services.internal.StartStartupEntry.disposeService(StartStartupEntry.java:80)

       at org.eclipse.papyrus.infra.core.services.ServicesRegistry.disposeServices(ServicesRegistry.java:987)

       at org.eclipse.papyrus.infra.core.services.ServicesRegistry.disposeRegistry(ServicesRegistry.java:849)

       at org.eclipse.papyrus.uml.diagram.wizards.CreateModelWizard.createAndOpenPapyrusModel(CreateModelWizard.java:198)

       at org.eclipse.papyrus.uml.diagram.wizards.CreateModelWizard.performFinish(CreateModelWizard.java:161)

       at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)

       ...

 

_______________________________________________
mdt-papyrus.dev mailing list
mdt-papyrus.dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/mdt-papyrus.dev

Back to the top