eclipse / eavp

Eclipse advanced visualization project
Eclipse Public License 1.0
9 stars 15 forks source link

EAVP service can not be consumed #147

Closed anarak closed 5 years ago

anarak commented 7 years ago

The service provider setVizServiceFactory() is not executed when launching OSGi framework.

anarak commented 7 years ago

Jay encountered the same problem yesterday too using EAVP from the p2 repository (whereas I encountered it from source code) When Jay ran the OSGi console in ICE (2.2.1RC1) and looked at the service, he got the following:

org.eclipse.eavp.viz.service_0.1.1.201701231839 [208] Id=208, Status=ACTIVE Data Root=/home/jay/ICEResearch/ice-2.2.1RC1-20170214/configuration/org.eclipse.osgi/208/data "Registered Services" {org.eclipse.eavp.viz.service.IVizServiceFactory}={service.id=310, service.bundleid=208, service.scope=bundle, component.name=org.eclipse.eavp.viz.service.factory, component.id=76}

However, when he ran my Vaadin bundle using the EAVP bundles that are in the exact same running instance of ICE (i.e. - through the native target and p2 repo, not from source), he got:

org.eclipse.eavp.viz.service_0.1.1.201701231839 [79] Id=79, Status=ACTIVE Data Root=/home/jay/Documents/anaraWorkspace/.metadata/.plugins/org.eclipse.pde.core/stable-test2/org.eclipse.osgi/79/data "No registered services."

anarak commented 7 years ago

After changing the reference cardinality from 1-1 to 0-1 in vizFactory.xml of o.e.avp.viz.service bundle, the constructor in BasicVizServiceFactory was executed, which means we were requiring at least 1 bundle (o.e.ui.IWorkbench) in the code, and because of that this constructor wasn't reachable before.

anarak commented 7 years ago

The other holdback was that the factory's register method was calling Eclipse's ui code for associating the editors to files. Refactoring the association part solves the issue, i.e. the EAVP service becomes consumable.

jayjaybillings commented 7 years ago

Let's leave this open please. This is definitely something that we need to fix because not all projects will use Eclipse.

jayjaybillings commented 7 years ago

@anarak It would be helpful if you would open a broader ticket too so that we can track every place you are finding where similar dependencies exist.

anarak commented 7 years ago

Created #148

SmithRWORNL commented 5 years ago

In 0.3, EAVP will be consumed as an http micro service using the HATEOS principle, instead of an OSGI service.