forked from eclipse-ee4j/jersey
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Next iteration towards supporting HK2 & Weld injection
Signed-off-by: jansupol <jan.supol@oracle.com>
- Loading branch information
Showing
98 changed files
with
3,777 additions
and
519 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
...main/java/org/glassfish/jersey/grizzly2/httpserver/GrizzlyBootstrapPreinitialization.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,29 @@ | ||
/* | ||
* Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package org.glassfish.jersey.grizzly2.httpserver; | ||
|
||
import org.glassfish.jersey.innate.BootstrapPreinitialization; | ||
import org.glassfish.jersey.internal.inject.InjectionManager; | ||
|
||
import jakarta.ws.rs.RuntimeType; | ||
|
||
public final class GrizzlyBootstrapPreinitialization implements BootstrapPreinitialization { | ||
@Override | ||
public void preregister(RuntimeType runtimeType, InjectionManager injectionManager) { | ||
injectionManager.register(new GrizzlyHttpContainer.GrizzlyBinder()); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...c/main/resources/META-INF/services/org.glassfish.jersey.innate.BootstrapPreinitialization
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 @@ | ||
org.glassfish.jersey.grizzly2.httpserver.GrizzlyBootstrapPreinitialization |
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
31 changes: 31 additions & 0 deletions
31
core-client/src/main/java/org/glassfish/jersey/client/ClientBootstrapPreinitialization.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,31 @@ | ||
/* | ||
* Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package org.glassfish.jersey.client; | ||
|
||
import org.glassfish.jersey.innate.BootstrapPreinitialization; | ||
import org.glassfish.jersey.internal.inject.InjectionManager; | ||
|
||
import jakarta.ws.rs.RuntimeType; | ||
|
||
public class ClientBootstrapPreinitialization implements BootstrapPreinitialization { | ||
@Override | ||
public void preregister(RuntimeType runtimeType, InjectionManager injectionManager) { | ||
if (runtimeType == RuntimeType.CLIENT) { | ||
new ClientConfig.PreInitialization(injectionManager); | ||
} | ||
} | ||
} |
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
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
1 change: 1 addition & 0 deletions
1
...c/main/resources/META-INF/services/org.glassfish.jersey.innate.BootstrapPreinitialization
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 @@ | ||
org.glassfish.jersey.client.ClientBootstrapPreinitialization |
43 changes: 43 additions & 0 deletions
43
core-common/src/main/java/org/glassfish/jersey/innate/BootstrapPreinitialization.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,43 @@ | ||
/* | ||
* Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package org.glassfish.jersey.innate; | ||
|
||
import org.glassfish.jersey.Beta; | ||
import org.glassfish.jersey.internal.inject.InjectionManager; | ||
|
||
import jakarta.ws.rs.RuntimeType; | ||
import jakarta.ws.rs.core.FeatureContext; | ||
|
||
/** | ||
* <p> | ||
* The entry point for pre-initialize Jersey during bootstrap. Register the beans that are not recognized by the injection | ||
* framework to be injected in runtime. Register beans for the specific runtime type into the {@link InjectionManager}. | ||
* </p> | ||
*/ | ||
@Beta | ||
public interface BootstrapPreinitialization { | ||
/** | ||
* Manually register beans that are not automatically recognised by the injection framework. | ||
* @param runtimeType | ||
* @param injectionManager | ||
*/ | ||
void preregister(RuntimeType runtimeType, InjectionManager injectionManager); | ||
|
||
static FeatureContext featureContextInstance() { | ||
return new PreinitializationFeatureContext(); | ||
} | ||
} |
Oops, something went wrong.