[jboss-cvs] jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/producer ...
Chris Laprun
chris.laprun at jboss.com
Wed Aug 2 19:48:24 EDT 2006
User: claprun
Date: 06/08/02 19:48:24
Modified: wsrp/src/main/org/jboss/portal/wsrp/producer
MarkupHandler.java
Log:
- Implemented producer-side support for sending caching information to consumers.
- Added caching support tests.
- Improved tests.
Revision Changes Path
1.63 +18 -4 jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MarkupHandler.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -b -r1.62 -r1.63
--- MarkupHandler.java 31 Jul 2006 00:20:52 -0000 1.62
+++ MarkupHandler.java 2 Aug 2006 23:48:24 -0000 1.63
@@ -27,12 +27,12 @@
import org.jboss.portal.common.util.LocaleInfo;
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.portlet.OpaqueStateString;
+import org.jboss.portal.portlet.Parameters;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.Parameters;
-import org.jboss.portal.portlet.support.spi.InstanceContextSupport;
+import org.jboss.portal.portlet.info.CacheInfo;
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
@@ -47,6 +47,7 @@
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portal.portlet.spi.WindowContext;
import org.jboss.portal.portlet.state.AccessMode;
+import org.jboss.portal.portlet.support.spi.InstanceContextSupport;
import org.jboss.portal.server.util.HTTPStreamInfo;
import org.jboss.portal.wsrp.UserContextConverter;
import org.jboss.portal.wsrp.WSRPConstants;
@@ -110,7 +111,7 @@
/**
* @author <a href="mailto:chris.laprun at jboss.com">Chris Laprun</a>
- * @version $Revision: 1.62 $
+ * @version $Revision: 1.63 $
* @since 2.4
*/
class MarkupHandler extends ServiceHandler implements WSRP_v1_Markup_PortType
@@ -156,7 +157,7 @@
WSRPUtils.throwMissingParametersFaultIfValueIsMissing(portletHandle, "portlet handle", "PortletContext");
// retrieve the portlet
- Portlet portlet = null;
+ Portlet portlet;
try
{
portlet = producer.getPortletWith(portletHandle);
@@ -237,6 +238,18 @@
markupContext.setRequiresUrlRewriting(Boolean.TRUE);
markupContext.setPreferredTitle(portletDescription.getTitle().getValue());
+ // cache information
+ CacheInfo cacheInfo = portlet.getInfo().getCache();
+ if (cacheInfo != null)
+ {
+ int expires = cacheInfo.getExpirationSecs();
+ // only create a CacheControl if expiration time is not 0
+ if (expires != 0)
+ {
+ markupContext.setCacheControl(WSRPTypeFactory.createCacheControl(expires, WSRPConstants.CACHE_PER_USER));
+ }
+ }
+
sessionId = (String)render.getAttribute(WSRPProducer.SESSION_ID_ATTRIBUTE);
SessionContext sessionContext = null;
if (sessionId != null)
@@ -551,6 +564,7 @@
{
return portletHandle;
}
+
public AccessMode getAccessMode()
{
return accessMode;
More information about the jboss-cvs-commits
mailing list