io.bootique.jersey.JerseyModule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bootique-jersey Show documentation
Show all versions of bootique-jersey Show documentation
Provides Jersey JAX-RS integration with Bootique.
package io.bootique.jersey;
import com.google.inject.Binder;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.Provides;
import com.google.inject.Singleton;
import com.google.inject.multibindings.Multibinder;
import io.bootique.ConfigModule;
import io.bootique.config.ConfigurationFactory;
import io.bootique.jetty.JettyModule;
import io.bootique.jetty.MappedServlet;
import org.glassfish.jersey.server.ResourceConfig;
import javax.ws.rs.container.DynamicFeature;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.Feature;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
public class JerseyModule extends ConfigModule {
private String urlPattern = "/*";
private Class extends Application> application;
private Collection> resources = new HashSet<>();
private Collection packageRoots = new HashSet<>();
/**
* @param binder
* DI binder passed to the Module that invokes this method.
* @since 0.11
* @return returns a {@link Multibinder} for JAX-RS Features.
*/
public static Multibinder contributeFeatures(Binder binder) {
return Multibinder.newSetBinder(binder, Feature.class);
}
/**
* @param binder
* DI binder passed to the Module that invokes this method.
* @since 0.12
* @return returns a {@link Multibinder} for JAX-RS DynamicFeatures.
*/
public static Multibinder contributeDynamicFeatures(Binder binder) {
return Multibinder.newSetBinder(binder, DynamicFeature.class);
}
/**
* @param binder
* DI binder passed to the Module that invokes this method.
* @since 0.15
* @return returns a {@link Multibinder} for explicitly registered JAX-RS
* resource types.
*/
public static Multibinder
© 2015 - 2025 Weber Informatics LLC | Privacy Policy