All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.voodoodyne.gwizard.rest.RestModule Maven / Gradle / Ivy

The newest version!
package com.voodoodyne.gwizard.rest;

import com.google.inject.servlet.ServletModule;
import com.voodoodyne.gwizard.web.WebModule;
import lombok.EqualsAndHashCode;
import org.jboss.resteasy.plugins.guice.GuiceResteasyBootstrapServletContextListener;
import org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher;
import javax.inject.Singleton;

/**
 */
@EqualsAndHashCode(of={})	// makes installation of this module idempotent
public class RestModule extends ServletModule {
	@Override
	protected void configureServlets() {
		install(new WebModule());
		install(new JaxrsModule());

		// Binding this will cause it to be picked up by gwizard-web
		bind(GuiceResteasyBootstrapServletContextListener.class);

		// Make sure RESTEasy picks this up so we get our ObjectMapper from guice
		bind(ObjectMapperContextResolver.class);

		bind(HttpServletDispatcher.class).in(Singleton.class);
		serve("/*").with(HttpServletDispatcher.class);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy