Author: julien(a)jboss.com
Date: 2008-01-25 14:59:07 -0500 (Fri, 25 Jan 2008)
New Revision: 9610
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/ContentRef.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/SoftContentRef.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/StrongContentRef.java
Removed:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/SoftTimedContent.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/StrongTimedContent.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/TimedContent.java
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/cache/CacheControl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/CacheControlImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/MimeResponseImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceRequestImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceResponseImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceURLImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractClientContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractResourceContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/RenderInvocation.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/ResourceInvocation.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ClientContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ResourceInvocationContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/ClientContextSupport.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/RenderContextSupport.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/ext/nocache/AbstractNoCacheTestCase.java
Log:
started to implement cache etag and cache control interface
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ConsumerCacheInterceptor.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -25,8 +25,8 @@
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
-import org.jboss.portal.portlet.invocation.response.cache.TimedContent;
-import org.jboss.portal.portlet.invocation.response.cache.StrongTimedContent;
+import org.jboss.portal.portlet.invocation.response.cache.ContentRef;
+import org.jboss.portal.portlet.invocation.response.cache.StrongContentRef;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.StateString;
@@ -72,65 +72,61 @@
CacheEntry cachedEntry = (CacheEntry)resolver.getAttribute(scopeKey);
//
- FragmentResponse fragment = null;
if (cachedEntry != null)
{
- long currentTimeMillis = System.currentTimeMillis();
-
// Check time validity for fragment
boolean useEntry = false;
- if (currentTimeMillis < cachedEntry.getExpirationTimeMillis())
- {
- StateString entryNavState = cachedEntry.getNavigationalState();
+ StateString entryNavState = cachedEntry.navigationalState;
- // Then check nav state equality
- if (navState == null)
+ // Then check nav state equality
+ if (navState == null)
+ {
+ if (entryNavState == null)
{
- if (entryNavState == null)
- {
- useEntry = true;
- }
- else if (entryNavState instanceof ParametersStateString)
- {
- // We consider a parameters state string empty equivalent to a null
value
- useEntry = ((ParametersStateString)entryNavState).getSize() == 0;
- }
+ useEntry = true;
}
- else if (entryNavState == null)
+ else if (entryNavState instanceof ParametersStateString)
{
- if (navState instanceof ParametersStateString)
- {
- useEntry = ((ParametersStateString)navState).getSize() == 0;
- }
+ // We consider a parameters state string empty equivalent to a null
value
+ useEntry = ((ParametersStateString)entryNavState).getSize() == 0;
}
- else
+ }
+ else if (entryNavState == null)
+ {
+ if (navState instanceof ParametersStateString)
{
- useEntry = navState.equals(entryNavState);
+ useEntry = ((ParametersStateString)navState).getSize() == 0;
}
-
- // Then check window state equality
- useEntry &= windowState.equals(cachedEntry.getWindowState());
-
- // Then check mode equality
- useEntry &= mode.equals(cachedEntry.getMode());
}
-
- // Use the entry
- if (useEntry)
+ else
{
- fragment = cachedEntry.getContent();
+ useEntry = navState.equals(entryNavState);
}
+ // Then check window state equality
+ useEntry &= windowState.equals(cachedEntry.windowState);
+
+ // Then check mode equality
+ useEntry &= mode.equals(cachedEntry.mode);
+
// Clean if it is null
- if (fragment == null)
+ if (!useEntry)
{
+ cachedEntry = null;
resolver.setAttribute(scopeKey, null);
}
}
- // If no fragment we must invoke
- if (fragment == null)
+ FragmentResponse fragment = cachedEntry != null ?
cachedEntry.contentRef.getContent() : null;
+
+ // If no valid fragment we must invoke
+ if (fragment == null || cachedEntry.expirationTimeMillis <
System.currentTimeMillis())
{
+ RenderInvocation render = (RenderInvocation)invocation;
+
+ // Set validation token for revalidation if any
+ render.setValidationToken(cachedEntry != null ? cachedEntry.validationToken :
null);
+
// Invoke
PortletInvocationResponse response =
(PortletInvocationResponse)invocation.invokeNext();
@@ -159,7 +155,7 @@
// Cache if we can
if (expirationTimeMillis > 0)
{
- CacheEntry cacheEntry = new CacheEntry(navState, windowState, mode,
renderResult, expirationTimeMillis);
+ CacheEntry cacheEntry = new CacheEntry(navState, windowState, mode,
renderResult, expirationTimeMillis, control.getValidationToken());
resolver.setAttribute(scopeKey, cacheEntry);
}
}
@@ -187,27 +183,34 @@
/**
* Encapsulate cache information.
*/
- public static class CacheEntry implements Serializable
+ private static class CacheEntry implements Serializable
{
/** The entry navigational state. */
private final StateString navigationalState;
/** . */
- private WindowState windowState;
+ private final WindowState windowState;
/** . */
- private Mode mode;
+ private final Mode mode;
/** The timed content. */
- private final TimedContent cachedResult;
+ private final ContentRef contentRef;
+ /** . */
+ private final long expirationTimeMillis;
+
+ /** . */
+ private final String validationToken;
+
public CacheEntry(
StateString navigationalState,
WindowState windowState,
Mode mode,
- FragmentResponse result,
- long expirationTimeMillis)
+ FragmentResponse content,
+ long expirationTimeMillis,
+ String validationToken)
{
if (expirationTimeMillis <= 0)
{
@@ -216,32 +219,9 @@
this.navigationalState = navigationalState;
this.windowState = windowState;
this.mode = mode;
- this.cachedResult = new StrongTimedContent(result, expirationTimeMillis);
+ this.contentRef = new StrongContentRef(content);
+ this.expirationTimeMillis = expirationTimeMillis;
+ this.validationToken = validationToken;
}
-
- public StateString getNavigationalState()
- {
- return navigationalState;
- }
-
- public WindowState getWindowState()
- {
- return windowState;
- }
-
- public Mode getMode()
- {
- return mode;
- }
-
- public long getExpirationTimeMillis()
- {
- return cachedResult.getExpirationTimeMillis();
- }
-
- public FragmentResponse getContent()
- {
- return cachedResult.getContent();
- }
}
}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/cache/CacheControl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/cache/CacheControl.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/cache/CacheControl.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -36,13 +36,13 @@
private CacheScope cacheScope;
/** The validation token. */
- private String token;
+ private String validationToken;
- public CacheControl(int expirationSecs, CacheScope cacheScope, String token)
+ public CacheControl(int expirationSecs, CacheScope cacheScope, String
validationToken)
{
this.expirationSecs = expirationSecs;
this.cacheScope = cacheScope;
- this.token = token;
+ this.validationToken = validationToken;
}
public int getExpirationSecs()
@@ -65,26 +65,26 @@
this.cacheScope = cacheScope;
}
- public String getToken()
+ public String getValidationToken()
{
- return token;
+ return validationToken;
}
- public void setToken(String token)
+ public void setValidationToken(String validationToken)
{
- this.token = token;
+ this.validationToken = validationToken;
}
public CacheControl unmodifiable()
{
- return new CacheControl(expirationSecs, cacheScope, token)
+ return new CacheControl(expirationSecs, cacheScope, validationToken)
{
public void setCacheScope(CacheScope cacheScope)
{
throw new UnsupportedOperationException("Not modifiable");
}
- public void setToken(String token)
+ public void setValidationToken(String token)
{
throw new UnsupportedOperationException("Not modifiable");
}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/CacheControlImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/CacheControlImpl.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/CacheControlImpl.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -66,12 +66,12 @@
public String getETag()
{
- return delegate.getToken();
+ return delegate.getValidationToken();
}
public void setETag(String etag)
{
- delegate.setToken(etag);
+ delegate.setValidationToken(etag);
}
public boolean useCachedContent()
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/MimeResponseImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/MimeResponseImpl.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/MimeResponseImpl.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -215,27 +215,32 @@
{
if (MimeResponse.EXPIRATION_CACHE.equals(key))
{
- if (value == null)
+ if (value != null)
{
- return;
- }
-
- //
- try
- {
- int expirationSecs = Integer.parseInt(value);
- fragment.getCacheControl().setExpirationSecs(expirationSecs);
- }
- catch (NumberFormatException e)
- {
- // todo: Make the portlet log instead
+ try
+ {
+ int expirationSecs = Integer.parseInt(value);
+ fragment.getCacheControl().setExpirationSecs(expirationSecs);
+ }
+ catch (NumberFormatException e)
+ {
+ // todo: Make the portlet log instead
// log.warn("Portlet " + invocation.getTarget() +
// " set a non integer cache value override during render "
+ value, e);
+ }
}
}
-
- //
- super.addProperty(key, value);
+ else if (MimeResponse.ETAG.equals(key))
+ {
+ if (value != null)
+ {
+ fragment.getCacheControl().setValidationToken(value);
+ }
+ }
+ else
+ {
+ super.addProperty(key, value);
+ }
}
public CacheControl getCacheControl()
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -25,6 +25,8 @@
import org.apache.log4j.Logger;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.common.util.MultiValuedPropertyMap;
+import org.jboss.portal.common.util.SimpleMultiValuedPropertyMap;
import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.portlet.container.PortletContainerInvoker;
import org.jboss.portal.portlet.impl.jsr168.PortletApplicationImpl;
@@ -91,6 +93,9 @@
protected ContainerNavigationInfo navigationInfo;
/** . */
+ private MultiValuedPropertyMap<String> properties;
+
+ /** . */
protected final PortletRequestAttributes attributes;
/** . */
@@ -221,17 +226,7 @@
}
//
- List<String> properties = clientContext.getProperties(name);
-
- //
- if (properties == null || properties.size() == 0)
- {
- return null;
- }
- else
- {
- return properties.get(0);
- }
+ return getProperties().getValue(name);
}
public Enumeration<String> getProperties(String name)
@@ -242,7 +237,7 @@
}
//
- List<String> properties = clientContext.getProperties(name);
+ List<String> properties = getProperties().getValues(name);
//
if (properties == null)
@@ -257,7 +252,7 @@
public Enumeration<String> getPropertyNames()
{
- Set<String> names = clientContext.getPropertyNames();
+ Set<String> names = getProperties().keySet();
//
return Collections.enumeration(names);
@@ -506,4 +501,24 @@
return Collections.emptyMap();
}
}
+
+ private MultiValuedPropertyMap<String> getProperties()
+ {
+ if (properties == null)
+ {
+ SimpleMultiValuedPropertyMap<String> properties = new
SimpleMultiValuedPropertyMap<String>();
+ properties.append(clientContext.getProperties());
+ initProperties(properties);
+
+ //
+ this.properties = properties;
+ }
+
+ //
+ return properties;
+ }
+
+ protected void initProperties(MultiValuedPropertyMap<String> properties)
+ {
+ }
}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/RenderRequestImpl.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -24,6 +24,7 @@
import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.common.NotYetImplemented;
+import org.jboss.portal.common.util.MultiValuedPropertyMap;
import javax.portlet.RenderRequest;
@@ -35,13 +36,27 @@
public class RenderRequestImpl extends PortletRequestImpl implements RenderRequest
{
+ /** . */
+ private final String validationToken;
+
public RenderRequestImpl(RenderInvocation invocation)
{
super(invocation);
+
+ //
+ this.validationToken = invocation.getValidationToken();
}
public String getETag()
{
- throw new NotYetImplemented();
+ return validationToken;
}
+
+ protected void initProperties(MultiValuedPropertyMap<String> properties)
+ {
+ if (validationToken != null)
+ {
+ properties.setValue(ETAG, validationToken);
+ }
+ }
}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceRequestImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceRequestImpl.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceRequestImpl.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -25,6 +25,7 @@
import org.jboss.portal.portlet.invocation.ResourceInvocation;
import org.jboss.portal.portlet.spi.ResourceInvocationContext;
import org.jboss.portal.portlet.impl.jsr168.ResourceRequestParameterMap;
+import org.jboss.portal.common.util.MultiValuedPropertyMap;
import javax.portlet.ResourceRequest;
import java.util.Map;
@@ -39,19 +40,18 @@
/** . */
private final ResourceInvocationContext resourceContext;
+ /** . */
+ private final String validationToken;
+
public ResourceRequestImpl(ResourceInvocation invocation)
{
super(invocation);
//
this.resourceContext = invocation.getContext();
+ this.validationToken = invocation.getValidationToken();
}
- public String getETag()
- {
- throw new UnsupportedOperationException();
- }
-
public String getResourceID()
{
return resourceContext.getResourceId();
@@ -64,6 +64,19 @@
public String getCacheability()
{
- return ResourceURLImpl.toJSR168(resourceContext.getCacheability());
+ return ResourceURLImpl.toJSR168(resourceContext.getCacheLevel());
}
+
+ public String getETag()
+ {
+ return validationToken;
+ }
+
+ protected void initProperties(MultiValuedPropertyMap<String> properties)
+ {
+ if (validationToken != null)
+ {
+ properties.setValue(ETAG, validationToken);
+ }
+ }
}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceResponseImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceResponseImpl.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceResponseImpl.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -44,7 +44,7 @@
super(invocation, preq);
//
- this.cacheability = invocation.getContext().getCacheability();
+ this.cacheability = invocation.getContext().getCacheLevel();
}
public void setLocale(Locale locale)
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceURLImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceURLImpl.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceURLImpl.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -78,7 +78,7 @@
//
if (invocation instanceof ResourceInvocation)
{
- url.parentCacheLevel =
((ResourceInvocation)invocation).getContext().getCacheability();
+ url.parentCacheLevel =
((ResourceInvocation)invocation).getContext().getCacheLevel();
}
}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractClientContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractClientContext.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractClientContext.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -23,17 +23,15 @@
package org.jboss.portal.portlet.impl.spi;
import org.jboss.portal.portlet.spi.ClientContext;
+import org.jboss.portal.common.util.MultiValuedPropertyMap;
+import org.jboss.portal.common.util.SimpleMultiValuedPropertyMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.Cookie;
import java.util.List;
-import java.util.Set;
-import java.util.Map;
-import java.util.HashMap;
import java.util.Enumeration;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Arrays;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -49,7 +47,7 @@
private final String method;
/** . */
- private final Map<String, List<String>> headers;
+ private final MultiValuedPropertyMap<String> headers;
/** . */
private final List<Cookie> cookies;
@@ -61,31 +59,14 @@
public AbstractClientContext(HttpServletRequest request, List<Cookie>
additionalCookies)
{
- Map<String, List<String>> headers = new HashMap<String,
List<String>>();
+ MultiValuedPropertyMap<String> headers = new
SimpleMultiValuedPropertyMap<String>();
for (Enumeration e = request.getHeaderNames();e.hasMoreElements();)
{
String headerName = (String)e.nextElement();
- Enumeration f = request.getHeaders(headerName);
- if (f.hasMoreElements())
+ for (Enumeration f = request.getHeaders(headerName);f.hasMoreElements();)
{
- List<String> headerValues;
String headerValue = (String)f.nextElement();
- if (f.hasMoreElements())
- {
- headerValues = new ArrayList<String>(4);
- headerValues.add(headerValue);
- headerValues.add((String)f.nextElement());
- while (f.hasMoreElements())
- {
- headerValue = (String)f.nextElement();
- headerValues.add(headerValue);
- }
- }
- else
- {
- headerValues = Collections.singletonList(headerValue);
- }
- headers.put(headerName, headerValues);
+ headers.addValue(headerName, headerValue);
}
}
@@ -123,20 +104,11 @@
return method;
}
- public List<String> getProperties(String name)
+ public MultiValuedPropertyMap<String> getProperties()
{
- if (name == null)
- {
- throw new IllegalArgumentException("No null name accepted");
- }
- return headers.get(name);
+ return headers;
}
- public Set<String> getPropertyNames()
- {
- return headers.keySet();
- }
-
public List<Cookie> getCookies()
{
return cookies;
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -43,19 +43,19 @@
{
/** . */
- protected MarkupInfo markupInfo;
+ protected final MarkupInfo markupInfo;
/** . */
- protected Mode mode;
+ protected final Mode mode;
/** . */
- protected WindowState windowState;
+ protected final WindowState windowState;
/** . */
- protected StateString navigationalState;
+ protected final StateString navigationalState;
/** . */
- protected ParameterMap publicNavigationalState;
+ protected final ParameterMap publicNavigationalState;
protected AbstractPortletInvocationContext(
Mode mode,
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -35,6 +35,7 @@
*/
public abstract class AbstractRenderContext extends AbstractPortletInvocationContext
implements RenderContext
{
+
protected AbstractRenderContext(
Mode mode,
WindowState windowState,
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractResourceContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractResourceContext.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractResourceContext.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -38,16 +38,16 @@
{
/** . */
- private final String resourceId;
+ protected final String resourceId;
/** . */
- private final CacheLevel cacheLevel;
+ protected final StateString resourceState;
/** . */
- private final StateString resourceState;
+ protected final ParameterMap form;
/** . */
- private final ParameterMap form;
+ protected final CacheLevel cacheLevel;
public AbstractResourceContext(
String resourceId,
@@ -64,9 +64,9 @@
//
this.resourceId = resourceId;
- this.cacheLevel = cacheLevel;
this.resourceState = resourceState;
this.form = form;
+ this.cacheLevel = cacheLevel;
}
public String getResourceId()
@@ -74,11 +74,6 @@
return resourceId;
}
- public CacheLevel getCacheability()
- {
- return cacheLevel;
- }
-
public StateString getResourceState()
{
return resourceState;
@@ -88,4 +83,9 @@
{
return form;
}
+
+ public CacheLevel getCacheLevel()
+ {
+ return cacheLevel;
+ }
}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/RenderInvocation.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/RenderInvocation.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/RenderInvocation.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -34,6 +34,9 @@
/** . */
private final RenderContext ctx;
+ /** . */
+ private String validationToken;
+
public RenderInvocation(RenderContext ctx) throws IllegalArgumentException
{
super(ctx);
@@ -46,4 +49,14 @@
{
return ctx;
}
+
+ public String getValidationToken()
+ {
+ return validationToken;
+ }
+
+ public void setValidationToken(String validationToken)
+ {
+ this.validationToken = validationToken;
+ }
}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/ResourceInvocation.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/ResourceInvocation.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/ResourceInvocation.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -36,8 +36,11 @@
private final ResourceInvocationContext ctx;
/** The request context. */
- protected RequestContext requestContext;
+ private RequestContext requestContext;
+ /** . */
+ private String validationToken;
+
public ResourceInvocation(ResourceInvocationContext ctx) throws
IllegalArgumentException
{
super(ctx);
@@ -51,6 +54,16 @@
return ctx;
}
+ public String getValidationToken()
+ {
+ return validationToken;
+ }
+
+ public void setValidationToken(String validationToken)
+ {
+ this.validationToken = validationToken;
+ }
+
public RequestContext getRequestContext()
{
return requestContext;
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/ContentRef.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/ContentRef.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/ContentRef.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * 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.invocation.response.cache;
+
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+
+import java.io.Serializable;
+
+/**
+ * A fragment result + its expiration date.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public abstract class ContentRef implements Serializable
+{
+
+ /**
+ * Returns the content, possibly null.
+ *
+ * @return the content
+ */
+ public abstract FragmentResponse getContent();
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/ContentRef.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/SoftContentRef.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/SoftContentRef.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/SoftContentRef.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * 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.invocation.response.cache;
+
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+
+import java.lang.ref.WeakReference;
+
+/**
+ * Use soft reference.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision:5417 $
+ */
+public class SoftContentRef extends ContentRef
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8166044526732362286L;
+
+ /** The content. */
+ private transient WeakReference<FragmentResponse> content;
+
+ /**
+ * @param content the content
+ * @throws IllegalArgumentException if the content is null
+ */
+ public SoftContentRef(FragmentResponse content) throws IllegalArgumentException
+ {
+ if (content == null)
+ {
+ throw new IllegalArgumentException("Content must not be null");
+ }
+ this.content = new WeakReference<FragmentResponse>(content);
+ }
+
+ public FragmentResponse getContent()
+ {
+ return content.get();
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/SoftContentRef.java
___________________________________________________________________
Name: svn:executable
+ *
Deleted:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/SoftTimedContent.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/SoftTimedContent.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/SoftTimedContent.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -1,59 +0,0 @@
-/******************************************************************************
- * 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.invocation.response.cache;
-
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-
-import java.lang.ref.WeakReference;
-
-/**
- * Use soft reference.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision:5417 $
- */
-public class SoftTimedContent extends TimedContent
-{
-
- /** The serialVersionUID */
- private static final long serialVersionUID = -8166044526732362286L;
-
- /** The content. */
- private transient WeakReference content;
-
- /** @throws IllegalArgumentException if the content is null */
- public SoftTimedContent(FragmentResponse content, long expirationTimeMillis) throws
IllegalArgumentException
- {
- super(expirationTimeMillis);
- if (content == null)
- {
- throw new IllegalArgumentException("Content must not be null");
- }
- this.content = new WeakReference(content);
- }
-
- public FragmentResponse getContent()
- {
- return (FragmentResponse)content.get();
- }
-}
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/StrongContentRef.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/StrongContentRef.java
(rev 0)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/StrongContentRef.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * 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.invocation.response.cache;
+
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+
+/**
+ * Use strong references.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class StrongContentRef extends ContentRef
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8194245397756941208L;
+
+ /** The content. */
+ private transient FragmentResponse content;
+
+ /**
+ * @param content the content
+ * @throws IllegalArgumentException if the content is null
+ */
+ public StrongContentRef(FragmentResponse content) throws IllegalArgumentException
+ {
+ if (content == null)
+ {
+ throw new IllegalArgumentException("Content must not be null");
+ }
+ this.content = content;
+ }
+
+ public FragmentResponse getContent()
+ {
+ return content;
+ }
+}
Property changes on:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/StrongContentRef.java
___________________________________________________________________
Name: svn:executable
+ *
Deleted:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/StrongTimedContent.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/StrongTimedContent.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/StrongTimedContent.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -1,56 +0,0 @@
-/******************************************************************************
- * 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.invocation.response.cache;
-
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-
-/**
- * Use strong references.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5448 $
- */
-public class StrongTimedContent extends TimedContent
-{
-
- /** The serialVersionUID */
- private static final long serialVersionUID = -8194245397756941208L;
- /** The content. */
- private transient FragmentResponse content;
-
- /** @throws IllegalArgumentException if the content is null */
- public StrongTimedContent(FragmentResponse content, long expirationTimeMillis) throws
IllegalArgumentException
- {
- super(expirationTimeMillis);
- if (content == null)
- {
- throw new IllegalArgumentException("Content must not be null");
- }
- this.content = content;
- }
-
- public FragmentResponse getContent()
- {
- return content;
- }
-}
Deleted:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/TimedContent.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/TimedContent.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/response/cache/TimedContent.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -1,56 +0,0 @@
-/******************************************************************************
- * 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.invocation.response.cache;
-
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-
-import java.io.Serializable;
-
-/**
- * A fragment result + its expiration date.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5448 $
- */
-public abstract class TimedContent implements Serializable
-{
-
- /** Expiration date. */
- private final long expirationTimeMillis;
-
- public TimedContent(long expirationTimeMillis)
- {
- this.expirationTimeMillis = expirationTimeMillis;
- }
-
- /** Return the content, possibly null. */
- public abstract FragmentResponse getContent();
-
- /**
- *
- */
- public long getExpirationTimeMillis()
- {
- return expirationTimeMillis;
- }
-}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ClientContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ClientContext.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ClientContext.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.portlet.spi;
+import org.jboss.portal.common.util.MultiValuedPropertyMap;
+
import javax.servlet.http.Cookie;
-import java.util.Iterator;
-import java.util.Set;
import java.util.List;
/**
@@ -37,16 +37,11 @@
String getMethod();
/**
- * Returns the list of values of a specified property as seen by the client.
+ * Returns the properties as seen by the client.
*
- * @param name the property
- * @return the list of properties
- * @throws IllegalArgumentException if the name is null
+ * @return the properties
*/
- List<String> getProperties(String name) throws IllegalArgumentException;
+ MultiValuedPropertyMap<String> getProperties();
- Set<String> getPropertyNames();
-
List<Cookie> getCookies();
-
}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ResourceInvocationContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ResourceInvocationContext.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ResourceInvocationContext.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -41,13 +41,6 @@
String getResourceId();
/**
- * Returns the cacheability.
- *
- * @return the cacheability
- */
- CacheLevel getCacheability();
-
- /**
* Returns the resource state of the request.
*
* @return the resource state
@@ -61,4 +54,10 @@
*/
ParameterMap getForm();
+ /**
+ * Returns the cache level.
+ *
+ * @return the cache level
+ */
+ CacheLevel getCacheLevel();
}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/ClientContextSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/ClientContextSupport.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/ClientContextSupport.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.support.spi;
import org.jboss.portal.portlet.spi.ClientContext;
+import org.jboss.portal.common.util.MultiValuedPropertyMap;
import javax.servlet.http.Cookie;
import java.util.List;
@@ -39,16 +40,11 @@
throw new UnsupportedOperationException();
}
- public List<String> getProperties(String name)
+ public MultiValuedPropertyMap<String> getProperties()
{
throw new UnsupportedOperationException();
}
- public Set<String> getPropertyNames()
- {
- throw new UnsupportedOperationException();
- }
-
public List<Cookie> getCookies()
{
throw new UnsupportedOperationException();
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/RenderContextSupport.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/RenderContextSupport.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/RenderContextSupport.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -30,4 +30,5 @@
*/
public class RenderContextSupport extends PortletInvocationContextSupport implements
RenderContext
{
+
}
Modified:
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/ext/nocache/AbstractNoCacheTestCase.java
===================================================================
---
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/ext/nocache/AbstractNoCacheTestCase.java 2008-01-25
19:53:26 UTC (rev 9609)
+++
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/jsr168/ext/nocache/AbstractNoCacheTestCase.java 2008-01-25
19:59:07 UTC (rev 9610)
@@ -97,6 +97,7 @@
// Should be called
calls.add("2");
response.setProperty(RenderResponse.EXPIRATION_CACHE, "5");
+ response.setProperty(RenderResponse.ETAG, "xyz");
// Refresh
return new InvokeGetResponse(url);
@@ -155,6 +156,8 @@
{
protected DriverResponse run(Portlet portlet, RenderRequest request,
RenderResponse response, PortletTestContext context) throws IOException, PortletException
{
+ assertEquals("xyz", request.getETag());
+
// Should be called
calls.add("5");
response.setProperty(RenderResponse.EXPIRATION_CACHE, "5");