Search in sources :

Example 1 with AbstractPortalBundleFactory

use of com.liferay.ide.server.core.portal.AbstractPortalBundleFactory in project liferay-ide by liferay.

the class LiferayServerCore method getPortalBundleFactories.

public static PortalBundleFactory[] getPortalBundleFactories() {
    if (portalBundleFactories == null) {
        final IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(PortalBundleFactory.EXTENSION_ID);
        try {
            final List<PortalBundleFactory> bundleFactories = new ArrayList<PortalBundleFactory>();
            for (IConfigurationElement element : elements) {
                final Object o = element.createExecutableExtension("class");
                if (o instanceof PortalBundleFactory) {
                    AbstractPortalBundleFactory portalBundleFactory = (AbstractPortalBundleFactory) o;
                    portalBundleFactory.setBundleFactoryType(element.getAttribute("type"));
                    bundleFactories.add(portalBundleFactory);
                }
            }
            portalBundleFactories = bundleFactories.toArray(new PortalBundleFactory[0]);
        } catch (Exception e) {
            // $NON-NLS-1$
            logError("Unable to get PortalBundleFactory extensions", e);
        }
    }
    return portalBundleFactories;
}
Also used : ArrayList(java.util.ArrayList) PortalBundleFactory(com.liferay.ide.server.core.portal.PortalBundleFactory) AbstractPortalBundleFactory(com.liferay.ide.server.core.portal.AbstractPortalBundleFactory) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement) AbstractPortalBundleFactory(com.liferay.ide.server.core.portal.AbstractPortalBundleFactory) BackingStoreException(org.osgi.service.prefs.BackingStoreException) IOException(java.io.IOException)

Aggregations

AbstractPortalBundleFactory (com.liferay.ide.server.core.portal.AbstractPortalBundleFactory)1 PortalBundleFactory (com.liferay.ide.server.core.portal.PortalBundleFactory)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)1 BackingStoreException (org.osgi.service.prefs.BackingStoreException)1