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 support for Flow 2.x in npm mode #9187

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions drivers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@
<root>
<windows>
<driver id="googlechrome">
<version id="86.0.4240.22">
<version id="87.0.4280.20">
<bitrate thirtytwobit="true" sixtyfourbit="true">
<filelocation>https://chromedriver.storage.googleapis.com/86.0.4240.22/chromedriver_win32.zip</filelocation>
<hash>5bc302d49dd4afdbc538f026e56bc1c1ddb9d1c8</hash>
<filelocation>https://chromedriver.storage.googleapis.com/87.0.4280.20/chromedriver_win32.zip</filelocation>
<hash>bc1c5b8cd8225364144a1b2cd9198e929daa7492</hash>
<hashtype>sha1</hashtype>
</bitrate>
</version>
</driver>
</windows>
<linux>
<driver id="googlechrome">
<version id="86.0.4240.22">
<version id="87.0.4280.20">
<bitrate sixtyfourbit="true">
<filelocation>https://chromedriver.storage.googleapis.com/86.0.4240.22/chromedriver_linux64.zip</filelocation>
<hash>b8b531e4560e6c749daecbceb7584c5f0e6ae4da</hash>
<filelocation>https://chromedriver.storage.googleapis.com/87.0.4280.20/chromedriver_linux64.zip</filelocation>
<hash>e249b148dab9f9c9073a965d4b2dffc022a001e8</hash>
<hashtype>sha1</hashtype>
</bitrate>
</version>
</driver>
</linux>
<osx>
<driver id="googlechrome">
<version id="86.0.4240.22">
<version id="87.0.4280.20">
<bitrate sixtyfourbit="true">
<filelocation>https://chromedriver.storage.googleapis.com/86.0.4240.22/chromedriver_mac64.zip</filelocation>
<hash>3cbbd63803df46cea1cbc1eb5fb753de69248279</hash>
<filelocation>https://chromedriver.storage.googleapis.com/87.0.4280.20/chromedriver_mac64.zip</filelocation>
<hash>fe58bfb60769638e48334d49821079b2dc6f3ab7</hash>
<hashtype>sha1</hashtype>
</bitrate>
</version>
Expand Down
3 changes: 1 addition & 2 deletions flow-client/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ Bundle-Name: Flow Client Engine
Bundle-Version: ${osgi.bundle.version}
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0
Import-Package: !*, com.vaadin.flow.client, org.osgi.framework, \
org.osgi.service.http, com.vaadin.flow.osgi.support
Import-Package: !*
Export-Package: !*
6 changes: 0 additions & 6 deletions flow-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>flow-osgi</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
Expand Down

This file was deleted.

6 changes: 6 additions & 0 deletions flow-osgi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>

<dependency>
<groupId>com.vaadin</groupId>
<artifactId>flow-server</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.osgi</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
* Copyright 2000-2020 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.vaadin.flow.osgi.support;

import java.util.stream.Stream;

import org.osgi.service.component.annotations.Component;

import com.vaadin.flow.di.DefaultInstantiator;
import com.vaadin.flow.di.Instantiator;
import com.vaadin.flow.di.InstantiatorFactory;
import com.vaadin.flow.di.Lookup;
import com.vaadin.flow.i18n.I18NProvider;
import com.vaadin.flow.server.VaadinService;
import com.vaadin.flow.server.VaadinServiceInitListener;

/**
denis-anisimov marked this conversation as resolved.
Show resolved Hide resolved
* @author Vaadin Ltd
* @since
*
*/
@Component(immediate = true, service = InstantiatorFactory.class)
public class OSGiInstantiatorFactory implements InstantiatorFactory {

private static final class OsgiInstantiator extends DefaultInstantiator
implements Instantiator {

private final Lookup lookup;
denis-anisimov marked this conversation as resolved.
Show resolved Hide resolved

private OsgiInstantiator(VaadinService service) {
super(service);

lookup = service.getContext().getAttribute(Lookup.class);
}

@Override
public Stream<VaadinServiceInitListener> getServiceInitListeners() {
return lookup.lookupAll(VaadinServiceInitListener.class).stream();
}

@Override
public I18NProvider getI18NProvider() {
I18NProvider provider = super.getI18NProvider();
if (provider == null) {
provider = lookup.lookup(I18NProvider.class);
}
return provider;
}
}

@Override
public Instantiator createInstantitor(VaadinService service) {
return new OsgiInstantiator(service);
}

}
12 changes: 0 additions & 12 deletions flow-push/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,13 @@
<artifactId>atmosphere-runtime</artifactId>
<version>${atmosphere.runtime.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>flow-osgi</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
<version>${osgi.core.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
<version>${osgi.compendium.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions flow-server/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Bundle-Version: ${osgi.bundle.version}
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0
Import-Package: org.atmosphere*;resolution:=optional;version='${atmosphere.runtime.version}',\
org.apache.http*;resolution:=optional;,\
*
Export-Package: com.vaadin.flow.client,\
!com.vaadin.flow.push*, com.vaadin.flow*;-noimport:=true
Expand Down

This file was deleted.

This file was deleted.

Loading