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    
021    import javax.portlet.Portlet;
022    import javax.portlet.PortletConfig;
023    import javax.portlet.PortletContext;
024    import javax.portlet.PortletException;
025    
026    /**
027     * @author Shuyang Zhou
028     */
029    public class InvokerPortletFactoryImpl implements InvokerPortletFactory {
030    
031            @Override
032            public InvokerPortlet create(
033                            com.liferay.portal.kernel.model.Portlet portletModel,
034                            Portlet portlet, PortletConfig portletConfig,
035                            PortletContext portletContext,
036                            InvokerFilterContainer invokerFilterContainer,
037                            boolean checkAuthToken, boolean facesPortlet, boolean strutsPortlet,
038                            boolean strutsBridgePortlet)
039                    throws PortletException {
040    
041                    try {
042                            return new InvokerPortletImpl(
043                                    portletModel, portlet, portletConfig, portletContext,
044                                    invokerFilterContainer, checkAuthToken, facesPortlet,
045                                    strutsPortlet, strutsBridgePortlet);
046                    }
047                    catch (Exception e) {
048                            throw new PortletException(e);
049                    }
050            }
051    
052            @Override
053            public InvokerPortlet create(
054                            com.liferay.portal.kernel.model.Portlet portletModel,
055                            Portlet portlet, PortletContext portletContext,
056                            InvokerFilterContainer invokerFilterContainer)
057                    throws PortletException {
058    
059                    try {
060                            return new InvokerPortletImpl(
061                                    portletModel, portlet, portletContext, invokerFilterContainer);
062                    }
063                    catch (Exception e) {
064                            throw new PortletException(e);
065                    }
066            }
067    
068    }