Skip to content
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

OSGi : Get rid of OsgiClientResources #9184

Closed
denis-anisimov opened this issue Oct 15, 2020 · 2 comments
Closed

OSGi : Get rid of OsgiClientResources #9184

denis-anisimov opened this issue Oct 15, 2020 · 2 comments
Assignees
Labels

Comments

@denis-anisimov
Copy link
Contributor

OsgiClientResources is the service implementation of ClientResources.
It's intended to get content of client engine file which is located inside flow-client.
WAR application is able to access this resource as a ClassLoader resource.
This doesn't work in OSGi and this is the purpose of ClientResources.
But OSGi allows to get resources from bundles directly without introducing this extra layer: just find the Bundle instance for flow-client bundle and call getResource from this bundle directly.

The logic still needs to handle two cases : no OSGi container and OSGi container.
I suggest to solve this via OSGi Instantiator (which is another issue) : instead checking every time whether we are in OSGi container or not there should be a set of services whose impl is different with OSGi and without. But the interface should be the same.

This ticket should be solved after OSGi Instantiator ticket.
In the result there will be one OSGi service less in flow-client.

A bit offtopic: there is no need to implement OSGiClientStaticResource in flow-client as well. This service may be implemented in any bundle (e.g. in flow-server or flow-osgi if we decide to keep it) . The only thing which is needed from flow-client is the resource in /META-INF/resources/VAADIN/static/client and this again can be solved via the same way as described above.

@denis-anisimov
Copy link
Contributor Author

See #9185 for Instantiator issue.

@denis-anisimov
Copy link
Contributor Author

Done in the feature/osgi branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant