1/*2 * Copyright 2000-2004 The Apache Software Foundation.3 * 4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */16packageorg.apache.jetspeed.services.customlocalization;
1718import org.apache.turbine.services.TurbineServices;
19import java.util.Locale;
20import java.util.ResourceBundle;
21import org.apache.turbine.util.RunData;
2223/***24 * Custom Localization allows for the localization properties to changed dynamically,25 * without shutting down the application server. 26 *27 * @author <a href="mailto:massimiliano.dessi@gruppoatlantis.it">Dessė Massimiliano</a>28 * @version $Id: CustomLocalization.java,v 1.4 2004/02/23 03:49:33 jford Exp $29 */30publicabstractclassCustomLocalization31 {
3233publicCustomLocalization(){}
3435publicstatic String getString(String bundleName, Locale locale, String key)
36 {
37return getService().getString(bundleName, locale, key);
38 }
3940publicstatic String getString(String key, RunData data)
41 {
42return getService().getString(null, getLocale(data), key);
43 }
4445publicstatic ResourceBundle getBundle( RunData data )
46 {
47return getService().getBundle(data);
48 }
4950publicstatic Locale getLocale(RunData data)
51 {
52return getService().getLocale(data);
53 }
5455publicstatic String getDefaultBundleName()
56 {
57return getService().getDefaultBundleName();
58 }
5960protectedstaticfinalCustomLocalizationService getService()
61 {
62return (CustomLocalizationService) TurbineServices.getInstance().getService(CustomLocalizationService.SERVICE_NAME);
63 }
64 }