Example usage for com.liferay.portal.kernel.portlet PortletBagPool remove

List of usage examples for com.liferay.portal.kernel.portlet PortletBagPool remove

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.portlet PortletBagPool remove.

Prototype

public static PortletBag remove(String portletId) 

Source Link

Usage

From source file:com.liferay.portlet.PortletInstanceFactoryImpl.java

License:Open Source License

public void clear(Portlet portlet, boolean resetRemotePortletBag) {
    Map<String, InvokerPortlet> portletInstances = _pool.get(portlet.getRootPortletId());

    if (portletInstances != null) {
        Iterator<Map.Entry<String, InvokerPortlet>> itr = portletInstances.entrySet().iterator();

        while (itr.hasNext()) {
            Map.Entry<String, InvokerPortlet> entry = itr.next();

            String portletId = entry.getKey();
            InvokerPortlet invokerPortletInstance = entry.getValue();

            if (PortletConstants.getInstanceId(portletId) == null) {
                invokerPortletInstance.destroy();

                break;
            }/* w w w.j  av a  2  s .  c  om*/
        }
    }

    _pool.remove(portlet.getRootPortletId());

    PortletApp portletApp = portlet.getPortletApp();

    if (resetRemotePortletBag && portletApp.isWARFile()) {
        PortletBagPool.remove(portlet.getRootPortletId());
    }
}