Example usage for com.liferay.portal.kernel.deploy.hot HotDeployUtil fireDeployEvent

List of usage examples for com.liferay.portal.kernel.deploy.hot HotDeployUtil fireDeployEvent

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.deploy.hot HotDeployUtil fireDeployEvent.

Prototype

public static void fireDeployEvent(HotDeployEvent hotDeployEvent) 

Source Link

Usage

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

License:Open Source License

public void doStart(Bundle bundle, String servletContextName) throws Exception {

    sendEvent(bundle, "org/osgi/service/web/DEPLOYING", null, false);

    ServletContext servletContext = ServletContextPool.get(servletContextName);

    if (servletContext != null) {
        sendEvent(bundle, "org/osgi/service/web/FAILED", null, true);

        _collidedWabs.add(bundle);/*  w ww .ja  v  a2 s . co m*/

        return;
    }

    BundleServletContext bundleServletContext = null;

    try {
        servletContext = _servletContextTracker.getService();

        bundleServletContext = new BundleServletContext(servletContext, _portletServlet);

        bundleServletContext.setAttribute(OSGiConstants.OSGI_BUNDLE, bundle);
        bundleServletContext.setAttribute(OSGiConstants.OSGI_BUNDLECONTEXT, _bundleContext);

        HotDeployUtil.fireDeployEvent(
                new HotDeployEvent(bundleServletContext, bundleServletContext.getClassLoader()));

        bundleServletContext.open();

        sendEvent(bundle, "org/osgi/service/web/DEPLOYED", null, false);
    } catch (Exception e) {
        destroy(bundleServletContext);

        sendEvent(bundle, "org/osgi/service/web/FAILED", e, false);
    }
}