Example usage for com.liferay.portal.kernel.bean PortalBeanLocatorUtil getBeanLocator

List of usage examples for com.liferay.portal.kernel.bean PortalBeanLocatorUtil getBeanLocator

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.bean PortalBeanLocatorUtil getBeanLocator.

Prototype

public static BeanLocator getBeanLocator() 

Source Link

Usage

From source file:com.liferay.faces.demos.hook.RegisterPortalAction.java

License:Open Source License

@Override
public void run(String[] companyIds) throws ActionException {
    Portal portal = PortalUtil.getPortal();

    try {/*from   www  .  ja va2s  .  c om*/
        ClassLoader classLoader = Portal.class.getClassLoader();
        portal = (Portal) Proxy.newProxyInstance(classLoader, new Class[] { Portal.class },
                new PortalHookImpl(portal));
    } catch (Exception e) {
        logger.error(e);
    }

    PortalUtil portalUtil = (PortalUtil) PortalBeanLocatorUtil.getBeanLocator()
            .locate(PortalUtil.class.getName());
    portalUtil.setPortal(portal);
}