-
Notifications
You must be signed in to change notification settings - Fork 164
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: make it possible to use Vaadin components as OSGi services #5125
Comments
All OSGi related classes should go into Separate ticket for servlet auto-registration : #4796 |
Hi, I'm working on OSGI with Vaadin, are there any updates in making this work as planned? And are there workarounds regarding this issue so far? Kind regards, |
Depending on the progress so far: Maybe another possible way is an integration between Flow and OSGi via CDI? There is a Flow CDI integration and there is a new OSGi CDI integration. |
Hello, just as an update: we are not currently actively working on this due to other priorities. Contributions are welcome and we will give any help needed and answer questions in case someone is interested in taking a look at this. Currently my best guess is that we will be able to take a look at further OSGi improvements in the early summer. That is too late for V14, but hopefully we can make a minor release for Flow with the improvements and keep backwards compatibility to 14. |
This topic is very interesting for me also as I'm currently evaluating the use of Karaf and OSGi, see #6525. So I'm willing to help out here, if possible. |
@Sandared did you make any progress on the Vaadin Flow CDI OSGi Integration? Thanks! |
Hi Julian, unfortunately I didn't dig further into this issue after my initial tests, as we decided to use a complete different technology stack. |
Hey @Sandared what a pitty : ) |
Use the same way like Http-Whiteboard or JaxRs-Whiteboard Then an
mvn dependency for @ComponentPropertyType (OSGi R7)
generated Service Component Registry file:
|
Here is a Vaadin-OSGi-Implementation and Examples to that can handle this Topic. |
Awesome :) Thanks!
Stefan Bischof ***@***.***> schrieb am Fr., 25. Juni 2021,
10:28:
… Here is a Vaadin-OSGi-Implementation and Examples
<https://github.com/geckoprojects-org/org.geckoprojects.vaadin> to that
can handle this Topic.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5125 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABGTJPOP2JU6C6XUGL6CH4LTUQ43JANCNFSM4GZ6DY7A>
.
|
The main idea is to provide a way to do something like this:
See here: https://github.com/Sandared/flow-osgi/blob/master/README.md
The original ticket is:
#5017
So it should be possible to use DS features (like injecting via
@Reference
in the example) in Vaadin components (at least in Route targets).For the first iteration we require from the component being declared as a service via the annotation
@Component(scope=ServiceScope.PROTOTYPE)
.It's a boilerplate code which you should use every time but let's require this at least for the first iteration (see discussion #5017 (comment) and following comments). But let's go with it for now.
If you inject a component via
@Id
then this component should be able also use DS features.So it's primarily about a custom
Instantiator
.It's
getOrCreate
method (most likely only this method) should instantiate classes via OSGi mechanism.See https://github.com/Sandared/flow-osgi/blob/master/flow.osgi.integration/src/main/java/io/jatoms/flow/osgi/integration/v2/OSGiInstantiatorV2.java as an implementation example.
Let's avoid using
ServiceLoader
as a way to register anInstantiator
instance.So to be able to use a custom
Instantiator
we should subclassVaadinServletService
and override its methodcreateInstantiator
.This is very much like Spring add-on: https://github.com/vaadin/spring/blob/master/vaadin-spring/src/main/java/com/vaadin/flow/spring/SpringInstantiator.java.
So as a part of this ticket the following things should be done:
Instantiator
class .VaadinServletService
which uses this instantatorVaadinServlet
which uses a customVaadinServletService
test-root-context
module. The best way would be to add UI components and test as a part of thefelix-jetty
module (which is used now as a module for testing OSGi). It already has IT test (which is not really an IT test). But it has no UI components. Note that the project config will need to be changed if you add UI components right to the module (the module is not deployed to the OSGi container): module should become an OSGi bundle and it should be deployed .The text was updated successfully, but these errors were encountered: