View Javadoc

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 at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * 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 and
14   * limitations under the License.
15   */
16  package org.apache.jetspeed.services.customlocalization;
17  
18  import java.util.Locale;
19  import java.util.ResourceBundle;
20  
21  import org.apache.turbine.services.localization.LocalizationService;
22  import org.apache.turbine.util.RunData;
23  
24  /***
25   * Custom Localization allows for the localization properties to changed dynamically,
26   * without shutting down the application server. 
27   *
28   * @author <a href="mailto:massimiliano.dessi@gruppoatlantis.it">Dessė Massimiliano</a>
29   * @version $Id: CustomLocalizationService.java,v 1.5 2004/02/23 03:49:33 jford Exp $
30   */
31  public interface CustomLocalizationService extends LocalizationService
32  {
33      /***
34       * Get the locale from the session first, then fallback to normal request headers.
35       * 
36       * @param data
37       * @return Current locale based on state.
38       */
39      Locale getLocale(RunData data);
40      
41      /***
42       * Get the resource bundle given the state of the current request.
43       * 
44       * @param data
45       * @return The matched resource bundled.
46       */
47      ResourceBundle getBundle(RunData data);
48            
49      
50      public static final String SERVICE_NAME = "LocalizationService";
51      public static final String ACCEPT_LANGUAGE = "Accept-Language";
52  }