Package com.arcbees.gwtpwebsite.client.rest

Source Code of com.arcbees.gwtpwebsite.client.rest.ServiceFactory

package com.arcbees.gwtpwebsite.client.rest;

import javax.inject.Inject;

import org.fusesource.restygwt.client.Defaults;
import org.fusesource.restygwt.client.Resource;
import org.fusesource.restygwt.client.RestService;
import org.fusesource.restygwt.client.RestServiceProxy;

public class ServiceFactory {
    private final String restUrl;

    @Inject
    ServiceFactory(@RestUrl String restUrl) {
        this.restUrl = restUrl;

        Defaults.setDateFormat(null);
    }

    public <P extends RestService> P setupProxy(P proxy, String endPoint) {
        Resource resource = new Resource(restUrl + endPoint);
        ((RestServiceProxy) proxy).setResource(resource);

        return proxy;
    }
}
TOP

Related Classes of com.arcbees.gwtpwebsite.client.rest.ServiceFactory

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.