You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2008/04/15 05:23:45 UTC
svn commit: r648109 - in
/portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components:
portal/src/java/org/apache/jetspeed/aggregator/impl/
registry/src/test/org/apache/jetspeed/components/portletentity/
Author: taylor
Date: Mon Apr 14 20:23:41 2008
New Revision: 648109
URL: http://svn.apache.org/viewvc?rev=648109&view=rev
Log:
https://issues.apache.org/jira/browse/JS2-864
continued. help garbage collection in release of render buffers, added support for parallel
Added:
portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/aggregator/impl/BaseAggregatorImpl.java
Modified:
portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java
portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PageAggregatorImpl.java
portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/registry/src/test/org/apache/jetspeed/components/portletentity/ContentFragmentTestImpl.java
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java?rev=648109&r1=648108&r2=648109&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/aggregator/impl/AsyncPageAggregatorImpl.java Mon Apr 14 20:23:41 2008
@@ -47,7 +47,7 @@
* @author <a>Woonsan Ko</a>
* @version $Id: $
*/
-public class AsyncPageAggregatorImpl implements PageAggregator
+public class AsyncPageAggregatorImpl extends BaseAggregatorImpl implements PageAggregator
{
protected final static Log log = LogFactory.getLog(AsyncPageAggregatorImpl.class);
@@ -95,6 +95,7 @@
context.getRequest().removeAttribute(PortalReservedParameters.MAXIMIZED_FRAGMENT_ATTRIBUTE);
context.getRequest().removeAttribute(PortalReservedParameters.MAXIMIZED_LAYOUT_ATTRIBUTE);
}
+ releaseBuffers(root, context);
}
/**
Added: portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/aggregator/impl/BaseAggregatorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/aggregator/impl/BaseAggregatorImpl.java?rev=648109&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/aggregator/impl/BaseAggregatorImpl.java (added)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/aggregator/impl/BaseAggregatorImpl.java Mon Apr 14 20:23:41 2008
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.aggregator.impl;
+
+import java.util.Iterator;
+
+import org.apache.jetspeed.aggregator.PortletContent;
+import org.apache.jetspeed.om.page.ContentFragment;
+import org.apache.jetspeed.request.RequestContext;
+
+/**
+ * Share common code for all aggregators
+ *
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor </a>
+ * @author <a>Woonsan Ko</a>
+ * @version $Id: $
+ */
+public abstract class BaseAggregatorImpl
+{
+ protected void releaseBuffers(ContentFragment f, RequestContext context)
+ {
+ if (f.getContentFragments() != null && f.getContentFragments().size() > 0)
+ {
+ Iterator children = f.getContentFragments().iterator();
+ while (children.hasNext())
+ {
+ ContentFragment child = (ContentFragment) children.next();
+ if (!"hidden".equals(child.getState()))
+ {
+ releaseBuffers(child, context);
+ }
+ }
+ }
+ PortletContent content = f.getPortletContent();
+ if (content != null && content.getExpiration() == 0)
+ {
+ System.out.println("releasing ..." + f.getName());
+ content.release();
+ }
+ }
+}
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PageAggregatorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PageAggregatorImpl.java?rev=648109&r1=648108&r2=648109&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PageAggregatorImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/portal/src/java/org/apache/jetspeed/aggregator/impl/PageAggregatorImpl.java Mon Apr 14 20:23:41 2008
@@ -24,12 +24,10 @@
import org.apache.jetspeed.PortalReservedParameters;
import org.apache.jetspeed.aggregator.FailedToRenderFragmentException;
import org.apache.jetspeed.aggregator.PageAggregator;
-import org.apache.jetspeed.aggregator.PortletContent;
import org.apache.jetspeed.aggregator.PortletRenderer;
import org.apache.jetspeed.container.state.NavigationalState;
import org.apache.jetspeed.exception.JetspeedException;
import org.apache.jetspeed.om.page.ContentFragment;
-import org.apache.jetspeed.om.page.ContentFragmentImpl;
import org.apache.jetspeed.om.page.ContentPage;
import org.apache.jetspeed.request.RequestContext;
import org.apache.pluto.om.window.PortletWindow;
@@ -41,7 +39,7 @@
* @author <a href="mailto:taylor@apache.org">David Sean Taylor </a>
* @version $Id$
*/
-public class PageAggregatorImpl implements PageAggregator
+public class PageAggregatorImpl extends BaseAggregatorImpl implements PageAggregator
{
private final static Log log = LogFactory.getLog(PageAggregatorImpl.class);
private PortletRenderer renderer;
@@ -150,26 +148,5 @@
renderer.renderNow(f, context);
}
- protected void releaseBuffers(ContentFragment f, RequestContext context)
- {
- if (f.getContentFragments() != null && f.getContentFragments().size() > 0)
- {
- Iterator children = f.getContentFragments().iterator();
- while (children.hasNext())
- {
- ContentFragment child = (ContentFragment) children.next();
- if (!"hidden".equals(f.getState()))
- {
- releaseBuffers(child, context);
- }
- }
- }
- PortletContent content = f.getPortletContent();
- if (content.getExpiration() == 0)
- {
- System.out.println("releasing ..." + f.getName());
- content.release();
- }
- }
}
Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/registry/src/test/org/apache/jetspeed/components/portletentity/ContentFragmentTestImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/registry/src/test/org/apache/jetspeed/components/portletentity/ContentFragmentTestImpl.java?rev=648109&r1=648108&r2=648109&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/registry/src/test/org/apache/jetspeed/components/portletentity/ContentFragmentTestImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.2-POSTRELEASE/components/registry/src/test/org/apache/jetspeed/components/portletentity/ContentFragmentTestImpl.java Mon Apr 14 20:23:41 2008
@@ -53,6 +53,11 @@
this.f = f;
}
+ public PortletContent getPortletContent()
+ {
+ return null;
+ }
+
/**
* @param actions
* @throws SecurityException
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org