|
Helping ordinary people create extraordinary websites! |
A New Strategy of Language Pack Management for Wireless AppsBy Huang Chang & Tong Chun Jie2005-04-18
LPProxy Bundle The LPProxy bundle acts as a proxy for delegating all LP bundles-related requests. Like the LP bundle, it also registers to the Service Management Framework run time at startup. Upon receiving the getString(String key) from other bundles, the LPProxy bundle first checks whether the desired LP bundle has already existed in the Service Management Framework run time. It downloads the LP bundle from the Service Management Framework bundle server if the bundle is not available. After that, the LPProxy bundle starts the desired bundle and finds the service reference of the LPService, which provides the getString(String key) method for accessing the resource bundle, by comparing the bundle name. Finally, the LPProxy bundle creates the instance of LPService and calls its getString(String key) method for the multilingual data. LPProxy provides the following methods: • void setBaseName(String baseName): Sets the base name of the LP bundle. If a bundle is named as LP_en_US, for example, the base name should be LP. • String getBaseName(): Gets the base name of the LP bundle. • void setLocale(Locale locale): Sets the locale of the LP bundle. • Locale getLocale(): Gets the locale of the LP bundle. • String getString(String key): Gets a string for the given key from the LP bundle. The getString(String key) method is the key function, as shown in Listing 2. Listing 2. The getString(String key) method and its related methods public String getString(String key) {
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 |
|