diff options
author | Thomas Watson | 2009-11-06 19:58:58 +0000 |
---|---|---|
committer | Thomas Watson | 2009-11-06 19:58:58 +0000 |
commit | 905f3287a4fc2dbd3d376e0a9cdb37106ea4338b (patch) | |
tree | 361fa5da0b28348e5c18db0d9c875f4a3beb3226 /bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/service | |
parent | 8354ba5a286dd616e28c69274aae9e409d848a68 (diff) | |
download | rt.equinox.framework-905f3287a4fc2dbd3d376e0a9cdb37106ea4338b.tar.gz rt.equinox.framework-905f3287a4fc2dbd3d376e0a9cdb37106ea4338b.tar.xz rt.equinox.framework-905f3287a4fc2dbd3d376e0a9cdb37106ea4338b.zip |
Bug 294463 - Add LocaleProvider service interface
Diffstat (limited to 'bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/service')
-rw-r--r-- | bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/service/localization/LocaleProvider.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/service/localization/LocaleProvider.java b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/service/localization/LocaleProvider.java new file mode 100644 index 000000000..2dde516f9 --- /dev/null +++ b/bundles/org.eclipse.osgi/supplement/src/org/eclipse/osgi/service/localization/LocaleProvider.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2009 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.osgi.service.localization; + +import java.util.Locale; + +/** + * A service that is used to determine what the current locale is for a + * particular context or session. If no <code>LocaleProvider</code> + * service is available then the locale must be determined by other + * means, for example, by calling {@link Locale#getDefault()}. + * <p> + * More advanced environments can support multiple locales within a + * single system. For example, a server may support multiple users, + * each needing a different locale. In such an environment a + * <code>LocaleProvider</code> service must be registered that can + * determine the current locale for the context of the call to the + * {@link #getLocale()} method. + * </p> + * @since 1.1 + */ +public interface LocaleProvider { + + /** + * Determines the current locale for the context of the call to + * this method. For environments that support a single system wide + * locale, this is equivalent to calling {@link Locale#getDefault()}. + * <p> + * The result of this method should not be retained or passed to other + * threads. The current locale can change any time and may be + * different for each thread. + * </p> + * @return The current locale. + */ + public Locale getLocale(); + +} |