[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [platform-dev] Workspace location, properties and declarative services
|
It sounds like a very sensitive area where even subtle changes in
behavior (timing of events) are likely to be disruptive
downstream...
What will be the net benefit from such a change from an end-user
point of view as well as from and downstream developer point of
view? I.e., will something be faster or more flexible? Will the
platform be easier/cheaper to maintain?
I see this is related to the following bug. There it talks about
simplifying what the activator does:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=572128
Of course simplification is also a worthwhile goal...
On 22.03.2021 23:38, Alex Blewitt
wrote:
I’m trying to migrate the Workspace initialisation from an
Activator start() method to a Declarative Service in https://git.eclipse.org/r/c/platform/eclipse.platform.resources/+/178145
Although this works if the workspace location has
been set with a -data flag, it doesn’t work if the user decides
to change the location later on. That’s because the
IDEApplication prompts the user for a location in the
org.eclipse.ui.ide bundle, which in turn, has a dependency on
the org.eclipse.core.resources bundle that defines the
workspace.
The following happens at startup:
* Equinox publishes an
org.eclipse.services.datalocation.Location of type
osgi.instance.area
* IDEApplication prompts the user for a dialog, and
then sets the instance location:
* This is ultimately accessible from
Workspace->LocalMetaArea->Activator.installLocation
The problem is that because the Location is
published at startup, whether or not it has been set, it’s not
trivial to configure to DS to set up a dependency to arrive when
the value has been changed. It’s also not clear what should
happen to configurations that use ResourcesPlugin but don’t use
the IDEApplication.
The problem is that if we launch the Workspace with
no dependencies, it will default to and initially set up) the
default value, unless @noDefault is specified, in which case it
will likely error out.
We could set up a dependency such that the Workspace
only is launched when an osgi.instance.area Location is
published, but Equinox will do this automatically unless the
@noDefault is given.
Finally, we could publish a
service/placeholder/Location in IDEApplication, which could be
used to trigger the creation of the Workspace by DS.
Ultimately I think the only way of solving it is to
either set the URL of the workspace as a service property of the
location when it’s published, and when the URL is updated then
update the service properties accordingly. Thus we could have
the creation of the workspace dependent upon a service being
published:
{org.eclipse.osgi.service.datalocation.Location}={type=osgi.instance.area}
=>
{org.eclipse.osgi.service.datalocation.Location}={type=osgi.instance.area,url="">
We could then set up the DS component for the
Workspace to listen to a service filter that has the URL set as
a property.
Thoughts?
Alex
_______________________________________________
platform-dev mailing list
platform-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/platform-dev
Back to the top