br.com.andrewribeiro.ribrest.RibrestInflector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Ribrest Show documentation
Show all versions of Ribrest Show documentation
Ribrest Framework - A simple Java framework that truly improve your productivity when developing restful based webservices.
package br.com.andrewribeiro.ribrest;
import br.com.andrewribeiro.ribrest.controller.Facade;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.core.Response;
import org.glassfish.jersey.process.Inflector;
import org.glassfish.jersey.server.ContainerRequest;
/**
*
* @author Andrew Ribeiro
*/
class RibrestInflector implements Inflector{
private Facade facade;
private Ribrest ribrestInstance;
public RibrestInflector(Ribrest ribrestInstance, Facade facade) {
this.facade = facade;
this.ribrestInstance = ribrestInstance;
}
@Override
public Response apply(ContainerRequestContext containerRequestContainer) {
ribrestInstance.getServiceLocator().inject(facade);
ribrestInstance.getServiceLocator().postConstruct(facade);
facade.setContainerRequest((ContainerRequest) containerRequestContainer);
return facade.process();
}
}