-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add internal classes to access classloader and init context (#…
…9618) * chore: add internal classes to access classloader and init context related to #9601 : needed to restore OSGi resource provider
- Loading branch information
Denis
authored
Dec 9, 2020
1 parent
89190a5
commit f0a6e84
Showing
6 changed files
with
166 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
flow-server/src/main/java/com/vaadin/flow/internal/ApplicationClassLoaderAccess.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* 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.internal; | ||
|
||
import com.vaadin.flow.server.VaadinContext; | ||
|
||
/** | ||
* Allows to access the web application classloader. | ||
* <p> | ||
* The functionality is intended to internal usage only. The implementation of | ||
* this interface may be set as an attribute in {@link VaadinContext} so that | ||
* the classloader may be used in other place where {@link VaadinContext} is | ||
* available. | ||
* | ||
* @author Vaadin Ltd | ||
* @since | ||
* | ||
*/ | ||
@FunctionalInterface | ||
public interface ApplicationClassLoaderAccess { | ||
|
||
/** | ||
* Gets the web application classloader. | ||
* | ||
* @return the web application classloader. | ||
*/ | ||
ClassLoader getClassloader(); | ||
} |
47 changes: 47 additions & 0 deletions
47
flow-server/src/main/java/com/vaadin/flow/internal/VaadinContextInitializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* 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.internal; | ||
|
||
import javax.servlet.ServletContextListener; | ||
|
||
import com.vaadin.flow.server.VaadinContext; | ||
import com.vaadin.flow.server.VaadinServlet; | ||
|
||
/** | ||
* Allows to run initialization of {@link VaadinContext} which for some reasons | ||
* may not be done via {@link ServletContextListener}. | ||
* <p> | ||
* The functionality is intended to internal usage only. The implementation of | ||
* this interface may be available as an attribute in a {@link VaadinContext}. | ||
* In the latter case {@link VaadinServlet#init()} method will run | ||
* {@link #initialize(VaadinContext)} method. | ||
* | ||
* @author Vaadin Ltd | ||
* @since | ||
* | ||
*/ | ||
@FunctionalInterface | ||
public interface VaadinContextInitializer { | ||
|
||
/** | ||
* Initializes the Vaadin {@code context}. | ||
* | ||
* @param context | ||
* the Vaadin context instance | ||
*/ | ||
void initialize(VaadinContext context); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters