diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 8d4ef98..c8bf9d5 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,3 +1,7 @@ +## 3.0-M3 + +* #84 (Jakarta migration) Deprecate JAX-RS 2 modules + ## 3.0.M2 * #65 Upgrade to Jersey 2.38 / 3.0.9 diff --git a/bootique-jersey-beanvalidation/src/main/java/io/bootique/jersey/beanvalidation/JerseyBeanValidationModule.java b/bootique-jersey-beanvalidation/src/main/java/io/bootique/jersey/beanvalidation/JerseyBeanValidationModule.java index 5c8d475..67144fb 100644 --- a/bootique-jersey-beanvalidation/src/main/java/io/bootique/jersey/beanvalidation/JerseyBeanValidationModule.java +++ b/bootique-jersey-beanvalidation/src/main/java/io/bootique/jersey/beanvalidation/JerseyBeanValidationModule.java @@ -23,7 +23,9 @@ /** * @since 2.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class JerseyBeanValidationModule extends ConfigModule { public static JerseyBeanValidationModuleExtender extend(Binder binder) { diff --git a/bootique-jersey-beanvalidation/src/main/java/io/bootique/jersey/beanvalidation/JerseyBeanValidationModuleExtender.java b/bootique-jersey-beanvalidation/src/main/java/io/bootique/jersey/beanvalidation/JerseyBeanValidationModuleExtender.java index a803e7a..6b2351a 100644 --- a/bootique-jersey-beanvalidation/src/main/java/io/bootique/jersey/beanvalidation/JerseyBeanValidationModuleExtender.java +++ b/bootique-jersey-beanvalidation/src/main/java/io/bootique/jersey/beanvalidation/JerseyBeanValidationModuleExtender.java @@ -25,7 +25,9 @@ /** * @since 2.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class JerseyBeanValidationModuleExtender extends ModuleExtender { public JerseyBeanValidationModuleExtender(Binder binder) { diff --git a/bootique-jersey-beanvalidation/src/main/java/io/bootique/jersey/beanvalidation/JerseyBeanValidationModuleProvider.java b/bootique-jersey-beanvalidation/src/main/java/io/bootique/jersey/beanvalidation/JerseyBeanValidationModuleProvider.java index da8a154..0171976 100644 --- a/bootique-jersey-beanvalidation/src/main/java/io/bootique/jersey/beanvalidation/JerseyBeanValidationModuleProvider.java +++ b/bootique-jersey-beanvalidation/src/main/java/io/bootique/jersey/beanvalidation/JerseyBeanValidationModuleProvider.java @@ -23,7 +23,9 @@ /** * @since 2.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class JerseyBeanValidationModuleProvider implements BQModuleProvider { @Override diff --git a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/InstrumentedFeature.java b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/InstrumentedFeature.java index b2b7bac..d0a32fb 100644 --- a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/InstrumentedFeature.java +++ b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/InstrumentedFeature.java @@ -22,6 +22,10 @@ import javax.ws.rs.core.Feature; import javax.ws.rs.core.FeatureContext; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) public class InstrumentedFeature implements Feature { private final RequestTimer filter; diff --git a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/InstrumentedHttpClientFactoryFactory.java b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/InstrumentedHttpClientFactoryFactory.java index 2a76f2f..2a2f95f 100644 --- a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/InstrumentedHttpClientFactoryFactory.java +++ b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/InstrumentedHttpClientFactoryFactory.java @@ -27,7 +27,9 @@ /** * @since 3.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) @BQConfig public class InstrumentedHttpClientFactoryFactory extends HttpClientFactoryFactory { diff --git a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/JerseyClientHealthChecks.java b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/JerseyClientHealthChecks.java index e0a56a0..96dcd61 100644 --- a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/JerseyClientHealthChecks.java +++ b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/JerseyClientHealthChecks.java @@ -5,6 +5,10 @@ import java.util.Map; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) public class JerseyClientHealthChecks implements HealthCheckGroup { private final Map healthChecks; diff --git a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/JerseyClientHealthChecksFactory.java b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/JerseyClientHealthChecksFactory.java index 1dcd435..7863cb6 100644 --- a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/JerseyClientHealthChecksFactory.java +++ b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/JerseyClientHealthChecksFactory.java @@ -12,6 +12,10 @@ import java.util.Map; import java.util.function.Supplier; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) @BQConfig public class JerseyClientHealthChecksFactory { diff --git a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/JerseyClientInstrumentedModule.java b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/JerseyClientInstrumentedModule.java index d71c884..1f854be 100644 --- a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/JerseyClientInstrumentedModule.java +++ b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/JerseyClientInstrumentedModule.java @@ -31,6 +31,10 @@ import javax.inject.Singleton; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) public class JerseyClientInstrumentedModule extends ConfigModule { public static final MetricNaming METRIC_NAMING = MetricNaming.forModule(JerseyClientInstrumentedModule.class); diff --git a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/JerseyClientInstrumentedModuleProvider.java b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/JerseyClientInstrumentedModuleProvider.java index 73924ad..7e83797 100644 --- a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/JerseyClientInstrumentedModuleProvider.java +++ b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/JerseyClientInstrumentedModuleProvider.java @@ -30,6 +30,10 @@ import static java.util.Arrays.asList; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) public class JerseyClientInstrumentedModuleProvider implements BQModuleProvider { @Override diff --git a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/RequestTimer.java b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/RequestTimer.java index ddc4fdf..5e88ef3 100644 --- a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/RequestTimer.java +++ b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/RequestTimer.java @@ -33,6 +33,10 @@ import java.util.List; import java.util.Map; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) // The priority must be higher than that of RequestLogger, so that the Timer could print its output inside the Logger @Priority(200) public class RequestTimer implements ClientRequestFilter, ClientResponseFilter { diff --git a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/healthcheck/HttpHealthCheck.java b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/healthcheck/HttpHealthCheck.java index 6833b30..320c190 100644 --- a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/healthcheck/HttpHealthCheck.java +++ b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/healthcheck/HttpHealthCheck.java @@ -31,7 +31,10 @@ /** * Provides a simple HTTP health check to verify that remote endpoints are alive and accessible. + * + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class HttpHealthCheck implements HealthCheck { private Supplier responseSupplier; diff --git a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/mdc/MDCAwareClientAsyncExecutorProvider.java b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/mdc/MDCAwareClientAsyncExecutorProvider.java index 40527a5..d762ab6 100644 --- a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/mdc/MDCAwareClientAsyncExecutorProvider.java +++ b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/mdc/MDCAwareClientAsyncExecutorProvider.java @@ -19,15 +19,17 @@ package io.bootique.jersey.client.instrumented.mdc; import io.bootique.jersey.client.ClientAsyncExecutorProvider; -import javax.inject.Inject; -import javax.inject.Named; import org.glassfish.jersey.client.ClientAsyncExecutor; +import javax.inject.Inject; +import javax.inject.Named; import java.util.concurrent.*; /** * @since 3.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) @ClientAsyncExecutor public class MDCAwareClientAsyncExecutorProvider extends ClientAsyncExecutorProvider { diff --git a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/mdc/MDCAwareThreadPoolExecutor.java b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/mdc/MDCAwareThreadPoolExecutor.java index f058025..22ee71f 100644 --- a/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/mdc/MDCAwareThreadPoolExecutor.java +++ b/bootique-jersey-client-instrumented/src/main/java/io/bootique/jersey/client/instrumented/mdc/MDCAwareThreadPoolExecutor.java @@ -24,7 +24,9 @@ /** * @since 3.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class MDCAwareThreadPoolExecutor extends ThreadPoolExecutor { public MDCAwareThreadPoolExecutor( diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/BaseClientBqHk2Bridge.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/BaseClientBqHk2Bridge.java index 706d300..1f141cb 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/BaseClientBqHk2Bridge.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/BaseClientBqHk2Bridge.java @@ -1,19 +1,22 @@ package io.bootique.jersey.client; -import java.lang.annotation.Annotation; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import javax.inject.Provider; - import io.bootique.BootiqueException; import io.bootique.di.Injector; import io.bootique.di.Key; import io.bootique.di.TypeLiteral; import org.glassfish.hk2.api.Injectee; +import javax.inject.Provider; +import java.lang.annotation.Annotation; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; + /** * Base utilities for bridge between Bootique DI and HK2 container + * + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) class BaseClientBqHk2Bridge { protected final Injector injector; @@ -24,9 +27,9 @@ protected BaseClientBqHk2Bridge(Injector injector) { protected Provider resolveBqProvider(Injectee injectee) { TypeLiteral typeLiteral = TypeLiteral.of(injectee.getRequiredType()); - if(Provider.class.equals(typeLiteral.getRawType())) { + if (Provider.class.equals(typeLiteral.getRawType())) { Type requiredType = getGenericParameterType(injectee.getRequiredType()); - if(requiredType == null) { + if (requiredType == null) { throw new BootiqueException(-1, "Not specified generic type for Provider injection point."); } typeLiteral = TypeLiteral.of(requiredType); @@ -39,7 +42,7 @@ protected Provider resolveBqProvider(Injectee injectee) { ? Key.get(typeLiteral) : Key.get(typeLiteral, bindingAnnotation); - if(!injector.hasProvider(key) && !allowDynamicInjectionForKey(injectee, key)) { + if (!injector.hasProvider(key) && !allowDynamicInjectionForKey(injectee, key)) { return null; } diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/ClientAsyncExecutorProvider.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/ClientAsyncExecutorProvider.java index a6908be..fa0a877 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/ClientAsyncExecutorProvider.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/ClientAsyncExecutorProvider.java @@ -29,6 +29,10 @@ import javax.inject.Named; import java.util.logging.Logger; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) // a copy of non-public Jersey DefaultClientAsyncExecutorProvider that allows us to customize async pool parameters @ClientAsyncExecutor public class ClientAsyncExecutorProvider extends ThreadPoolExecutorProvider { diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/ClientBqInjectInjector.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/ClientBqInjectInjector.java index f77a353..ac8f358 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/ClientBqInjectInjector.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/ClientBqInjectInjector.java @@ -19,9 +19,6 @@ package io.bootique.jersey.client; -import javax.inject.Inject; -import javax.inject.Provider; - import io.bootique.di.BQInject; import io.bootique.di.Injector; import io.bootique.di.TypeLiteral; @@ -29,6 +26,13 @@ import org.glassfish.hk2.api.InjectionResolver; import org.glassfish.hk2.api.ServiceHandle; +import javax.inject.Inject; +import javax.inject.Provider; + +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) public class ClientBqInjectInjector extends BaseClientBqHk2Bridge implements InjectionResolver { @Inject diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/ClientBqInjectorBridge.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/ClientBqInjectorBridge.java index 51dfedc..e71359f 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/ClientBqInjectorBridge.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/ClientBqInjectorBridge.java @@ -19,27 +19,25 @@ package io.bootique.jersey.client; -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; -import java.util.Collections; -import java.util.Set; - -import javax.inject.Inject; -import javax.inject.Provider; -import javax.inject.Singleton; - import io.bootique.di.Injector; import io.bootique.di.Key; import io.bootique.di.TypeLiteral; -import org.glassfish.hk2.api.DescriptorType; -import org.glassfish.hk2.api.DescriptorVisibility; -import org.glassfish.hk2.api.Injectee; -import org.glassfish.hk2.api.JustInTimeInjectionResolver; -import org.glassfish.hk2.api.ServiceHandle; -import org.glassfish.hk2.api.ServiceLocator; +import org.glassfish.hk2.api.*; import org.glassfish.hk2.utilities.AbstractActiveDescriptor; import org.glassfish.hk2.utilities.ServiceLocatorUtilities; +import javax.inject.Inject; +import javax.inject.Provider; +import javax.inject.Singleton; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; +import java.util.Collections; +import java.util.Set; + +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) public class ClientBqInjectorBridge extends BaseClientBqHk2Bridge implements JustInTimeInjectionResolver { /* diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/DefaultHttpClientFactory.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/DefaultHttpClientFactory.java index c707598..ec66d48 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/DefaultHttpClientFactory.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/DefaultHttpClientFactory.java @@ -27,6 +27,10 @@ import java.security.KeyStore; import java.util.Map; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) public class DefaultHttpClientFactory implements HttpClientFactory { private ClientConfig config; diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/DefaultHttpTargets.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/DefaultHttpTargets.java index b1e7ee2..c32bc8e 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/DefaultHttpTargets.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/DefaultHttpTargets.java @@ -24,6 +24,10 @@ import java.util.Set; import java.util.function.Supplier; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) public class DefaultHttpTargets implements HttpTargets { private final Map> namedTargets; diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/HttpClientBuilder.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/HttpClientBuilder.java index a2dec09..c19bd41 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/HttpClientBuilder.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/HttpClientBuilder.java @@ -24,7 +24,10 @@ /** * JAX RS {@link javax.ws.rs.client.Client} builder that builds the client with references to various parts of * "jerseyclient" Bootique configuration. + * + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public interface HttpClientBuilder { Client build(); diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/HttpClientFactory.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/HttpClientFactory.java index 81f5280..eb79590 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/HttpClientFactory.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/HttpClientFactory.java @@ -23,7 +23,10 @@ /** * An injectable factory for creating JAX RS clients based on Bootique configuration. + * + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public interface HttpClientFactory { /** diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/HttpClientFactoryFactory.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/HttpClientFactoryFactory.java index 7be841c..4e3496e 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/HttpClientFactoryFactory.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/HttpClientFactoryFactory.java @@ -45,6 +45,10 @@ import java.util.Set; import java.util.function.Supplier; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) @BQConfig("Configures HttpClientFactory, including named authenticators, timeouts, SSL certificates, etc.") public class HttpClientFactoryFactory { diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/HttpTargets.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/HttpTargets.java index f06d03d..469aa8b 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/HttpTargets.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/HttpTargets.java @@ -24,7 +24,10 @@ /** * An injectable manager of preconfigured JAX RS {@link WebTarget} objects. + * + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public interface HttpTargets { /** diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/JerseyClientFeatures.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/JerseyClientFeatures.java index 2bbcf9b..873e853 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/JerseyClientFeatures.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/JerseyClientFeatures.java @@ -19,17 +19,19 @@ package io.bootique.jersey.client; +import javax.inject.Qualifier; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import javax.inject.Qualifier; - /** * A DI annotation for a set of JAXRS client features. + * + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ -@Target({ ElementType.PARAMETER, ElementType.FIELD, ElementType.METHOD }) +@Deprecated(since = "3.0", forRemoval = true) +@Target({ElementType.PARAMETER, ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Qualifier public @interface JerseyClientFeatures { diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/JerseyClientModule.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/JerseyClientModule.java index eddaedc..aeac311 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/JerseyClientModule.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/JerseyClientModule.java @@ -29,6 +29,10 @@ import javax.ws.rs.core.Feature; import java.util.Set; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) public class JerseyClientModule extends ConfigModule { /** diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/JerseyClientModuleExtender.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/JerseyClientModuleExtender.java index 8baf0e0..61a60a0 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/JerseyClientModuleExtender.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/JerseyClientModuleExtender.java @@ -24,6 +24,10 @@ import javax.ws.rs.core.Feature; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) public class JerseyClientModuleExtender { private Binder binder; diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/JerseyClientModuleProvider.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/JerseyClientModuleProvider.java index 60d34d2..098bb58 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/JerseyClientModuleProvider.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/JerseyClientModuleProvider.java @@ -22,6 +22,10 @@ import io.bootique.BQModuleProvider; import io.bootique.bootstrap.BuiltModule; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) public class JerseyClientModuleProvider implements BQModuleProvider { @Override diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/TrustStoreFactory.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/TrustStoreFactory.java index b036d86..3684de5 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/TrustStoreFactory.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/TrustStoreFactory.java @@ -32,6 +32,10 @@ import java.security.cert.CertificateException; import java.util.Objects; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) @BQConfig public class TrustStoreFactory { diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/WebTargetFactory.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/WebTargetFactory.java index cf12236..cf0f2d6 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/WebTargetFactory.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/WebTargetFactory.java @@ -30,6 +30,10 @@ import java.util.Objects; import java.util.function.Supplier; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) @BQConfig public class WebTargetFactory { diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/ApiKeyHeaderAuthenticatorFactory.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/ApiKeyHeaderAuthenticatorFactory.java index 37ccdc9..4a743a1 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/ApiKeyHeaderAuthenticatorFactory.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/ApiKeyHeaderAuthenticatorFactory.java @@ -30,7 +30,9 @@ /** * @since 1.1 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) @JsonTypeName("apiKeyHeader") @BQConfig("Performs request authentication with a fixed API key passed as a request header") public class ApiKeyHeaderAuthenticatorFactory implements AuthenticatorFactory { diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/ApiKeyParameterAuthenticatorFactory.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/ApiKeyParameterAuthenticatorFactory.java index 4731c22..ea54716 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/ApiKeyParameterAuthenticatorFactory.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/ApiKeyParameterAuthenticatorFactory.java @@ -31,7 +31,9 @@ /** * @since 1.1 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) @JsonTypeName("apiKeyParameter") @BQConfig("Performs request authentication with a fixed API key passed as a query parameter") public class ApiKeyParameterAuthenticatorFactory implements AuthenticatorFactory { diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/AuthenticatorFactory.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/AuthenticatorFactory.java index becd208..2a3e5a7 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/AuthenticatorFactory.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/AuthenticatorFactory.java @@ -26,6 +26,10 @@ import javax.ws.rs.client.ClientRequestFilter; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") @BQConfig("Authenticator for a given auth protocol.") public interface AuthenticatorFactory extends PolymorphicConfiguration { diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/BasicAuthenticatorFactory.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/BasicAuthenticatorFactory.java index 82a70e7..ed09280 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/BasicAuthenticatorFactory.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/BasicAuthenticatorFactory.java @@ -32,6 +32,10 @@ import java.io.UnsupportedEncodingException; import java.util.Objects; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) @JsonTypeName("basic") @BQConfig("Authenticator for BASIC auth protocol.") public class BasicAuthenticatorFactory implements AuthenticatorFactory { diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/OAuth2AuthenticatorFactory.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/OAuth2AuthenticatorFactory.java index 9beeea2..ddaf8e7 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/OAuth2AuthenticatorFactory.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/OAuth2AuthenticatorFactory.java @@ -33,6 +33,10 @@ import java.util.Objects; import java.util.function.Function; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) @JsonTypeName("oauth2") @BQConfig("Authenticator for Oauth2 protocol. Includes URL of the OAuth token endpoint and " + "username/password that are exchanged for the token.") diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/OAuth2Token.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/OAuth2Token.java index cef3319..bd82fbe 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/OAuth2Token.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/OAuth2Token.java @@ -24,7 +24,9 @@ /** * Represents a token received from a remote oauth server. + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class OAuth2Token { private String accessToken; diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/OAuth2TokenAuthenticator.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/OAuth2TokenAuthenticator.java index 33283b5..d37cb92 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/OAuth2TokenAuthenticator.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/OAuth2TokenAuthenticator.java @@ -23,6 +23,10 @@ import javax.ws.rs.client.ClientRequestFilter; import javax.ws.rs.core.MultivaluedMap; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) class OAuth2TokenAuthenticator implements ClientRequestFilter { private OAuth2TokenDAO tokenDAO; diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/OAuth2TokenDAO.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/OAuth2TokenDAO.java index f0839dd..e6c6726 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/OAuth2TokenDAO.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/auth/OAuth2TokenDAO.java @@ -33,6 +33,10 @@ import java.util.Objects; import java.util.function.Function; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) public class OAuth2TokenDAO { private static final Logger LOGGER = LoggerFactory.getLogger(OAuth2TokenDAO.class); diff --git a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/log/RequestLogger.java b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/log/RequestLogger.java index 6e8d0c8..a59cd41 100644 --- a/bootique-jersey-client/src/main/java/io/bootique/jersey/client/log/RequestLogger.java +++ b/bootique-jersey-client/src/main/java/io/bootique/jersey/client/log/RequestLogger.java @@ -30,7 +30,9 @@ /** * @since 3.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) @Priority(100) public class RequestLogger implements ClientRequestFilter, ClientResponseFilter { diff --git a/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/JerseyJacksonFactory.java b/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/JerseyJacksonFactory.java index 05132c5..2e9f90a 100644 --- a/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/JerseyJacksonFactory.java +++ b/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/JerseyJacksonFactory.java @@ -32,7 +32,9 @@ /** * @since 2.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) @BQConfig public class JerseyJacksonFactory { diff --git a/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/JerseyJacksonModule.java b/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/JerseyJacksonModule.java index 0795ada..6680d18 100644 --- a/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/JerseyJacksonModule.java +++ b/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/JerseyJacksonModule.java @@ -32,7 +32,9 @@ /** * @since 2.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class JerseyJacksonModule extends ConfigModule implements BQModuleProvider { public static JerseyJacksonModuleExtender extend(Binder binder) { diff --git a/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/JerseyJacksonModuleExtender.java b/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/JerseyJacksonModuleExtender.java index 9652789..296ddaa 100644 --- a/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/JerseyJacksonModuleExtender.java +++ b/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/JerseyJacksonModuleExtender.java @@ -26,7 +26,9 @@ /** * @since 2.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class JerseyJacksonModuleExtender extends ModuleExtender { private SetBuilder serializers; diff --git a/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/ObjectMapperResolver.java b/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/ObjectMapperResolver.java index 5ab6213..42ea927 100644 --- a/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/ObjectMapperResolver.java +++ b/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/ObjectMapperResolver.java @@ -28,7 +28,9 @@ * within Jersey. * * @since 2.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) @Provider public class ObjectMapperResolver implements ContextResolver { diff --git a/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/ObjectMapperResolverFeature.java b/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/ObjectMapperResolverFeature.java index 23907e0..d38ef1d 100644 --- a/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/ObjectMapperResolverFeature.java +++ b/bootique-jersey-jackson/src/main/java/io/bootique/jersey/jackson/ObjectMapperResolverFeature.java @@ -24,7 +24,9 @@ /** * @since 2.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class ObjectMapperResolverFeature implements Feature { private ObjectMapperResolver resolver; diff --git a/bootique-jersey/src/main/java/io/bootique/jersey/BaseBqHk2Bridge.java b/bootique-jersey/src/main/java/io/bootique/jersey/BaseBqHk2Bridge.java index 6f9d8c3..385b7dd 100644 --- a/bootique-jersey/src/main/java/io/bootique/jersey/BaseBqHk2Bridge.java +++ b/bootique-jersey/src/main/java/io/bootique/jersey/BaseBqHk2Bridge.java @@ -1,20 +1,22 @@ package io.bootique.jersey; -import java.lang.annotation.Annotation; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; - -import javax.inject.Provider; - import io.bootique.BootiqueException; import io.bootique.di.Injector; import io.bootique.di.Key; import io.bootique.di.TypeLiteral; import org.glassfish.hk2.api.Injectee; +import javax.inject.Provider; +import java.lang.annotation.Annotation; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; + /** * Base utilities for bridge between Bootique DI and HK2 container + * + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) class BaseBqHk2Bridge { protected final Injector injector; @@ -25,9 +27,9 @@ protected BaseBqHk2Bridge(Injector injector) { protected Provider resolveBqProvider(Injectee injectee) { TypeLiteral typeLiteral = TypeLiteral.of(injectee.getRequiredType()); - if(javax.inject.Provider.class.equals(typeLiteral.getRawType())) { + if (javax.inject.Provider.class.equals(typeLiteral.getRawType())) { Type requiredType = getGenericParameterType(injectee.getRequiredType()); - if(requiredType == null) { + if (requiredType == null) { throw new BootiqueException(-1, "Not specified generic type for Provider injection point."); } typeLiteral = TypeLiteral.of(requiredType); @@ -40,7 +42,7 @@ protected Provider resolveBqProvider(Injectee injectee) { ? Key.get(typeLiteral) : Key.get(typeLiteral, bindingAnnotation); - if(!injector.hasProvider(key) && !allowDynamicInjectionForKey(injectee, key)) { + if (!injector.hasProvider(key) && !allowDynamicInjectionForKey(injectee, key)) { return null; } diff --git a/bootique-jersey/src/main/java/io/bootique/jersey/BqInjectInjector.java b/bootique-jersey/src/main/java/io/bootique/jersey/BqInjectInjector.java index 1767a77..040b566 100644 --- a/bootique-jersey/src/main/java/io/bootique/jersey/BqInjectInjector.java +++ b/bootique-jersey/src/main/java/io/bootique/jersey/BqInjectInjector.java @@ -19,9 +19,6 @@ package io.bootique.jersey; -import javax.inject.Inject; -import javax.inject.Provider; - import io.bootique.di.BQInject; import io.bootique.di.Injector; import io.bootique.di.TypeLiteral; @@ -29,10 +26,16 @@ import org.glassfish.hk2.api.InjectionResolver; import org.glassfish.hk2.api.ServiceHandle; +import javax.inject.Inject; +import javax.inject.Provider; + /** * This resolver provides support for the {@link BQInject} annotation inside Jersey runtime + * + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ -public class BqInjectInjector extends BaseBqHk2Bridge implements InjectionResolver { +@Deprecated(since = "3.0", forRemoval = true) +public class BqInjectInjector extends BaseBqHk2Bridge implements InjectionResolver { @Inject public BqInjectInjector(Injector injector) { diff --git a/bootique-jersey/src/main/java/io/bootique/jersey/BqInjectorBridge.java b/bootique-jersey/src/main/java/io/bootique/jersey/BqInjectorBridge.java index 4c334e3..544d9fe 100644 --- a/bootique-jersey/src/main/java/io/bootique/jersey/BqInjectorBridge.java +++ b/bootique-jersey/src/main/java/io/bootique/jersey/BqInjectorBridge.java @@ -36,103 +36,106 @@ /** * Allows HK2 to do a lookup and grab services from Bootique DI Injector. + * + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class BqInjectorBridge extends BaseBqHk2Bridge implements JustInTimeInjectionResolver { - /* - * In terms of HK2 this is a fallback resolver that is used when required service not found in a ServiceLocator. - * We try to create here a custom ActiveDescriptor (once again this is a HK2 term) that will get that service - * from Bootique DI injector. - */ - - private static final String GLASSFISH_PACKAGE = "org.glassfish"; - - private final ServiceLocator locator; - - @Inject - public BqInjectorBridge(Injector injector, ServiceLocator locator) { - super(injector); - this.locator = locator; - } - - @SuppressWarnings({"unchecked", "rawtypes"}) - @Override - public boolean justInTimeResolution(Injectee failedInjectionPoint) { - // HK2 injection point can have multiple qualifiers, Bq DI doesn't support that - if(failedInjectionPoint.getRequiredQualifiers().size() > 1) { - return false; - } - - Provider provider = resolveBqProvider(failedInjectionPoint); - if(provider == null) { - return false; - } - - // register custom descriptor in a HK2's ServiceLocator - ServiceLocatorUtilities.addOneDescriptor(locator, new BqBindingActiveDescriptor( - provider, - failedInjectionPoint.getRequiredType(), - failedInjectionPoint.getRequiredQualifiers(), - TypeLiteral.of(failedInjectionPoint.getRequiredType()).getRawType() - )); - // notify that we have added a new descriptor - return true; - } - - @Override - protected boolean allowDynamicInjectionForKey(Injectee injectionPoint, Key key) { - return injectionPoint.getParent() != null // parent's presence means that we are injecting value to parameter or field - && !key.getType().getRawType().getPackage().getName().startsWith(GLASSFISH_PACKAGE); - } - - /** - * This descriptor just holds {@link Provider} reference to get the required service from Bootique DI. - */ - private static class BqBindingActiveDescriptor extends AbstractActiveDescriptor { - - private final Provider provider; - private final Type implType; - private final Class implClass; - - public BqBindingActiveDescriptor(Provider provider, Type implType, Set qualifiers, Class implClass) { - super( - Collections.singleton(implType), - Singleton.class, - null, - qualifiers, - DescriptorType.CLASS, - DescriptorVisibility.NORMAL, - 0, - false, - false, - null, - Collections.emptyMap() - ); - this.provider = provider; - this.implType = implType; - this.implClass = implClass; - setImplementation(implClass.getName()); - } - - public BqBindingActiveDescriptor() { - this.provider = null; - this.implClass = null; - this.implType = null; - } - - @Override - public Class getImplementationClass() { - return implClass; - } - - @Override - public Type getImplementationType() { - return implType; - } - - @Override - public T create(ServiceHandle root) { - return provider.get(); - } - } + /* + * In terms of HK2 this is a fallback resolver that is used when required service not found in a ServiceLocator. + * We try to create here a custom ActiveDescriptor (once again this is a HK2 term) that will get that service + * from Bootique DI injector. + */ + + private static final String GLASSFISH_PACKAGE = "org.glassfish"; + + private final ServiceLocator locator; + + @Inject + public BqInjectorBridge(Injector injector, ServiceLocator locator) { + super(injector); + this.locator = locator; + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + @Override + public boolean justInTimeResolution(Injectee failedInjectionPoint) { + // HK2 injection point can have multiple qualifiers, Bq DI doesn't support that + if (failedInjectionPoint.getRequiredQualifiers().size() > 1) { + return false; + } + + Provider provider = resolveBqProvider(failedInjectionPoint); + if (provider == null) { + return false; + } + + // register custom descriptor in a HK2's ServiceLocator + ServiceLocatorUtilities.addOneDescriptor(locator, new BqBindingActiveDescriptor( + provider, + failedInjectionPoint.getRequiredType(), + failedInjectionPoint.getRequiredQualifiers(), + TypeLiteral.of(failedInjectionPoint.getRequiredType()).getRawType() + )); + // notify that we have added a new descriptor + return true; + } + + @Override + protected boolean allowDynamicInjectionForKey(Injectee injectionPoint, Key key) { + return injectionPoint.getParent() != null // parent's presence means that we are injecting value to parameter or field + && !key.getType().getRawType().getPackage().getName().startsWith(GLASSFISH_PACKAGE); + } + + /** + * This descriptor just holds {@link Provider} reference to get the required service from Bootique DI. + */ + private static class BqBindingActiveDescriptor extends AbstractActiveDescriptor { + + private final Provider provider; + private final Type implType; + private final Class implClass; + + public BqBindingActiveDescriptor(Provider provider, Type implType, Set qualifiers, Class implClass) { + super( + Collections.singleton(implType), + Singleton.class, + null, + qualifiers, + DescriptorType.CLASS, + DescriptorVisibility.NORMAL, + 0, + false, + false, + null, + Collections.emptyMap() + ); + this.provider = provider; + this.implType = implType; + this.implClass = implClass; + setImplementation(implClass.getName()); + } + + public BqBindingActiveDescriptor() { + this.provider = null; + this.implClass = null; + this.implType = null; + } + + @Override + public Class getImplementationClass() { + return implClass; + } + + @Override + public Type getImplementationType() { + return implType; + } + + @Override + public T create(ServiceHandle root) { + return provider.get(); + } + } } diff --git a/bootique-jersey/src/main/java/io/bootique/jersey/JerseyModule.java b/bootique-jersey/src/main/java/io/bootique/jersey/JerseyModule.java index 03ecf6b..79c13b3 100644 --- a/bootique-jersey/src/main/java/io/bootique/jersey/JerseyModule.java +++ b/bootique-jersey/src/main/java/io/bootique/jersey/JerseyModule.java @@ -44,6 +44,10 @@ import java.util.Map; import java.util.Set; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) public class JerseyModule extends ConfigModule { static final String RESOURCES_BY_PATH_BINDING = "io.bootique.jersey.resourcesByPath"; diff --git a/bootique-jersey/src/main/java/io/bootique/jersey/JerseyModuleExtender.java b/bootique-jersey/src/main/java/io/bootique/jersey/JerseyModuleExtender.java index 578a025..d3d70b9 100644 --- a/bootique-jersey/src/main/java/io/bootique/jersey/JerseyModuleExtender.java +++ b/bootique-jersey/src/main/java/io/bootique/jersey/JerseyModuleExtender.java @@ -28,6 +28,10 @@ import javax.ws.rs.ext.ParamConverter; import java.util.Map; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) public class JerseyModuleExtender extends ModuleExtender { private SetBuilder features; diff --git a/bootique-jersey/src/main/java/io/bootique/jersey/JerseyModuleProvider.java b/bootique-jersey/src/main/java/io/bootique/jersey/JerseyModuleProvider.java index 5cca5c5..c39257d 100644 --- a/bootique-jersey/src/main/java/io/bootique/jersey/JerseyModuleProvider.java +++ b/bootique-jersey/src/main/java/io/bootique/jersey/JerseyModuleProvider.java @@ -27,6 +27,10 @@ import static java.util.Collections.singletonList; +/** + * @deprecated The users are encouraged to switch to the Jakarta-based flavor + */ +@Deprecated(since = "3.0", forRemoval = true) public class JerseyModuleProvider implements BQModuleProvider { @Override diff --git a/bootique-jersey/src/main/java/io/bootique/jersey/JerseyResource.java b/bootique-jersey/src/main/java/io/bootique/jersey/JerseyResource.java index d51f1bb..31c1911 100644 --- a/bootique-jersey/src/main/java/io/bootique/jersey/JerseyResource.java +++ b/bootique-jersey/src/main/java/io/bootique/jersey/JerseyResource.java @@ -27,8 +27,11 @@ /** * A binding annotation for explicitly registered Jersey resources. + * + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ -@Target({ ElementType.PARAMETER, ElementType.FIELD, ElementType.METHOD }) +@Deprecated(since = "3.0", forRemoval = true) +@Target({ElementType.PARAMETER, ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Qualifier // TODO: should this be called something like "JerseyComponent" ? diff --git a/bootique-jersey/src/main/java/io/bootique/jersey/JerseyServletFactory.java b/bootique-jersey/src/main/java/io/bootique/jersey/JerseyServletFactory.java index 45da252..cd090e7 100644 --- a/bootique-jersey/src/main/java/io/bootique/jersey/JerseyServletFactory.java +++ b/bootique-jersey/src/main/java/io/bootique/jersey/JerseyServletFactory.java @@ -32,7 +32,10 @@ /** * A YAML-configurable factory of Jersey servlet. + * + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) @BQConfig("Configures a servlet that is an entry point to Jersey REST API engine.") public class JerseyServletFactory { diff --git a/bootique-jersey/src/main/java/io/bootique/jersey/MappedResource.java b/bootique-jersey/src/main/java/io/bootique/jersey/MappedResource.java index e949a2d..ff5a3a2 100644 --- a/bootique-jersey/src/main/java/io/bootique/jersey/MappedResource.java +++ b/bootique-jersey/src/main/java/io/bootique/jersey/MappedResource.java @@ -25,7 +25,9 @@ /** * @since 2.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class MappedResource { private T resource; diff --git a/bootique-jersey/src/main/java/io/bootique/jersey/ResourceModelDebugger.java b/bootique-jersey/src/main/java/io/bootique/jersey/ResourceModelDebugger.java index 85ef126..cac4d4e 100644 --- a/bootique-jersey/src/main/java/io/bootique/jersey/ResourceModelDebugger.java +++ b/bootique-jersey/src/main/java/io/bootique/jersey/ResourceModelDebugger.java @@ -34,7 +34,10 @@ /** * Debugs all container resources. In DEBUG mode prints only the app resources, in TRACE mode prints app and Jersey * internal resources as well as handler classes. + * + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class ResourceModelDebugger implements ModelProcessor { private static final Logger LOGGER = LoggerFactory.getLogger(ResourceModelDebugger.class); diff --git a/bootique-jersey/src/main/java/io/bootique/jersey/ResourcePathCustomizer.java b/bootique-jersey/src/main/java/io/bootique/jersey/ResourcePathCustomizer.java index 1531b8e..7eaa186 100644 --- a/bootique-jersey/src/main/java/io/bootique/jersey/ResourcePathCustomizer.java +++ b/bootique-jersey/src/main/java/io/bootique/jersey/ResourcePathCustomizer.java @@ -33,7 +33,9 @@ * Defines custom resource mappings * * @since 2.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class ResourcePathCustomizer implements ModelProcessor { private Map, List> pathsByType; diff --git a/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/LocalDateConverter.java b/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/LocalDateConverter.java index b5f8eee..20f791a 100644 --- a/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/LocalDateConverter.java +++ b/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/LocalDateConverter.java @@ -25,7 +25,9 @@ * Support for LocalDate parameter binding, covering a gap in JAX-RS specification. * * @since 3.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class LocalDateConverter implements ParamConverter { @Override diff --git a/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/LocalDateTimeConverter.java b/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/LocalDateTimeConverter.java index 4fed61b..dfbbacb 100644 --- a/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/LocalDateTimeConverter.java +++ b/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/LocalDateTimeConverter.java @@ -25,7 +25,9 @@ * Support for LocalDateTime parameter binding, covering a gap in JAX-RS specification. * * @since 3.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class LocalDateTimeConverter implements ParamConverter { @Override diff --git a/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/LocalTimeConverter.java b/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/LocalTimeConverter.java index 5b424d8..5cf41ec 100644 --- a/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/LocalTimeConverter.java +++ b/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/LocalTimeConverter.java @@ -25,7 +25,9 @@ * Support for LocalTime parameter binding, covering a gap in JAX-RS specification. * * @since 3.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class LocalTimeConverter implements ParamConverter { @Override diff --git a/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/MappedParamConvertersProvider.java b/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/MappedParamConvertersProvider.java index 0ca2a4c..63665b0 100644 --- a/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/MappedParamConvertersProvider.java +++ b/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/MappedParamConvertersProvider.java @@ -26,7 +26,9 @@ /** * @since 3.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class MappedParamConvertersProvider implements ParamConverterProvider { private final Map, ParamConverter> paramConverters; diff --git a/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/YearConverter.java b/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/YearConverter.java index 4c16135..cacf07c 100644 --- a/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/YearConverter.java +++ b/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/YearConverter.java @@ -25,7 +25,9 @@ * Support for Year parameter binding, covering a gap in JAX-RS specification. * * @since 3.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class YearConverter implements ParamConverter { @Override diff --git a/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/YearMonthConverter.java b/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/YearMonthConverter.java index 90705c2..6bdb86d 100644 --- a/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/YearMonthConverter.java +++ b/bootique-jersey/src/main/java/io/bootique/jersey/jaxrs/YearMonthConverter.java @@ -25,7 +25,9 @@ * Support for YearMonth parameter binding, covering a gap in JAX-RS specification. * * @since 3.0 + * @deprecated The users are encouraged to switch to the Jakarta-based flavor */ +@Deprecated(since = "3.0", forRemoval = true) public class YearMonthConverter implements ParamConverter { @Override