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

br.com.andrewribeiro.ribrest.RibrestInflector Maven / Gradle / Ivy

Go to download

Ribrest Framework - A simple Java framework that truly improve your productivity when developing restful based webservices.

There is a newer version: 1.27.0
Show newest version
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();
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy