Example usage for com.liferay.portal.kernel.util ReleaseInfo getVendor

List of usage examples for com.liferay.portal.kernel.util ReleaseInfo getVendor

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util ReleaseInfo getVendor.

Prototype

public static String getVendor() 

Source Link

Usage

From source file:com.liferay.httpservice.internal.servlet.WebExtenderServlet.java

License:Open Source License

@Override
public void init(ServletConfig servletConfig) throws ServletException {
    super.init(servletConfig);

    HttpSupport httpSupport = new HttpSupport(_bundleContext, this);

    _filterTracker = new ServiceTracker<Filter, Filter>(_bundleContext, Filter.class,
            new FilterTracker(httpSupport));

    _filterTracker.open();//from w  ww.  j a  v  a2 s .c  o m

    HttpServiceFactory httpServiceFactory = new HttpServiceFactory(httpSupport);

    Hashtable<String, Object> properties = new Hashtable<String, Object>();

    properties.put("bean.id", HttpService.class.getName());
    properties.put("original.bean", Boolean.TRUE);
    properties.put("service.vendor", ReleaseInfo.getVendor());

    _httpServiceRegistration = _bundleContext.registerService(
            new String[] { ExtendedHttpService.class.getName(), HttpService.class.getName(), },
            httpServiceFactory, properties);

    properties.put("bean.id", HttpServlet.class.getName());

    _httpServletRegistration = _bundleContext.registerService(HttpServlet.class, this, properties);

    _servletTracker = new ServiceTracker<Servlet, Servlet>(_bundleContext, Servlet.class,
            new ServletTracker(httpSupport));

    _servletTracker.open();
}

From source file:com.liferay.web.extender.internal.Activator.java

License:Open Source License

public ServletContext addingService(ServiceReference<ServletContext> serviceReference) {

    ServletContext servletContext = _bundleContext.getService(serviceReference);

    Hashtable<String, String> properties = new Hashtable<String, String>();

    properties.put(OSGiConstants.BEAN_ID, OSGiServlet.class.getName());
    properties.put(OSGiConstants.ORIGINAL_BEAN, Boolean.TRUE.toString());
    properties.put(OSGiConstants.SERVICE_VENDOR, ReleaseInfo.getVendor());

    ServletConfig servletConfig = new BundleServletConfig(servletContext, "OSGi Servlet", properties,
            new PortalHttpContext(servletContext));

    try {/*from   ww w  .ja  va 2  s. c o  m*/
        _osgiServlet = new OSGiServlet(_bundleContext);

        _osgiServlet.init(servletConfig);

        StrutsActionRegistryUtil.register(OSGiServlet.SERVLET_MAPPING, _osgiServlet);

        _webPluginDeployer = new WebPluginDeployer(_bundleContext, _osgiServlet);

        _bundleContext.addBundleListener(_webPluginDeployer);
    } catch (Exception e) {
        _log.error(e, e);
    }

    checkStartableBundles();

    return servletContext;
}

From source file:com.liferay.web.extender.servlet.OSGiServlet.java

License:Open Source License

@Override
public void init(ServletConfig servletConfig) throws ServletException {
    super.init(servletConfig);

    Hashtable<String, Object> properties = new Hashtable<String, Object>();

    properties.put(OSGiConstants.BEAN_ID, HttpService.class.getName());
    properties.put(OSGiConstants.ORIGINAL_BEAN, Boolean.TRUE);
    properties.put(OSGiConstants.SERVICE_VENDOR, ReleaseInfo.getVendor());

    HttpServiceFactory httpServiceFactory = new HttpServiceFactory(_bundleContext);

    _bundleContext.registerService(//from  w ww  .  j  a  v  a2 s . c o m
            new String[] { HttpService.class.getName(), ExtendedHttpService.class.getName() },
            httpServiceFactory, properties);
}