|
Helping ordinary people create extraordinary websites! |
A New Strategy of Language Pack Management for Wireless AppsBy Huang Chang & Tong Chun Jie2005-04-18
Language Pack Bundle The LP bundle contains the localization pack for a certain locale. Each LP bundle complies with the naming convention; that is, a complete bundle name must have an identical suffix and end with the corresponding locale (for example, LP_en_US, LP_zh_CN, LP_fr_RF, and so on). The language pack in the LP bundle can be presented as ListResourceBundle or PropertyResourceBundle, depending on different requirements. In our case, we'll choose the latter and use the bundle name as the property file name. As you saw earlier, the LP bundle includes three classes along with the language pack file. The stub code here is necessary because the OGSi service platform uses different class loaders to load different bundles. Therefore, the language pack file packaged in the LP bundle cannot be accessed directly by the external classes from other bundles. The workaround is to add a segment of stub code to perform language pack file access and register the access operations as an OSGi service. Listing 1 shows the source code of LPServiceImpl. Listing 1. The LPServiceImpl class public class LPServiceImpl implements LPService{ private BundleContext bc; Tutorial Pages: » Use the Service Management Framework to Develop Globalized Wireless Apps » Introduction » PC Versus Mobile Devices » OSGi Overview » OSGi-based LP Loading Strategy » Service Management Framework » Design Model for an Exemplary Implementation » Language Pack Bundle » LPProxy Bundle » LPInvoker Bundle » In Summary » Resources First published by IBM DeveloperWorks |
|