
net.encomendaz.services.ServicesClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of encomendaz-services-client Show documentation
Show all versions of encomendaz-services-client Show documentation
A simple client for accessing EncomendaZ Web Services
/*
* EncomendaZ
*
* Copyright (c) 2011, EncomendaZ .
* All rights reserved.
*
* EncomendaZ is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 3 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see
* or write to the Free Software Foundation, Inc., 51 Franklin Street,
* Fifth Floor, Boston, MA 02110-1301, USA.
*/
package net.encomendaz.services;
import java.util.ResourceBundle;
import org.codehaus.jackson.jaxrs.JacksonJsonProvider;
import org.jboss.resteasy.client.ProxyFactory;
import org.jboss.resteasy.spi.ResteasyProviderFactory;
public class ServicesClient {
private static ResourceBundle bundle;
private static TrackingService trackingService;
static {
ResteasyProviderFactory.setRegisterBuiltinByDefault(false);
ResteasyProviderFactory.getInstance().registerProvider(JacksonJsonProvider.class);
}
private ServicesClient() {
}
private static ResourceBundle getBundle() {
if (bundle == null) {
bundle = ResourceBundle.getBundle("encomendaz");
}
return bundle;
}
private static String getBaseURL() {
return getBundle().getString("base-url");
}
public static TrackingService tracking() {
if (trackingService == null) {
trackingService = ProxyFactory.create(TrackingService.class, getBaseURL());
}
return trackingService;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy