net.time4j.tz.repo.TZDATA Maven / Gradle / Ivy
/*
* -----------------------------------------------------------------------
* Copyright © 2013-2018 Meno Hochschild,
* -----------------------------------------------------------------------
* This file (TZDATA.java) is part of project Time4J.
*
* Time4J 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 2.1 of the License, or
* (at your option) any later version.
*
* Time4J 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 Time4J. If not, see .
* -----------------------------------------------------------------------
*/
package net.time4j.tz.repo;
import net.time4j.base.ResourceLoader;
import net.time4j.scale.LeapSecondProvider;
import net.time4j.tz.ZoneModelProvider;
import net.time4j.tz.ZoneNameProvider;
/**
* Small helper class for registering this module in OSGi etc.
*
* @author Meno Hochschild
* @since 3.0
*/
/*[deutsch]
* Kleine Hilfsklasse zur Registrierung dieses Moduls in OSGi usw.
*
* @author Meno Hochschild
* @since 3.0
*/
public final class TZDATA {
private TZDATA() {
// no instantiation
}
/**
* Convenient short form for registering this module in the standard resource loader.
*
* Does not work on Android platforms by design and is mainly intended for OSGi-environments.
*
* @see ResourceLoader#registerService(Class, Object)
*/
/*[deutsch]
* Bequeme Kurzform für die Registrierung dieses Moduls im Standard-{@code ResourceLoader}.
*
* Funktioniert nicht auf Android-Plattformen und ist hauptsächlich für OSGi-Umgebungen
* gedacht.
*
* @see ResourceLoader#registerService(Class, Object)
*/
public static void init() {
TimezoneRepositoryProviderSPI spi = new TimezoneRepositoryProviderSPI();
ResourceLoader.getInstance().registerService(ZoneModelProvider.class, spi);
ResourceLoader.getInstance().registerService(ZoneNameProvider.class, spi);
ResourceLoader.getInstance().registerService(LeapSecondProvider.class, spi);
}
}