< prev index next >

src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java

Print this page
8204444: java.time cleanup
Reviewed-by: scolebourne, rriggs


 102  * property {@code java.time.zone.DefaultZoneRulesProvider} is defined then
 103  * it is taken to be the fully-qualified name of a concrete ZoneRulesProvider
 104  * class to be loaded as the default provider, using the system class loader.
 105  * If this system property is not defined, a system-default provider will be
 106  * loaded to serve as the default provider.
 107  * <p>
 108  * Rules are looked up primarily by zone ID, as used by {@link ZoneId}.
 109  * Only zone region IDs may be used, zone offset IDs are not used here.
 110  * <p>
 111  * Time-zone rules are political, thus the data can change at any time.
 112  * Each provider will provide the latest rules for each zone ID, but they
 113  * may also provide the history of how the rules changed.
 114  *
 115  * @implSpec
 116  * This interface is a service provider that can be called by multiple threads.
 117  * Implementations must be immutable and thread-safe.
 118  * <p>
 119  * Providers must ensure that once a rule has been seen by the application, the
 120  * rule must continue to be available.
 121  * <p>
 122 *  Providers are encouraged to implement a meaningful {@code toString} method.
 123  * <p>
 124  * Many systems would like to update time-zone rules dynamically without stopping the JVM.
 125  * When examined in detail, this is a complex problem.
 126  * Providers may choose to handle dynamic updates, however the default provider does not.
 127  *
 128  * @since 1.8
 129  */
 130 public abstract class ZoneRulesProvider {
 131 
 132     /**
 133      * The set of loaded providers.
 134      */
 135     private static final CopyOnWriteArrayList<ZoneRulesProvider> PROVIDERS = new CopyOnWriteArrayList<>();
 136     /**
 137      * The lookup from zone ID to provider.
 138      */
 139     private static final ConcurrentMap<String, ZoneRulesProvider> ZONES = new ConcurrentHashMap<>(512, 0.75f, 2);
 140 
 141     /**
 142      * The zone ID data




 102  * property {@code java.time.zone.DefaultZoneRulesProvider} is defined then
 103  * it is taken to be the fully-qualified name of a concrete ZoneRulesProvider
 104  * class to be loaded as the default provider, using the system class loader.
 105  * If this system property is not defined, a system-default provider will be
 106  * loaded to serve as the default provider.
 107  * <p>
 108  * Rules are looked up primarily by zone ID, as used by {@link ZoneId}.
 109  * Only zone region IDs may be used, zone offset IDs are not used here.
 110  * <p>
 111  * Time-zone rules are political, thus the data can change at any time.
 112  * Each provider will provide the latest rules for each zone ID, but they
 113  * may also provide the history of how the rules changed.
 114  *
 115  * @implSpec
 116  * This interface is a service provider that can be called by multiple threads.
 117  * Implementations must be immutable and thread-safe.
 118  * <p>
 119  * Providers must ensure that once a rule has been seen by the application, the
 120  * rule must continue to be available.
 121  * <p>
 122  * Providers are encouraged to implement a meaningful {@code toString} method.
 123  * <p>
 124  * Many systems would like to update time-zone rules dynamically without stopping the JVM.
 125  * When examined in detail, this is a complex problem.
 126  * Providers may choose to handle dynamic updates, however the default provider does not.
 127  *
 128  * @since 1.8
 129  */
 130 public abstract class ZoneRulesProvider {
 131 
 132     /**
 133      * The set of loaded providers.
 134      */
 135     private static final CopyOnWriteArrayList<ZoneRulesProvider> PROVIDERS = new CopyOnWriteArrayList<>();
 136     /**
 137      * The lookup from zone ID to provider.
 138      */
 139     private static final ConcurrentMap<String, ZoneRulesProvider> ZONES = new ConcurrentHashMap<>(512, 0.75f, 2);
 140 
 141     /**
 142      * The zone ID data


< prev index next >