001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet;
016    
017    import com.liferay.portal.kernel.portlet.InvokerFilterContainer;
018    import com.liferay.portal.kernel.portlet.InvokerPortlet;
019    import com.liferay.portal.kernel.portlet.InvokerPortletFactory;
020    import com.liferay.portal.kernel.spring.osgi.OSGiBeanProperties;
021    
022    import javax.portlet.Portlet;
023    import javax.portlet.PortletConfig;
024    import javax.portlet.PortletContext;
025    import javax.portlet.PortletException;
026    
027    /**
028     * @author Shuyang Zhou
029     */
030    @OSGiBeanProperties(property = "service.ranking=1")
031    public class InvokerPortletFactoryImpl implements InvokerPortletFactory {
032    
033            @Override
034            public InvokerPortlet create(
035                            com.liferay.portal.kernel.model.Portlet portletModel,
036                            Portlet portlet, PortletConfig portletConfig,
037                            PortletContext portletContext,
038                            InvokerFilterContainer invokerFilterContainer,
039                            boolean checkAuthToken, boolean facesPortlet, boolean strutsPortlet,
040                            boolean strutsBridgePortlet)
041                    throws PortletException {
042    
043                    try {
044                            return new InvokerPortletImpl(
045                                    portletModel, portlet, portletConfig, portletContext,
046                                    invokerFilterContainer, checkAuthToken, facesPortlet,
047                                    strutsPortlet, strutsBridgePortlet);
048                    }
049                    catch (Exception e) {
050                            throw new PortletException(e);
051                    }
052            }
053    
054            @Override
055            public InvokerPortlet create(
056                            com.liferay.portal.kernel.model.Portlet portletModel,
057                            Portlet portlet, PortletContext portletContext,
058                            InvokerFilterContainer invokerFilterContainer)
059                    throws PortletException {
060    
061                    try {
062                            return new InvokerPortletImpl(
063                                    portletModel, portlet, portletContext, invokerFilterContainer);
064                    }
065                    catch (Exception e) {
066                            throw new PortletException(e);
067                    }
068            }
069    
070    }