From portal-commits at lists.jboss.org Sat Feb 2 13:26:59 2008 Content-Type: multipart/mixed; boundary="===============0251074312575580442==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r9714 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168 and 2 other directories. Date: Sat, 02 Feb 2008 13:26:59 -0500 Message-ID: --===============0251074312575580442== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2008-02-02 13:26:59 -0500 (Sat, 02 Feb 2008) New Revision: 9714 Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/ClassInstanceLifeCycle.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/FilterChainImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/api/FilterConfigImpl.java Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerFilterInfo.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerInfoBuilder.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerPortletApplicationInfo.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/info/ContainerPortletInfo.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletApplicationImpl.java modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/imp= l/jsr168/PortletContainerImpl.java modules/portlet/trunk/test/src/test/build.xml Log: implementation of portlet filtering, no unit tests yet (but will follow). Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerFilterInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerFilterInfo.java 2008-02-02 14:21:03 UTC (rev 9713) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerFilterInfo.java 2008-02-02 18:26:59 UTC (rev 9714) @@ -26,6 +26,7 @@ import org.jboss.portal.common.i18n.LocalizedString; = import java.util.Map; +import java.util.Set; = /** * @author Julien Viet @@ -41,7 +42,7 @@ private final String className; = /** . */ - private final LifeCyclePhase lifeCycle; + private final Set lifeCycles; = /** . */ private final LocalizedString displayName; @@ -55,14 +56,14 @@ public ContainerFilterInfo( String name, String className, - LifeCyclePhase lifeCycle, + Set lifeCycles, LocalizedString displayName, LocalizedString description, Map parameters) { this.name =3D name; this.className =3D className; - this.lifeCycle =3D lifeCycle; + this.lifeCycles =3D lifeCycles; this.displayName =3D displayName; this.description =3D description; this.parameters =3D parameters; @@ -78,9 +79,9 @@ return className; } = - public LifeCyclePhase getLifeCycle() + public Set getLifeCycles() { - return lifeCycle; + return lifeCycles; } = public LocalizedString getDisplayName() Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerInfoBuilder.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilder.java 2008-02-02 14:21:03 UTC (rev 9713) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerInfoBuilder.java 2008-02-02 18:26:59 UTC (rev 9714) @@ -40,6 +40,7 @@ import org.jboss.portal.portlet.impl.metadata.PublicRenderParameterMetaDat= a; import org.jboss.portal.portlet.impl.metadata.ListenerMetaData; import org.jboss.portal.portlet.impl.metadata.filter.FilterMetaData; +import org.jboss.portal.portlet.impl.metadata.filter.FilterMappingMetaData; import org.jboss.portal.portlet.info.MetaInfo; import org.jboss.portal.portlet.LifeCyclePhase; import org.jboss.portal.common.util.ConversionException; @@ -64,6 +65,7 @@ import java.util.Collection; import java.util.LinkedHashMap; import java.util.Collections; +import java.util.HashSet; import java.net.URI; import java.net.URISyntaxException; = @@ -84,6 +86,51 @@ private static final String[] BUNDLE_KEYS =3D {JAVAX_PORTLET + MetaInfo= .TITLE, JAVAX_PORTLET + MetaInfo.SHORT_TITLE, JAVAX_PORTLET + MetaInfo.KEYW= ORDS}; = /** . */ + private static final List EMPTY_LISTENER_LIST =3D Col= lections.emptyList(); + + /** . */ + private static final List EMPTY_PUBLIC_R= ENDER_PARAMETER_LIST =3D Collections.emptyList(); + + /** . */ + private static final List EMPTY_EVENT_DEFINITI= ON_LIST =3D Collections.emptyList(); + + /** . */ + private static final List EMPPTY_SECURITY_ROLE= _REF_LIST =3D Collections.emptyList(); + + /** . */ + private static final List EMPTY_SECURITY_CO= NSTRAINT_LIST =3D Collections.emptyList(); + + /** . */ + private static final List EMPTY_SUPPORTED_LOCA= LE_LIST =3D Collections.emptyList(); + + /** . */ + private static final List EMPTY_PORTLET_MODE_LIST = =3D Collections.emptyList(); + + /** . */ + private static final List EMPTY_WINDOW_STATE_LIST = =3D Collections.emptyList(); + + /** . */ + private static final Map EMPTY_PORTLE= T_PREFERENCE_MAP =3D Collections.emptyMap(); + + /** . */ + private static final PortletPreferencesMetaData EMPTY_PORTLET_PREFERENC= ES =3D new PortletPreferencesMetaData(); + + /** . */ + private static final List EMPTY_INIT_PARAM_LIST =3D = Collections.emptyList(); + + /** . */ + private static final List EMPTY_STRING_LIST =3D Collections.emp= tyList(); + + /** . */ + private static final List EMPTY_EVENT= _DEFINITION_REFERENCE_LIST =3D Collections.emptyList(); + + /** . */ + private static final Map EMPTY_FILTER_MAP= PING_MAP =3D Collections.emptyMap(); + + /** . */ + private static final Map EMPTY_FILTER_MAP =3D Co= llections.emptyMap(); + + /** . */ private final PortletApplication10MetaData portletApplicationMD; = /** . */ @@ -132,11 +179,11 @@ PortletApplication20MetaData tmp =3D (PortletApplication20MetaDat= a)portletApplicationMD; if (tmp.getEvents() =3D=3D null) { - tmp.setEvents(new ArrayList()); + tmp.setEvents(EMPTY_EVENT_DEFINITION_LIST); } if (tmp.getPublicRenderParameters() =3D=3D null) { - tmp.setPublicRenderParameters(new ArrayList()); + tmp.setPublicRenderParameters(EMPTY_PUBLIC_RENDER_PARAMETER_LI= ST); } if (tmp.getDefaultNamespace() =3D=3D null) { @@ -151,8 +198,16 @@ } if (tmp.getListeners() =3D=3D null) { - tmp.setListeners(new ArrayList()); + tmp.setListeners(EMPTY_LISTENER_LIST); } + if (tmp.getFilters() =3D=3D null) + { + tmp.setFilters(EMPTY_FILTER_MAP); + } + if (tmp.getFilterMapping() =3D=3D null) + { + tmp.setFilterMapping(EMPTY_FILTER_MAPPING_MAP); + } } } = @@ -160,48 +215,48 @@ { if (portletMD.getSecurityRoleRef() =3D=3D null) { - portletMD.setSecurityRoleRef(new ArrayList()); + portletMD.setSecurityRoleRef(EMPPTY_SECURITY_ROLE_REF_LIST); } if (portletMD.getPortletApplication().getSecurityConstraints() =3D= =3D null) { - portletMD.getPortletApplication().setSecurityConstraints(new Arra= yList()); + portletMD.getPortletApplication().setSecurityConstraints(EMPTY_SE= CURITY_CONSTRAINT_LIST); } if (portletMD.getSupportedLocale() =3D=3D null) { - portletMD.setSupportedLocale(new ArrayList()); + portletMD.setSupportedLocale(EMPTY_SUPPORTED_LOCALE_LIST); } for (SupportsMetaData supportsMD : portletMD.getSupports()) { if (supportsMD.getPortletModes() =3D=3D null) { - supportsMD.setPortletModes(new ArrayList(= )); + supportsMD.setPortletModes(EMPTY_PORTLET_MODE_LIST); } if (supportsMD.getWindowStates() =3D=3D null) { - supportsMD.setWindowStates(new ArrayList(= )); + supportsMD.setWindowStates(EMPTY_WINDOW_STATE_LIST); } } if (portletMD.getPortletPreferences() =3D=3D null) { - portletMD.setPortletPreferences(new PortletPreferencesMetaData()); + portletMD.setPortletPreferences(EMPTY_PORTLET_PREFERENCES); } if (portletMD.getPortletPreferences().getPortletPreferences() =3D=3D= null) { - portletMD.getPortletPreferences().setPortletPreferences(new HashM= ap()); + portletMD.getPortletPreferences().setPortletPreferences(EMPTY_POR= TLET_PREFERENCE_MAP); } if (portletMD.getInitParams() =3D=3D null) { - portletMD.setInitParams(new ArrayList()); + portletMD.setInitParams(EMPTY_INIT_PARAM_LIST); } if (portletMD.getSupportedPublicRenderParameters() =3D=3D null) { - portletMD.setSupportedPublicRenderParameters(new ArrayList()); + portletMD.setSupportedPublicRenderParameters(EMPTY_STRING_LIST); } for (PortletPreferenceMetaData portletPreferenceMD : portletMD.getPo= rtletPreferences().getPortletPreferences().values()) { if (portletPreferenceMD.getValue() =3D=3D null) { - portletPreferenceMD.setValue(new ArrayList()); + portletPreferenceMD.setValue(EMPTY_STRING_LIST); } } = @@ -210,11 +265,11 @@ { if (portletMD.getSupportedProcessingEvent() =3D=3D null) { - portletMD.setSupportedProcessingEvent(new ArrayList()); + portletMD.setSupportedProcessingEvent(EMPTY_EVENT_DEFINITION_R= EFERENCE_LIST); } if (portletMD.getSupportedPublishingEvent() =3D=3D null) { - portletMD.setSupportedPublishingEvent(new ArrayList()); + portletMD.setSupportedPublishingEvent(EMPTY_EVENT_DEFINITION_R= EFERENCE_LIST); } } } @@ -272,6 +327,7 @@ // String defaultNamespace =3D XMLConstants.NULL_NS_URI; List listeners =3D Collections.emptyList(); + Map allFilters =3D new HashMap(); if (this.portletApplicationMD instanceof PortletApplication20MetaDat= a) { PortletApplication20MetaData tmp =3D (PortletApplication20MetaDat= a)this.portletApplicationMD; @@ -311,16 +367,16 @@ } listeners =3D Collections.unmodifiableList(listeners); = - // -// for (FilterMetaData filterMD : tmp.getFilterCollection()) -// { -// ContainerFilterInfo filter =3D build(filterMD); -// } + for (FilterMetaData filterMD : tmp.getFilterCollection()) + { + ContainerFilterInfo filter =3D build(filterMD); + allFilters.put(filter.getName(), filter); + } } = // - return new ContainerPortletApplicationInfo(defaultNamespace, listene= rs); + return new ContainerPortletApplicationInfo(defaultNamespace, allFilt= ers.values(), listeners); } = private ContainerListenerInfo build(ListenerMetaData listenerMD) @@ -339,13 +395,11 @@ initParameters.put(initParamMD.getName(), initParamMD.getValue()); } = - LifeCyclePhase lifeCycle; - // return new ContainerFilterInfo( filterMD.getFilterName(), filterMD.getFilterClass(), - null, + Collections.unmodifiableSet(new HashSet(filterMD.= getLifecycle())), filterMD.getDisplayName(), filterMD.getDescription(), Collections.unmodifiableMap(initParameters) @@ -425,6 +479,36 @@ ContainerNavigationInfo containerNavigation =3D buildContainerNav= igationInfo(portletMD); = // + List filters =3D new ArrayList(); + for (FilterMappingMetaData filterMappingMD : ((PortletApplication= 20MetaData)portletApplicationMD).getFilterMapping().values()) + { + for (String portletName : filterMappingMD.getPortletNames()) + { + boolean matches; + if (portletName.length() =3D=3D 0) + { + // Do smth + matches =3D false; + } + else if (portletName.endsWith("*")) + { + String prefix =3D portletName.substring(0, portletName.l= ength() - 1); + matches =3D portletMD.getPortletName().startsWith(prefix= ); + } + else + { + matches =3D portletMD.getPortletName().equals(portletNam= e); + } + + // Add the filter + if (matches) + { + filters.add(filterMappingMD.getName()); + } + } + } + + // containerPortletInfo =3D new ContainerPortletInfo( containerCapabilities, containerPreferences, @@ -434,6 +518,7 @@ containerSession, containerEvents, containerNavigation, + Collections.unmodifiableList(filters), portletMD.getPortletName(), portletMD.getPortletClass(), Collections.unmodifiableMap(initParameters), Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerPortletApplicationInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletApplicationInfo.java 2008-02-02 14:21:03 UTC (rev 9= 713) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletApplicationInfo.java 2008-02-02 18:26:59 UTC (rev 9= 714) @@ -23,6 +23,10 @@ package org.jboss.portal.portlet.impl.info; = import java.util.List; +import java.util.Map; +import java.util.LinkedHashMap; +import java.util.Collections; +import java.util.Collection; = /** * @author Julien Viet @@ -37,12 +41,24 @@ /** . */ private final List listeners; = + /** . */ + private final Map filters; + public ContainerPortletApplicationInfo( String defaultNamespace, + Collection filters, List listeners) { + LinkedHashMap tmp =3D new LinkedHashMap= (); + for (ContainerFilterInfo filter : filters) + { + tmp.put(filter.getName(), filter); + } + + // this.defaultNamespace =3D defaultNamespace; this.listeners =3D listeners; + this.filters =3D Collections.unmodifiableMap(tmp); } = public String getDefaultNamespace() @@ -54,4 +70,9 @@ { return listeners; } + + public Map getFilters() + { + return filters; + } } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/info/ContainerPortletInfo.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletInfo.java 2008-02-02 14:21:03 UTC (rev 9713) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/info/ContainerPortletInfo.java 2008-02-02 18:26:59 UTC (rev 9714) @@ -26,8 +26,9 @@ import org.jboss.portal.common.i18n.ResourceBundleManager; = import java.util.Map; -import java.util.HashMap; import java.util.Set; +import java.util.List; +import java.util.Collections; = /** * For now implementation that use the portlet container directly. @@ -78,6 +79,9 @@ /** . */ private final ContainerNavigationInfo navigation; = + /** . */ + private final List filterRefs; + public ContainerPortletInfo( ContainerCapabilitiesInfo capabilities, ContainerPreferencesInfo preferences, @@ -99,6 +103,7 @@ this.session =3D session; this.events =3D new ContainerEventingInfo(); this.navigation =3D new ContainerNavigationInfo(); + this.filterRefs =3D Collections.emptyList(); this.name =3D name; this.className =3D className; this.initParameters =3D initParameters; @@ -115,6 +120,7 @@ ContainerSessionInfo session, ContainerEventingInfo events, ContainerNavigationInfo navigation, + List filterRefs, String name, String className, Map initParameters, @@ -129,6 +135,7 @@ this.session =3D session; this.events =3D events; this.navigation =3D navigation; + this.filterRefs =3D filterRefs; this.name =3D name; this.className =3D className; this.initParameters =3D initParameters; @@ -161,6 +168,11 @@ return initParameters.get(name); } = + public List getFilterRefs() + { + return filterRefs; + } + public ContainerCapabilitiesInfo getCapabilities() { return capabilities; Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr168/ClassInstanceLifeCycle.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/ClassInstanceLifeCycle.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/ClassInstanceLifeCycle.java 2008-02-02 18:26:59 UTC (rev 9714) @@ -0,0 +1,179 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.impl.jsr168; + +import org.jboss.portal.portlet.container.PortletInitializationException; +import org.apache.log4j.Logger; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class ClassInstanceLifeCycle +{ + + /** . */ + private Logger log; + + /** . */ + private Class expectedClass; + + /** . */ + private ClassLoader classLoader; + + /** . */ + private String className; + + /** . */ + private String type; + + /** . */ + private T instance; + + public ClassInstanceLifeCycle( + Logger log, + Class expectedClass, + ClassLoader classLoader, + String className, + String type) + { + this.log =3D log; + this.expectedClass =3D expectedClass; + this.classLoader =3D classLoader; + this.className =3D className; + this.type =3D type; + } + + public void create() throws PortletInitializationException + { + T instance; + try + { + Class clazz =3D classLoader.loadClass(className); + if (expectedClass.isAssignableFrom(clazz)) + { + Class castedClass =3D clazz.asSubclass(expectedCl= ass); + Constructor ctor =3D castedClass.getConstructor(); + instance =3D ctor.newInstance(); + } + else + { + String msg =3D "Cannot create " + type + " with class " + clas= sName + " because it does not implement the expected interface " + expected= Class.getName(); + throw new PortletInitializationException(msg); + } + } + catch (InvocationTargetException e) + { + String msg =3D "Cannot create " + type + " with class " + classNa= me + " because the class contructor threw an exception"; + throw new PortletInitializationException(msg, e.getCause()); + } + catch (IllegalAccessException e) + { + String msg =3D "Cannot create " + type + " with class " + classNa= me + " because the class is not accessible"; + throw new PortletInitializationException(msg, e); + } + catch (NoSuchMethodException e) + { + String msg =3D "Cannot create " + type + " with class " + classNa= me + " because it does not have an no argument constructor"; + throw new PortletInitializationException(msg, e); + } + catch (ClassNotFoundException e) + { + String msg =3D "Cannot create " + type + " with class " + classNa= me + " because the class cannot be loaded"; + throw new PortletInitializationException(msg, e); + } + catch (InstantiationException e) + { + String msg =3D "Cannot create " + type + " with class " + classNa= me + " because it cannot be instantiated"; + throw new PortletInitializationException(msg, e); + } + catch (Error e) + { + String msg =3D "Cannot create " + type + " with class " + classNa= me + " because of an error"; + throw new PortletInitializationException(msg, e); + } + + // + final ClassLoader previousLoader =3D Thread.currentThread().getConte= xtClassLoader(); + try + { + Thread.currentThread().setContextClassLoader(classLoader); + + // + start(instance); + } + catch (Exception e) + { + String msg =3D "The " + type + " threw an exception during init"; + throw new PortletInitializationException(msg, e); + } + finally + { + Thread.currentThread().setContextClassLoader(previousLoader); + } + + // + this.instance =3D instance; + } + + public void destroy() + { + if (instance =3D=3D null) + { + throw new IllegalStateException("No instance created previously"); + } + + // + try + { + stop(instance); + } + catch (Error e) + { + log.error("Stopping the " + type + " threw an error", e); + } + catch (Exception e) + { + log.error("Stopping the " + type + " threw an exception", e); + } + } + + public T getInstance() + { + return instance; + } + + protected void start(T instance) throws Exception + { + + } + + protected void stop(T instance) + { + + } + +} Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletApplicationImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-02 14:21:03 UTC (rev 9713) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletApplicationImpl.java 2008-02-02 18:26:59 UTC (rev 9714) @@ -24,25 +24,36 @@ = import org.jboss.portal.portlet.impl.jsr168.api.PortletContextImpl; import org.jboss.portal.portlet.impl.jsr168.api.PortletURLGenerationListen= erChain; +import org.jboss.portal.portlet.impl.jsr168.api.FilterConfigImpl; import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory; import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData; import org.jboss.portal.portlet.impl.info.ContainerPortletApplicationInfo; import org.jboss.portal.portlet.impl.info.ContainerListenerInfo; +import org.jboss.portal.portlet.impl.info.ContainerFilterInfo; import org.jboss.portal.portlet.metadata.JBossApplicationMetaData; import org.jboss.portal.portlet.container.PortletApplication; import org.jboss.portal.portlet.container.PortletApplicationContext; import org.jboss.portal.portlet.container.PortletContainer; +import org.jboss.portal.portlet.container.PortletInitializationException; +import org.jboss.portal.portlet.LifeCyclePhase; import org.apache.log4j.Logger; = import javax.portlet.PortletContext; import javax.portlet.PortletURLGenerationListener; +import javax.portlet.filter.PortletFilter; +import javax.portlet.filter.ActionFilter; +import javax.portlet.filter.EventFilter; +import javax.portlet.filter.RenderFilter; +import javax.portlet.filter.ResourceFilter; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.Set; import java.util.List; import java.util.LinkedList; import java.util.Collections; -import java.lang.reflect.Constructor; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; = /** * @author Julien Viet @@ -51,6 +62,17 @@ public class PortletApplicationImpl implements PortletApplication { = + private static final EnumMap> phaseToType =3D + new EnumMap>(LifeCycl= ePhase.class); + + static + { + phaseToType.put(LifeCyclePhase.ACTION, ActionFilter.class); + phaseToType.put(LifeCyclePhase.EVENT, EventFilter.class); + phaseToType.put(LifeCyclePhase.RENDER, RenderFilter.class); + phaseToType.put(LifeCyclePhase.RESOURCE, ResourceFilter.class); + } + /** Logger. */ protected final Logger log; = @@ -81,14 +103,11 @@ /** . */ protected PortletURLGenerationListener urlListener; = + /** . */ + protected Map filters; + /** * Todo remove meta data reference and use info instead. - * = - * @param info - * @param metaData - * @param jbossMetaData - * @param context - * @param portletAPIFactory */ public PortletApplicationImpl( ContainerPortletApplicationInfo info, @@ -145,63 +164,94 @@ = public void start() throws Exception { + PortletContextImpl portletContext =3D new PortletContextImpl(context= .getServletContext()); + + // + // List listeners =3D Collections.emptyLi= st(); for (ContainerListenerInfo listenerInfo : info.getListeners()) { - String className =3D listenerInfo.getClassName(); - ClassLoader classLoader =3D context.getClassLoader(); try { - Class clazz =3D classLoader.loadClass(className); - if (PortletURLGenerationListener.class.isAssignableFrom(clazz)) + String className =3D listenerInfo.getClassName(); + + ClassInstanceLifeCycle lifeCycle= =3D new ClassInstanceLifeCycle( + log, + PortletURLGenerationListener.class, + context.getClassLoader(), + className, + "listener" + ); + + // + lifeCycle.create(); + + // + if (listeners.size() =3D=3D 0) { - Constructor ctor =3D clazz.getConstructor(); - PortletURLGenerationListener listener =3D (PortletURLGenera= tionListener)ctor.newInstance(); - if (listeners.size() =3D=3D 0) - { - listeners =3D new LinkedList(); - } - listeners.add(listener); + listeners =3D new LinkedList(= ); } - else - { - log.info("Cannot create filter with class " + className + "= because it does not implement the PortletURLGenerationListener interface"); - } + + // + listeners.add(lifeCycle.getInstance()); } - catch (IllegalAccessException e) + catch (PortletInitializationException e) { - log.error("Cannot create filter with class " + className + " b= ecause the class is not accessible", e); + log.error(e.getMessage(), e); } - catch (NoSuchMethodException e) + } + + // + HashMap filters =3D new HashMap(); + for (ContainerFilterInfo filterInfo : info.getFilters().values()) + { + try { - log.error("Cannot create filter with class " + className + " b= ecause it does not have an no argument constructor", e); + String className =3D filterInfo.getClassName(); + FilterLifecycle lifeCycle =3D new FilterLifecycle( + PortletFilter.class, + context.getClassLoader(), + className, + "filter", + filterInfo.getName()); + + // + lifeCycle.create(); + + // + for (LifeCyclePhase phase : filterInfo.getLifeCycles()) + { + Class type =3D phaseToType.get(pha= se); + FilterKey key =3D new FilterKey(filterInfo.getName(), type); + filters.put(key, lifeCycle); + } } - catch (ClassNotFoundException e) + catch (PortletInitializationException e) { - log.error("Cannot create filter with class " + className + " b= ecause the class cannot be loaded", e); + log.error(e.getMessage(), e); } - catch (InstantiationException e) - { - log.error("Cannot create filter with class " + className + " b= ecause it cannot be instantiated", e); - } - catch (Error e) - { - log.error("Cannot create filter with class " + className + " b= ecause of an error", e); - } } = // this.version =3D metaData.getVersion(); - this.portletContext =3D new PortletContextImpl(context.getServletCon= text()); + this.portletContext =3D portletContext; this.urlListener =3D listeners.size() =3D=3D 0 ? null : new PortletU= RLGenerationListenerChain(Collections.unmodifiableList(listeners)); - + this.filters =3D filters; } = public void stop() { + // Stop filters + for (FilterLifecycle filter : filters.values()) + { + filter.destroy(); + } + + // this.version =3D null; this.portletContext =3D null; this.urlListener =3D null; + this.filters =3D null; } = public String getVersion() @@ -225,6 +275,20 @@ return null; } = + public T getFilter(String filterName, Class phase) + { + FilterLifecycle lifeCycle =3D filters.get(new FilterKey(filterName, = phase)); + + // + if (lifeCycle =3D=3D null) + { + return null; + } + + // Should be ok + return phase.cast(lifeCycle.getInstance()); + } + // WebApp implementation **********************************************= ********************************************** = public Set getPortletContainers() @@ -248,4 +312,73 @@ { return "PortletWebApp[" + metaData.getId() + "]"; } + + private static class FilterKey + { + + /** . */ + private final String name; + + /** . */ + private final Class phase; + + private FilterKey(String name, Class phase) + { + this.name =3D name; + this.phase =3D phase; + } + + public int hashCode() + { + return name.hashCode() + name.hashCode(); + } + + public boolean equals(Object obj) + { + if (obj =3D=3D this) + { + return true; + } + if (obj instanceof FilterKey) + { + FilterKey that =3D (FilterKey)obj; + return name.equals(that.name) && phase =3D=3D that.phase; + } + return false; + } + } + + private class FilterLifecycle extends ClassInstanceLifeCycle + { + + /** . */ + private final String filterName; + + private FilterLifecycle( + Class expectedClass, + ClassLoader classLoader, + String className, + String type, + String filterName) + { + super(log, expectedClass, classLoader, className, type); + + // + this.filterName =3D filterName; + } + + public void start(PortletFilter instance) throws Exception + { + FilterConfigImpl config =3D new FilterConfigImpl(filterName, port= letContext); + + // + instance.init(config); + } + + public void stop(PortletFilter instance) + { + instance.destroy(); + } + } + } Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/port= let/impl/jsr168/PortletContainerImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-02 14:21:03 UTC (rev 9713) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/PortletContainerImpl.java 2008-02-02 18:26:59 UTC (rev 9714) @@ -39,6 +39,7 @@ import org.jboss.portal.portlet.impl.jsr168.api.EventResponseImpl; import org.jboss.portal.portlet.impl.jsr168.api.ResourceRequestImpl; import org.jboss.portal.portlet.impl.jsr168.api.ResourceResponseImpl; +import org.jboss.portal.portlet.impl.jsr168.api.FilterChainImpl; import org.jboss.portal.portlet.impl.jsr168.spi.PortletAPIFactory; import org.jboss.portal.portlet.impl.info.ContainerPortletInfo; import org.jboss.portal.portlet.impl.info.ContainerPreferencesInfo; @@ -61,9 +62,27 @@ import javax.portlet.UnavailableException; import javax.portlet.EventPortlet; import javax.portlet.ResourceServingPortlet; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import javax.portlet.filter.PortletFilter; +import javax.portlet.filter.ActionFilter; +import javax.portlet.filter.EventFilter; +import javax.portlet.filter.RenderFilter; +import javax.portlet.filter.ResourceFilter; +import javax.portlet.filter.FilterChain; +import javax.portlet.filter.FilterConfig; import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.util.Set; +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; = /** * @author Julien Viet @@ -99,6 +118,21 @@ /** User data constraint. */ protected Set userDataConstraints; = + /** . */ + private final Invoker invoker =3D new Invoker(); + + /** . */ + private List actionFilterList; + + /** . */ + private List eventFilterList; + + /** . */ + private List renderFilterList; + + /** . */ + private List resourceFilterList; + /** * The preference validator, this is not exposed as runtime meta data a= s it is only used by the JSR 168 portlet * container implementation. @@ -201,6 +235,9 @@ this.config =3D config; this.started =3D true; = + // + buildFilterChains(); + // Let invocation flow in valve.open(); } @@ -230,6 +267,37 @@ } } = + private void buildFilterChains() + { + List actionFilterList =3D builderFilterList(ActionFilt= er.class); + List eventFilterList =3D builderFilterList(EventFilter.= class); + List renderFilterList =3D builderFilterList(RenderFilt= er.class); + List resourceFilterList =3D builderFilterList(Resour= ceFilter.class); + + // Add invoker + actionFilterList.add(invoker); + eventFilterList.add(invoker); + renderFilterList.add(invoker); + resourceFilterList.add(invoker); + + // + this.actionFilterList =3D Collections.unmodifiableList(actionFilterL= ist); + this.eventFilterList =3D Collections.unmodifiableList(eventFilterLis= t); + this.renderFilterList =3D Collections.unmodifiableList(renderFilterL= ist); + this.resourceFilterList =3D Collections.unmodifiableList(resourceFil= terList); + } + + private List builderFilterList(Class ty= pe) + { + ArrayList list =3D new ArrayList(); + for (String filterRef : info.getFilterRefs()) + { + T filter =3D application.getFilter(filterRef, type); + list.add(filter); + } + return list; + } + public void stop() { // if the portlet is not started, we shouldn't be trying to stop it.= .. @@ -419,7 +487,10 @@ dreq.setAttribute(APIConstants.JAVAX_PORTLET_RESPONSE, resp); dreq.setAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE, "AC= TION_PHASE"); dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_= INVOCATION, invocation); - portlet.processAction(req, resp); + + // + FilterChainImpl chain =3D new FilterChainImpl(actionFilterList, ActionFilter.class); + chain.doFilter(req, resp); } finally { @@ -446,7 +517,10 @@ dreq.setAttribute(APIConstants.JAVAX_PORTLET_RESPONSE, resp); dreq.setAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE, "RE= NDER_PHASE"); dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_= INVOCATION, invocation); - portlet.render(req, resp); + + // + FilterChainImpl chain =3D new FilterChainImpl(renderFilterList, RenderFilter.class); + chain.doFilter(req, resp); } finally { @@ -466,17 +540,20 @@ = // PortletAPIFactory factory =3D application.getPortletAPIFactory(); - EventRequestImpl ereq =3D factory.createEventRequest(invocation); - EventResponseImpl eresp =3D factory.createEventResponse(invocation, = ereq); + EventRequestImpl req =3D factory.createEventRequest(invocation); + EventResponseImpl resp =3D factory.createEventResponse(invocation, r= eq); HttpServletRequest dreq =3D invocation.getDispatchedRequest(); try { dreq.setAttribute(APIConstants.JAVAX_PORTLET_CONFIG, config); - dreq.setAttribute(APIConstants.JAVAX_PORTLET_REQUEST, ereq); - dreq.setAttribute(APIConstants.JAVAX_PORTLET_RESPONSE, eresp); + dreq.setAttribute(APIConstants.JAVAX_PORTLET_REQUEST, req); + dreq.setAttribute(APIConstants.JAVAX_PORTLET_RESPONSE, resp); dreq.setAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE, "EV= ENT_PHASE"); dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_= INVOCATION, invocation); - eventPortlet.processEvent(ereq, eresp); + + // + FilterChainImpl chain =3D new FilterChainImpl(eventFilterList, EventFilter.class); + chain.doFilter(req, resp); } finally { @@ -486,7 +563,7 @@ dreq.removeAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE); dreq.removeAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONE= NT_INVOCATION); } - return eresp.getResponse(); + return resp.getResponse(); } = protected PortletInvocationResponse invokeResource(ResourceInvocation i= nvocation) throws IOException, PortletException @@ -506,7 +583,10 @@ dreq.setAttribute(APIConstants.JAVAX_PORTLET_RESPONSE, resp); dreq.setAttribute(APIConstants.JAVAX_PORTLET_LIFECYCLE_PHASE, "RE= SOURCE_SERVING_PHASE"); dreq.setAttribute(ContextDispatcherInterceptor.REQ_ATT_COMPONENT_= INVOCATION, invocation); - eventPortlet.serveResource(req, resp); + + // + FilterChainImpl chain =3D new FilterChainImpl(resourceFilterList, ResourceFilter.class); + chain.doFilter(req, resp); } finally { @@ -520,4 +600,39 @@ // return resp.getResponse(); } + + private class Invoker implements ActionFilter, EventFilter, RenderFilte= r, ResourceFilter + { + + public void doFilter(ActionRequest req, ActionResponse resp, FilterC= hain chain) throws IOException, PortletException + { + portlet.processAction(req, resp); + } + + public void doFilter(EventRequest req, EventResponse resp, FilterCha= in chain) throws IOException, PortletException + { + EventPortlet eventPortlet =3D (EventPortlet)portlet; + eventPortlet.processEvent(req, resp); + } + + public void doFilter(RenderRequest req, RenderResponse resp, FilterC= hain chain) throws IOException, PortletException + { + portlet.render(req, resp); + } + + public void doFilter(ResourceRequest req, ResourceResponse resp, Fil= terChain chain) throws IOException, PortletException + { + ResourceServingPortlet servingPortlet =3D (ResourceServingPortlet= )portlet; + servingPortlet.serveResource(req, resp); + } + + public void init(FilterConfig filterConfig) throws PortletException + { + } + + public void destroy() + { + } + } + } Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr168/api/FilterChainImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/FilterChainImpl.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/FilterChainImpl.java 2008-02-02 18:26:59 UTC (rev 9714) @@ -0,0 +1,165 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.impl.jsr168.api; + +import javax.portlet.filter.PortletFilter; +import javax.portlet.filter.ActionFilter; +import javax.portlet.filter.ResourceFilter; +import javax.portlet.filter.RenderFilter; +import javax.portlet.filter.EventFilter; +import javax.portlet.filter.FilterChain; +import javax.portlet.PortletException; +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.ResourceRequest; +import javax.portlet.ResourceResponse; +import javax.portlet.RenderRequest; +import javax.portlet.RenderResponse; +import javax.portlet.EventRequest; +import javax.portlet.EventResponse; +import java.io.IOException; +import java.util.List; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class FilterChainImpl implements FilterCha= in +{ + + /** . */ + private List filters; + + /** . */ + private Class phase; + + /** . */ + private int index; + + public FilterChainImpl(List filters, Class phase) + { + this.filters =3D filters; + this.phase =3D phase; + this.index =3D 0; + } + + public void doFilter(ActionRequest req, ActionResponse resp) throws IOE= xception, PortletException + { + if (!ActionFilter.class.isAssignableFrom(phase)) + { + throw new IllegalStateException(); + } + if (index >=3D filters.size()) + { + throw new IllegalStateException(); + } + + // + int currentIndex =3D index++; + try + { + PortletFilter filter =3D filters.get(currentIndex); + ActionFilter actionFilter =3D ActionFilter.class.cast(filter); + actionFilter.doFilter(req, resp, this); + } + finally + { + index--; + } + } + + public void doFilter(EventRequest req, EventResponse resp) throws IOExc= eption, PortletException + { + if (!EventFilter.class.isAssignableFrom(phase)) + { + throw new IllegalStateException(); + } + if (index >=3D filters.size()) + { + throw new IllegalStateException(); + } + + // + int currentIndex =3D index++; + try + { + PortletFilter filter =3D filters.get(currentIndex); + EventFilter eventFilter =3D EventFilter.class.cast(filter); + eventFilter.doFilter(req, resp, this); + } + finally + { + index--; + } + } + + public void doFilter(RenderRequest req, RenderResponse resp) throws IOE= xception, PortletException + { + if (!RenderFilter.class.isAssignableFrom(phase)) + { + throw new IllegalStateException(); + } + if (index >=3D filters.size()) + { + throw new IllegalStateException(); + } + + // + int currentIndex =3D index++; + try + { + PortletFilter filter =3D filters.get(currentIndex); + RenderFilter renderFilter =3D RenderFilter.class.cast(filter); + renderFilter.doFilter(req, resp, this); + } + finally + { + index--; + } + } + + public void doFilter(ResourceRequest req, ResourceResponse resp) throws= IOException, PortletException + { + if (!ResourceFilter.class.isAssignableFrom(phase)) + { + throw new IllegalStateException(); + } + if (index >=3D filters.size()) + { + throw new IllegalStateException(); + } + + // + int currentIndex =3D index++; + try + { + PortletFilter filter =3D filters.get(currentIndex); + ResourceFilter resourceFilter =3D ResourceFilter.class.cast(filte= r); + resourceFilter.doFilter(req, resp, this); + } + finally + { + index--; + } + } +} Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet= /impl/jsr168/api/FilterConfigImpl.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/FilterConfigImpl.java (rev 0) +++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/im= pl/jsr168/api/FilterConfigImpl.java 2008-02-02 18:26:59 UTC (rev 9714) @@ -0,0 +1,69 @@ +/*************************************************************************= ***** + * JBoss, a division of Red Hat = * + * Copyright 2006, Red Hat Middleware, LLC, and individual = * + * contributors as indicated by the @authors tag. See the = * + * copyright.txt in the distribution for a full listing of = * + * individual contributors. = * + * = * + * This is free software; you can redistribute it and/or modify it = * + * under the terms of the GNU Lesser General Public License as = * + * published by the Free Software Foundation; either version 2.1 of = * + * the License, or (at your option) any later version. = * + * = * + * This software is distributed in the hope that it will be useful, = * + * but WITHOUT ANY WARRANTY; without even the implied warranty of = * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU = * + * Lesser General Public License for more details. = * + * = * + * You should have received a copy of the GNU Lesser General Public = * + * License along with this software; if not, write to the Free = * + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA = * + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. = * + *************************************************************************= *****/ +package org.jboss.portal.portlet.impl.jsr168.api; + +import org.jboss.portal.common.NotYetImplemented; + +import javax.portlet.filter.FilterConfig; +import javax.portlet.PortletContext; +import java.util.Enumeration; + +/** + * @author Julien Viet + * @version $Revision: 630 $ + */ +public class FilterConfigImpl implements FilterConfig +{ + + /** . */ + private final String name; + + /** . */ + private final PortletContext context; + + public FilterConfigImpl(String name, PortletContext context) + { + this.name =3D name; + this.context =3D context; + } + + public String getFilterName() + { + return name; + } + + public PortletContext getPortletContext() + { + return context; + } + + public String getInitParameter(String s) + { + throw new NotYetImplemented(); + } + + public Enumeration getInitParameterNames() + { + throw new NotYetImplemented(); + } +} Modified: modules/portlet/trunk/test/src/test/build.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/portlet/trunk/test/src/test/build.xml 2008-02-02 14:21:03 UTC (= rev 9713) +++ modules/portlet/trunk/test/src/test/build.xml 2008-02-02 18:26:59 UTC (= rev 9714) @@ -16,7 +16,7 @@ = - + = = --===============0251074312575580442==--