-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a socket event forwarder to allow external agent to watch state #545
base: master
Are you sure you want to change the base?
Conversation
Currently there is no way to watch the bundle state from the outside of the framework, but for agents starting a framework it would be useful to have a way to watch the bundle state. For example in PDE we launch frameworks for different purpose in either run or debug mode but in the UI there is only a limited visualization. That means users are forced to either install special code (e.g. a console) or are quite blindly needing to guess what's going on, both are quite inconvenient as its need special interaction or can even change the system state. This now adds a new (internal) EventForwarder that allows to forward events to the agent, for this purpose the framework must be started with the property org.eclipse.osgi.internal.framework.forwarder and Equinox will open a (local) socket connection forwarding events. This is intentionally made internal and simple as it is not meant as a high level debugging or management facility.
4338f65
to
f0b82cd
Compare
@tjwatson I'd like to merge this if you are OK with that so we can start using it in in PDE. |
I don't think this should be in the framework. It makes it specific to equinox for no reason. Why not make it a system bundle fragment that you configure into the framework at launch so it is not specific to equinox. This only gives info about bundle states. I fear there will be feature creep as I would expect you to soon want to display information about other events, like ServiceEvents. This advanced tooling function belongs on top of the framework. |
They main reason is because I don't want a full blown general purpose management agent and that is "invisible" to the user. A Framework fragment would need special considerations, e.g. colocated to the launcher, we need some way to install it alongside with the usual bundles and users will see it if they list the bundles in the framework. |
All these sound acceptable to me instead of baking it directly into the framework.
There is a difference between being a system bundle fragment from the specification: https://docs.osgi.org/specification/osgi.core/8.0.0/framework.module.html#framework.module.extensionbundles and something that needs to hook into the framework implementation with a It is true that |
I'll check this but the problem remains that then this can only be used if we get from "somewhere" a special jar and provision it together with the framework bundle. Even if that is solved it now will become visible e.g. if one list all bundles in the system. This is especially annoying if I want to remote debug a framework as usually require it to be modified is often not desired, while adding a (temporary) system property is much easier. |
I prefer this inconvenience to baking such things into the framework. |
I see, do you think Equinox project seems a good host for a dedicated bundle then or would you prefer it to be part of PDE (or even a dedicated project) then? |
This is up to you. Equinox is OK, but then you have an added burden of making it API with respect to input/output of the data. If you make it part of PDE it can remain an external for only PDE to use. Over time, once it is stable, then PDE could decide to make it API, at which point we can discuss having it in Equinox. |
Currently there is no way to watch the bundle state from the outside of the framework, but for agents starting a framework it would be useful to have a way to watch the bundle state. For example in PDE we launch frameworks for different purpose in either run or debug mode but in the UI there is only a limited visualization.
That means users are forced to either install special code (e.g. a console) or are quite blindly needing to guess what's going on, both are quite inconvenient as its need special interaction or can even change the system state.
This now adds a new (internal) EventForwarder that allows to forward events to the agent, for this purpose the framework must be started with the property org.eclipse.osgi.internal.framework.forwarder and Equinox will open a (local) socket connection forwarding events. This is intentionally made internal and simple as it is not meant as a high level debugging or management facility.
This is how currently a launch of PDE looks like in the debug view:
This is how it looks like by PDE using this functionality (of course only a first draft):
Expanding the "Threads":