Package org.emrys.webosgi.core.runtime

Examples of org.emrys.webosgi.core.runtime.OSGiWebContainer


*
*/
public class DefaultStrLocaleDecider implements ExternalStrLocaleDecider {

  public Locale getLocale(String scope) {
    OSGiWebContainer jeeContainer = FwkActivator.getInstance()
        .getJeeContainer();

    HttpServletRequest req = (HttpServletRequest) jeeContainer
        .getReqThreadVariants().get(OSGiWebContainer.THREAD_V_REQUEST);
    if (req != null) {
      String acceptLang = req.getHeader("Accept-Language");
      if (acceptLang != null && acceptLang.contains("zh"))
        return Locale.CHINA;


    packageAdminTracker.open();

    httpServiceTracker = new HttpServiceTracker(context);
    httpServiceTracker.open();

    jeeContainer = new OSGiWebContainer();
    // Register the IOSGiJEEContainer Service
    getBundle().getBundleContext().registerService(
        IOSGiWebContainer.class.getName(), jeeContainer, null);

    // start log service.

TOP

Related Classes of org.emrys.webosgi.core.runtime.OSGiWebContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.