You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2005/11/09 16:43:13 UTC
svn commit: r332071 - in /jakarta/tapestry/trunk: ./
framework/src/descriptor/META-INF/
framework/src/java/org/apache/tapestry/asset/
framework/src/java/org/apache/tapestry/describe/
framework/src/java/org/apache/tapestry/engine/ framework/src/java/org...
Author: hlship
Date: Wed Nov 9 07:42:50 2005
New Revision: 332071
URL: http://svn.apache.org/viewcvs?rev=332071&view=rev
Log:
TAPESTRY-731: Extend RequestDisplay component (used on the Exception page) to also report the internal status of key Tapestry services
Added:
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/ReportStatusHub.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/ReportStatusHubImpl.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/RootDescriptionReceiverFactory.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/RootDescriptionReceiverFactoryImpl.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/RootDescriptionReciever.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/event/ReportStatusEvent.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/event/ReportStatusListener.java
jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/HTMLDescriptionReceiverTest.java
- copied, changed from r329587, jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/TestHTMLDescriptionReceiver.java
jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/NoOpStrategy.java
jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/ReportStatusHubTest.java
jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/event/
jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/event/ReportStatusEventTest.java
Removed:
jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/TestHTMLDescriptionReceiver.java
jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/form/TestLinkSubmit.java
Modified:
jakarta/tapestry/trunk/framework/src/descriptor/META-INF/hivemodule.xml
jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.asset.xml
jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.describe.xml
jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.enhance.xml
jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.ognl.xml
jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.page.xml
jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.parse.xml
jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.request.xml
jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.script.xml
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/asset/ResourceDigestSourceImpl.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/DescribableStrategy.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/HTMLDescriberImpl.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/HTMLDescriptionReceiver.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/DefaultScriptSource.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/RequestDisplay.html
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/RequestDisplay.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/RequestDisplay.jwc
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pageload/PageSource.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pages/Exception.css
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ComponentConstructorFactoryImpl.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ExpressionCacheImpl.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ObjectPoolImpl.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/SpecificationSourceImpl.java
jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/TemplateSourceImpl.java
jakarta/tapestry/trunk/portlet/src/descriptor/META-INF/hivemodule.xml
jakarta/tapestry/trunk/status.xml
Modified: jakarta/tapestry/trunk/framework/src/descriptor/META-INF/hivemodule.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/descriptor/META-INF/hivemodule.xml?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/descriptor/META-INF/hivemodule.xml (original)
+++ jakarta/tapestry/trunk/framework/src/descriptor/META-INF/hivemodule.xml Wed Nov 9 07:42:50 2005
@@ -182,6 +182,7 @@
<invoke-factory>
<construct class="impl.ObjectPoolImpl">
<event-listener service-id="ResetEventCoordinator"/>
+ <event-listener service-id="tapestry.describe.ReportStatusHub"/>
</construct>
</invoke-factory>
</service-point>
Modified: jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.asset.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.asset.xml?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.asset.xml (original)
+++ jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.asset.xml Wed Nov 9 07:42:50 2005
@@ -128,6 +128,7 @@
<invoke-factory>
<construct class="ResourceDigestSourceImpl">
<event-listener service-id="tapestry.ResetEventCoordinator"/>
+ <event-listener service-id="tapestry.describe.ReportStatusHub"/>
</construct>
</invoke-factory>
</service-point>
Modified: jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.describe.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.describe.xml?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.describe.xml (original)
+++ jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.describe.xml Wed Nov 9 07:42:50 2005
@@ -43,20 +43,46 @@
</invoke-factory>
</service-point>
+ <service-point id="RootDescriptionReceiverFactory">
+
+ Creates a RootDescriptionReceiver instances around a markup
+ writer and the DescribableStategy service.
+
+ <invoke-factory>
+ <construct class="RootDescriptionReceiverFactoryImpl">
+ <set-service property="strategy" service-id="DescribableStrategy"/>
+ </construct>
+ </invoke-factory>
+ </service-point>
+
<service-point id="HTMLDescriber">
Describes an object in an HTML format.
<invoke-factory>
<construct class="HTMLDescriberImpl">
- <set-service property="strategy" service-id="DescribableStrategy"/>
+ <set-object property="receiverFactory" value="infrastructure:rootDescriptionReceiverFactory"/>
</construct>
</invoke-factory>
</service-point>
<contribution configuration-id="tapestry.Infrastructure">
<property name="HTMLDescriber" object="service:HTMLDescriber"/>
+ <property name="rootDescriptionReceiverFactory" object="service:RootDescriptionReceiverFactory"/>
</contribution>
+
+
+ <service-point id="ReportStatusHub">
+
+ Event hub used to get different service implementations to produce an HTML-based report
+ of their internal state.
+
+ <invoke-factory>
+ <construct class="ReportStatusHubImpl">
+ <set-object property="receiverFactory" value="infrastructure:rootDescriptionReceiverFactory"/>
+ </construct>
+ </invoke-factory>
+ </service-point>
<service-point id="DefaultRenderStrategy" interface="RenderStrategy">
Modified: jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.enhance.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.enhance.xml?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.enhance.xml (original)
+++ jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.enhance.xml Wed Nov 9 07:42:50 2005
@@ -28,6 +28,7 @@
<construct class="org.apache.tapestry.services.impl.ComponentConstructorFactoryImpl">
<set-service property="classFactory" service-id="hivemind.ClassFactory"/>
<event-listener service-id="tapestry.ResetEventCoordinator"/>
+ <event-listener service-id="tapestry.describe.ReportStatusHub"/>
<set-service property="validator" service-id="EnhancedClassValidator"/>
<set-service property="chain" service-id="EnhancementWorkerChain"/>
</construct>
Modified: jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.ognl.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.ognl.xml?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.ognl.xml (original)
+++ jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.ognl.xml Wed Nov 9 07:42:50 2005
@@ -35,6 +35,7 @@
<invoke-factory>
<construct class="impl.ExpressionCacheImpl">
<event-listener service-id="tapestry.ResetEventCoordinator"/>
+ <event-listener service-id="tapestry.describe.ReportStatusHub"/>
</construct>
</invoke-factory>
</service-point>
Modified: jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.page.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.page.xml?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.page.xml (original)
+++ jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.page.xml Wed Nov 9 07:42:50 2005
@@ -67,6 +67,7 @@
<invoke-factory>
<construct class="org.apache.tapestry.services.impl.ObjectPoolImpl">
<event-listener service-id="tapestry.ResetEventCoordinator"/>
+ <event-listener service-id="tapestry.describe.ReportStatusHub"/>
</construct>
</invoke-factory>
</service-point>
Modified: jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.parse.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.parse.xml?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.parse.xml (original)
+++ jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.parse.xml Wed Nov 9 07:42:50 2005
@@ -53,6 +53,7 @@
<set-object property="specification" value="infrastructure:applicationSpecification"/>
<set-object property="assetSource" value="service:tapestry.asset.AssetSource"/>
<event-listener service-id="tapestry.ResetEventCoordinator"/>
+ <event-listener service-id="tapestry.describe.ReportStatusHub"/>
</construct>
</invoke-factory>
@@ -84,6 +85,7 @@
<set-service property="componentSpecificationResolver" service-id="tapestry.page.ComponentSpecificationResolver"/>
<set-object property="componentPropertySource" value="infrastructure:componentPropertySource"/>
<event-listener service-id="tapestry.ResetEventCoordinator"/>
+ <event-listener service-id="tapestry.describe.ReportStatusHub"/>
</construct>
</invoke-factory>
Modified: jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.request.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.request.xml?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.request.xml (original)
+++ jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.request.xml Wed Nov 9 07:42:50 2005
@@ -28,6 +28,7 @@
<invoke-factory>
<construct class="impl.ObjectPoolImpl">
<event-listener service-id="tapestry.ResetEventCoordinator"/>
+ <event-listener service-id="tapestry.describe.ReportStatusHub"/>
</construct>
</invoke-factory>
</service-point>
Modified: jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.script.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.script.xml?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.script.xml (original)
+++ jakarta/tapestry/trunk/framework/src/descriptor/META-INF/tapestry.script.xml Wed Nov 9 07:42:50 2005
@@ -26,6 +26,7 @@
<set-service property="expressionEvaluator" service-id="tapestry.ognl.ExpressionEvaluator"/>
<set-object property="valueConverter" value="infrastructure:valueConverter"/>
<event-listener service-id="tapestry.ResetEventCoordinator"/>
+ <event-listener service-id="tapestry.describe.ReportStatusHub"/>
</construct>
</invoke-factory>
</service-point>
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/asset/ResourceDigestSourceImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/asset/ResourceDigestSourceImpl.java?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/asset/ResourceDigestSourceImpl.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/asset/ResourceDigestSourceImpl.java Wed Nov 9 07:42:50 2005
@@ -20,12 +20,15 @@
import java.net.URL;
import java.security.MessageDigest;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.Map;
import org.apache.commons.codec.binary.Hex;
import org.apache.hivemind.ApplicationRuntimeException;
import org.apache.hivemind.ClassResolver;
import org.apache.hivemind.util.IOUtils;
+import org.apache.tapestry.event.ReportStatusEvent;
+import org.apache.tapestry.event.ReportStatusListener;
import org.apache.tapestry.event.ResetEventListener;
/**
@@ -35,8 +38,11 @@
* @author Howard M. Lewis Ship
* @since 4.0
*/
-public class ResourceDigestSourceImpl implements ResourceDigestSource, ResetEventListener
+public class ResourceDigestSourceImpl implements ResourceDigestSource, ResetEventListener,
+ ReportStatusListener
{
+ private String _serviceId;
+
private ClassResolver _classResolver;
private static final int BUFFER_SIZE = 5000;
@@ -65,6 +71,21 @@
_cache.clear();
}
+ public synchronized void reportStatus(ReportStatusEvent event)
+ {
+ event.title(_serviceId);
+ event.property("resource count", _cache.size());
+
+ Iterator i = _cache.entrySet().iterator();
+
+ while (i.hasNext())
+ {
+ Map.Entry entry = (Map.Entry) i.next();
+
+ event.property(entry.getKey().toString(), entry.getValue());
+ }
+ }
+
private String computeMD5(String resourcePath)
{
URL url = _classResolver.getResource(resourcePath);
@@ -124,5 +145,10 @@
public void setClassResolver(ClassResolver classResolver)
{
_classResolver = classResolver;
+ }
+
+ public void setServiceId(String serviceId)
+ {
+ _serviceId = serviceId;
}
}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/DescribableStrategy.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/DescribableStrategy.java?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/DescribableStrategy.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/DescribableStrategy.java Wed Nov 9 07:42:50 2005
@@ -16,7 +16,7 @@
/**
* Strategy class allowing objects that don't implement
- * {@link org.apache.tapestry.describe.Describable} to be described.
+ * {@link org.apache.tapestry.describe.Describable} to be described.
*
* @author Howard M. Lewis Ship
* @since 4.0
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/HTMLDescriberImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/HTMLDescriberImpl.java?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/HTMLDescriberImpl.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/HTMLDescriberImpl.java Wed Nov 9 07:42:50 2005
@@ -22,34 +22,18 @@
*/
public class HTMLDescriberImpl implements HTMLDescriber
{
- private DescribableStrategy _strategy;
-
- private HTMLDescriptionReceiverStyles _styles = new HTMLDescriptionReceiverStyles();
+ private RootDescriptionReceiverFactory _receiverFactory;
public void describeObject(Object object, IMarkupWriter writer)
{
- HTMLDescriptionReceiver dr = new HTMLDescriptionReceiver(writer, _strategy, _styles);
+ RootDescriptionReciever dr = _receiverFactory.newRootDescriptionReceiver(writer);
dr.describe(object);
}
- public void setStrategy(DescribableStrategy strategy)
+ public void setReceiverFactory(RootDescriptionReceiverFactory receiverFactory)
{
- _strategy = strategy;
+ _receiverFactory = receiverFactory;
}
- public void setTableClass(String tableClass)
- {
- _styles.setTableClass(tableClass);
- }
-
- public void setHeaderClass(String headerClass)
- {
- _styles.setHeaderClass(headerClass);
- }
-
- public void setSubheaderClass(String subheaderClass)
- {
- _styles.setSubheaderClass(subheaderClass);
- }
}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/HTMLDescriptionReceiver.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/HTMLDescriptionReceiver.java?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/HTMLDescriptionReceiver.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/HTMLDescriptionReceiver.java Wed Nov 9 07:42:50 2005
@@ -21,22 +21,22 @@
import org.apache.tapestry.IMarkupWriter;
/**
- * Implementation of {@link org.apache.tapestry.describe.DescriptionReceiver}that produces HTML
+ * Implementation of {@link org.apache.tapestry.describe.DescriptionReceiver} that produces HTML
* output using a {@link org.apache.tapestry.IMarkupWriter}.
* <p>
- * TODO: Make {@link #describeAlternate(Object)} exclusive with the other methods
- * {@link #title(String)},{@link #property(String, Object)}, etc.
+ * TODO: Make {@link #describeAlternate(Object)} exclusive with the other methods
+ * {@link #title(String)}, {@link #property(String, Object)}, etc.
*
* @author Howard M. Lewis Ship
* @since 4.0
*/
-public class HTMLDescriptionReceiver implements DescriptionReceiver
+public class HTMLDescriptionReceiver implements RootDescriptionReciever
{
// Emitted for null values.
static final String NULL_VALUE = "<NULL>";
- private IMarkupWriter _writer;
+ private final IMarkupWriter _writer;
private boolean _emitDefault = true;
@@ -67,6 +67,11 @@
_styles = styles;
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.tapestry.describe.RootDescriptionReciever#describe(java.lang.Object)
+ */
public void describe(Object object)
{
if (object == null)
@@ -85,6 +90,21 @@
_strategy.describeObject(alternate, this);
}
+ public void finishUp()
+ {
+ // When false, a <table> was started, which must be closed.
+
+ if (!_emitDefault)
+ _writer.end("table");
+
+ _writer.println();
+
+ _emitDefault = true;
+ _title = null;
+ _section = null;
+ _even = true;
+ }
+
void finishUp(Object object)
{
if (_emitDefault)
@@ -93,12 +113,8 @@
_writer.print(value);
}
- // Not emit default .. means a property was emitted, so a table was started and must be
- // finished.
- else
- _writer.end("table");
- _writer.println();
+ finishUp();
}
public void title(String title)
Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/ReportStatusHub.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/ReportStatusHub.java?rev=332071&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/ReportStatusHub.java (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/ReportStatusHub.java Wed Nov 9 07:42:50 2005
@@ -0,0 +1,51 @@
+// Copyright 2005 The Apache Software Foundation
+//
+// Licensed 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.tapestry.describe;
+
+import org.apache.tapestry.IMarkupWriter;
+import org.apache.tapestry.event.ReportStatusListener;
+
+/**
+ * Service for collecting together status information across the framework; service implementations
+ * implement the {@link org.apache.tapestry.event.ReportStatusListener} interface and register
+ * themselves as listeners here. When desired, the {@link #fireReportStatus(IMarkupWriter)} event
+ * will invoke the listener method on each registered object.
+ *
+ * @author Howard M. Lewis Ship
+ * @since 4.0
+ */
+public interface ReportStatusHub
+{
+ /**
+ * Adds the listener; listeners will be invoked in the order in which they are added.
+ * <strong>Note: only service implementation that are singletons should be report status
+ * listeners. Threaded or pooled implementations should not be added; or should be careful to
+ * add and remove themselves from the hub directly.</strong>
+ *
+ * @param listener
+ */
+ public void addReportStatusListener(ReportStatusListener listener);
+
+ public void removeReportStatusListener(ReportStatusListener listener);
+
+ /**
+ * Generates an HTML status report by invoking
+ * {@link ReportStatusListener#reportStatus(ReportStatusEvent)} on each registered listener.
+ *
+ * @param writer
+ * a markup writer to send the report to.
+ */
+ public void fireReportStatus(IMarkupWriter writer);
+}
Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/ReportStatusHubImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/ReportStatusHubImpl.java?rev=332071&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/ReportStatusHubImpl.java (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/ReportStatusHubImpl.java Wed Nov 9 07:42:50 2005
@@ -0,0 +1,78 @@
+// Copyright 2005 The Apache Software Foundation
+//
+// Licensed 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.tapestry.describe;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.hivemind.util.Defense;
+import org.apache.tapestry.IMarkupWriter;
+import org.apache.tapestry.event.ReportStatusEvent;
+import org.apache.tapestry.event.ReportStatusListener;
+
+/**
+ * Implementation of the tapestry.describe.ReportStatusHub service.
+ *
+ * @author Howard M. Lewis Ship
+ * @since 4.0
+ */
+public class ReportStatusHubImpl implements ReportStatusHub
+{
+ private List _listeners = new ArrayList();
+
+ private RootDescriptionReceiverFactory _receiverFactory;
+
+ public synchronized void addReportStatusListener(ReportStatusListener listener)
+ {
+ Defense.notNull(listener, "listener");
+
+ _listeners.add(listener);
+ }
+
+ public synchronized void removeReportStatusListener(ReportStatusListener listener)
+ {
+ Defense.notNull(listener, "listener");
+
+ _listeners.remove(listener);
+ }
+
+ public synchronized void fireReportStatus(IMarkupWriter writer)
+ {
+ if (_listeners.isEmpty())
+ return;
+
+ RootDescriptionReciever receiver = _receiverFactory.newRootDescriptionReceiver(writer);
+
+ ReportStatusEvent event = new ReportStatusEvent(this, receiver);
+
+ Iterator i = _listeners.iterator();
+
+ while (i.hasNext())
+ {
+ ReportStatusListener listener = (ReportStatusListener) i.next();
+
+ listener.reportStatus(event);
+
+ receiver.finishUp();
+ }
+ }
+
+ public void setReceiverFactory(RootDescriptionReceiverFactory receiverFactory)
+ {
+ _receiverFactory = receiverFactory;
+ }
+
+}
Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/RootDescriptionReceiverFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/RootDescriptionReceiverFactory.java?rev=332071&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/RootDescriptionReceiverFactory.java (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/RootDescriptionReceiverFactory.java Wed Nov 9 07:42:50 2005
@@ -0,0 +1,29 @@
+// Copyright 2005 The Apache Software Foundation
+//
+// Licensed 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.tapestry.describe;
+
+import org.apache.tapestry.IMarkupWriter;
+
+/**
+ * Creates a new instance of {@link org.apache.tapestry.describe.HTMLDescriptionReceiver} around a
+ * provided {@link org.apache.tapestry.IMarkupWriter}.
+ *
+ * @author Howard M. Lewis Ship
+ * @since 4.0
+ */
+public interface RootDescriptionReceiverFactory
+{
+ public RootDescriptionReciever newRootDescriptionReceiver(IMarkupWriter writer);
+}
Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/RootDescriptionReceiverFactoryImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/RootDescriptionReceiverFactoryImpl.java?rev=332071&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/RootDescriptionReceiverFactoryImpl.java (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/RootDescriptionReceiverFactoryImpl.java Wed Nov 9 07:42:50 2005
@@ -0,0 +1,59 @@
+// Copyright 2005 The Apache Software Foundation
+//
+// Licensed 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.tapestry.describe;
+
+import org.apache.tapestry.IMarkupWriter;
+
+/**
+ * Implementation of service tapestry.describe.RootDescriptionReceiverFactory; this represents a
+ * central location to configure each created description receiver with the correct
+ * {@link org.apache.tapestry.describe.DescribableStrategy} and set of
+ * {@link org.apache.tapestry.describe.HTMLDescriptionReceiverStyles}.
+ *
+ * @author Howard M. Lewis Ship
+ * @since 4.0
+ */
+public class RootDescriptionReceiverFactoryImpl implements RootDescriptionReceiverFactory
+{
+ private DescribableStrategy _strategy;
+
+ private HTMLDescriptionReceiverStyles _styles = new HTMLDescriptionReceiverStyles();
+
+ public RootDescriptionReciever newRootDescriptionReceiver(IMarkupWriter writer)
+ {
+ return new HTMLDescriptionReceiver(writer, _strategy, _styles);
+ }
+
+ public void setStrategy(DescribableStrategy strategy)
+ {
+ _strategy = strategy;
+ }
+
+ public void setTableClass(String tableClass)
+ {
+ _styles.setTableClass(tableClass);
+ }
+
+ public void setHeaderClass(String headerClass)
+ {
+ _styles.setHeaderClass(headerClass);
+ }
+
+ public void setSubheaderClass(String subheaderClass)
+ {
+ _styles.setSubheaderClass(subheaderClass);
+ }
+
+}
Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/RootDescriptionReciever.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/RootDescriptionReciever.java?rev=332071&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/RootDescriptionReciever.java (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/describe/RootDescriptionReciever.java Wed Nov 9 07:42:50 2005
@@ -0,0 +1,42 @@
+// Copyright 2005 The Apache Software Foundation
+//
+// Licensed 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.tapestry.describe;
+
+/**
+ * Extended version of {@link org.apache.tapestry.describe.DescriptionReceiver} that adds the
+ * ability to describe the root object, and to finish the description of an object (allowing the
+ * same receiver to be used to describe several objects).
+ *
+ * @author Howard M. Lewis Ship
+ */
+public interface RootDescriptionReciever extends DescriptionReceiver
+{
+
+ /**
+ * Describes the object, using a {@link DescribableStrategy}, or just the object's toString()
+ * if there is no strategy for the object. Automatically invokes {@link #finishUp()} when done.
+ *
+ * @param object
+ * to be described, which may be null
+ */
+ void describe(Object object);
+
+ /**
+ * Invoked after one object has been fully described. Ends a <table>, if one has been
+ * started, and resets the receiver to begin a new object.
+ */
+ void finishUp();
+
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/DefaultScriptSource.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/DefaultScriptSource.java?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/DefaultScriptSource.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/engine/DefaultScriptSource.java Wed Nov 9 07:42:50 2005
@@ -23,6 +23,8 @@
import org.apache.tapestry.IScript;
import org.apache.tapestry.Tapestry;
import org.apache.tapestry.coerce.ValueConverter;
+import org.apache.tapestry.event.ReportStatusEvent;
+import org.apache.tapestry.event.ReportStatusListener;
import org.apache.tapestry.event.ResetEventListener;
import org.apache.tapestry.script.ScriptParser;
import org.apache.tapestry.services.ExpressionEvaluator;
@@ -36,8 +38,10 @@
* @since 1.0.2
*/
-public class DefaultScriptSource implements IScriptSource, ResetEventListener
+public class DefaultScriptSource implements IScriptSource, ResetEventListener, ReportStatusListener
{
+ private String _serviceId;
+
private ClassResolver _classResolver;
/** @since 4.0 */
@@ -53,6 +57,13 @@
_cache.clear();
}
+ public synchronized void reportStatus(ReportStatusEvent event)
+ {
+ event.title(_serviceId);
+ event.property("parsed script count", _cache.size());
+ event.collection("parsed scripts", _cache.keySet());
+ }
+
public synchronized IScript getScript(Resource resource)
{
IScript result = (IScript) _cache.get(resource);
@@ -99,5 +110,10 @@
public void setValueConverter(ValueConverter valueConverter)
{
_valueConverter = valueConverter;
+ }
+
+ public void setServiceId(String serviceId)
+ {
+ _serviceId = serviceId;
}
}
Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/event/ReportStatusEvent.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/event/ReportStatusEvent.java?rev=332071&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/event/ReportStatusEvent.java (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/event/ReportStatusEvent.java Wed Nov 9 07:42:50 2005
@@ -0,0 +1,114 @@
+// Copyright 2005 The Apache Software Foundation
+//
+// Licensed 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.tapestry.event;
+
+import java.util.Collection;
+import java.util.EventObject;
+
+import org.apache.hivemind.util.Defense;
+import org.apache.tapestry.describe.DescriptionReceiver;
+
+/**
+ * Event object used by {@link org.apache.tapestry.event.ReportStatusListener}; the event
+ * implements {@link org.apache.tapestry.describe.DescriptionReceiver}; classes (typically,
+ * HiveMind service implementations) that implement the listener interface will "describe"
+ * themselves to the event.
+ *
+ * @author Howard M. Lewis Ship
+ * @since 4.0
+ */
+public class ReportStatusEvent extends EventObject implements DescriptionReceiver
+{
+ private final DescriptionReceiver _receiver;
+
+ public ReportStatusEvent(Object source, DescriptionReceiver receiver)
+ {
+ super(source);
+
+ Defense.notNull(receiver, "receiver");
+
+ _receiver = receiver;
+ }
+
+ public void array(String key, Object[] values)
+ {
+ _receiver.array(key, values);
+ }
+
+ public void collection(String key, Collection values)
+ {
+ _receiver.collection(key, values);
+ }
+
+ public void describeAlternate(Object alternate)
+ {
+ _receiver.describeAlternate(alternate);
+ }
+
+ public void property(String key, boolean value)
+ {
+ _receiver.property(key, value);
+ }
+
+ public void property(String key, byte value)
+ {
+ _receiver.property(key, value);
+ }
+
+ public void property(String key, char value)
+ {
+ _receiver.property(key, value);
+ }
+
+ public void property(String key, double value)
+ {
+ _receiver.property(key, value);
+ }
+
+ public void property(String key, float value)
+ {
+ _receiver.property(key, value);
+ }
+
+ public void property(String key, int value)
+ {
+ _receiver.property(key, value);
+ }
+
+ public void property(String key, long value)
+ {
+ _receiver.property(key, value);
+ }
+
+ public void property(String key, Object value)
+ {
+ _receiver.property(key, value);
+ }
+
+ public void property(String key, short value)
+ {
+ _receiver.property(key, value);
+ }
+
+ public void section(String section)
+ {
+ _receiver.section(section);
+ }
+
+ public void title(String title)
+ {
+ _receiver.title(title);
+ }
+}
Added: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/event/ReportStatusListener.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/event/ReportStatusListener.java?rev=332071&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/event/ReportStatusListener.java (added)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/event/ReportStatusListener.java Wed Nov 9 07:42:50 2005
@@ -0,0 +1,30 @@
+// Copyright 2005 The Apache Software Foundation
+//
+// Licensed 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.tapestry.event;
+
+import java.util.EventListener;
+
+/**
+ * Implemented by (typically) a HiveMind service implementation, and registerred with the
+ * {@link org.apache.tapestry.describe.ReportStatusHub} so that the service can report its status
+ * (in terms of properties and values).
+ *
+ * @author Howard M. Lewis Ship
+ * @since 4.0
+ */
+public interface ReportStatusListener extends EventListener
+{
+ public void reportStatus(ReportStatusEvent event);
+}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/RequestDisplay.html
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/RequestDisplay.html?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/RequestDisplay.html (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/RequestDisplay.html Wed Nov 9 07:42:50 2005
@@ -8,5 +8,7 @@
<span jwcid="@Describe" object="ognl:activator"/>
<span jwcid="@Describe" object="ognl:context"/>
+<span jwcid="@Delegator" delegate="ognl:reportStatusRenderer"/>
+
<span jwcid="@Delegator" delegate="ognl:systemPropertiesRenderer"/>
</span>
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/RequestDisplay.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/RequestDisplay.java?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/RequestDisplay.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/RequestDisplay.java Wed Nov 9 07:42:50 2005
@@ -24,6 +24,7 @@
import org.apache.tapestry.IMarkupWriter;
import org.apache.tapestry.IRender;
import org.apache.tapestry.IRequestCycle;
+import org.apache.tapestry.describe.ReportStatusHub;
import org.apache.tapestry.web.WebUtils;
/**
@@ -37,6 +38,10 @@
{
private boolean _even;
+ // Injected
+
+ public abstract ReportStatusHub getReportStatusHub();
+
public void renderSystemProperties(IMarkupWriter writer)
{
_even = true;
@@ -112,6 +117,17 @@
public void render(IMarkupWriter writer, IRequestCycle cycle)
{
renderSystemProperties(writer);
+ }
+ };
+ }
+
+ public IRender getReportStatusRenderer()
+ {
+ return new IRender()
+ {
+ public void render(IMarkupWriter writer, IRequestCycle cycle)
+ {
+ getReportStatusHub().fireReportStatus(writer);
}
};
}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/RequestDisplay.jwc
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/RequestDisplay.jwc?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/RequestDisplay.jwc (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/html/RequestDisplay.jwc Wed Nov 9 07:42:50 2005
@@ -30,5 +30,6 @@
<inject property="request" object="service:tapestry.globals.WebRequest"/>
<inject property="context" object="service:tapestry.globals.WebContext"/>
<inject property="activator" object="service-property:tapestry.globals.ApplicationGlobals:activator"/>
-
+ <inject property="reportStatusHub" object="service:tapestry.describe.ReportStatusHub"/>
+
</component-specification>
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pageload/PageSource.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pageload/PageSource.java?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pageload/PageSource.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pageload/PageSource.java Wed Nov 9 07:42:50 2005
@@ -36,8 +36,7 @@
* the pool using {@link #releasePage(IPage)}.
* <p>
* TBD: Pooled pages stay forever. Need a strategy for cleaning up the pool, tracking which pages
- * have been in the pool the longest, etc. A mechanism for reporting pool statistics would be
- * useful.
+ * have been in the pool the longest, etc.
*
* @author Howard Lewis Ship
*/
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pages/Exception.css
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pages/Exception.css?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pages/Exception.css (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/pages/Exception.css Wed Nov 9 07:42:50 2005
@@ -128,6 +128,7 @@
{
border: 1px solid black;
width: 100%;
+ margin-bottom: 15px;
}
TABLE.described-object TR.section TH
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ComponentConstructorFactoryImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ComponentConstructorFactoryImpl.java?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ComponentConstructorFactoryImpl.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ComponentConstructorFactoryImpl.java Wed Nov 9 07:42:50 2005
@@ -25,6 +25,8 @@
import org.apache.tapestry.enhance.EnhancedClassValidator;
import org.apache.tapestry.enhance.EnhancementOperationImpl;
import org.apache.tapestry.enhance.EnhancementWorker;
+import org.apache.tapestry.event.ReportStatusEvent;
+import org.apache.tapestry.event.ReportStatusListener;
import org.apache.tapestry.event.ResetEventListener;
import org.apache.tapestry.services.ComponentConstructor;
import org.apache.tapestry.services.ComponentConstructorFactory;
@@ -38,8 +40,10 @@
* @since 4.0
*/
public class ComponentConstructorFactoryImpl implements ComponentConstructorFactory,
- ResetEventListener
+ ResetEventListener, ReportStatusListener
{
+ private String _serviceId;
+
private Log _log;
private ClassFactory _classFactory;
@@ -51,7 +55,7 @@
private EnhancementWorker _chain;
/**
- * Map of {@link org.apache.tapestry.services.ComponentConstructor}keyed on
+ * Map of {@link org.apache.tapestry.services.ComponentConstructor} keyed on
* {@link org.apache.tapestry.spec.IComponentSpecification}.
*/
@@ -62,6 +66,14 @@
_cachedConstructors.clear();
}
+ public synchronized void reportStatus(ReportStatusEvent event)
+ {
+ event.title(_serviceId);
+
+ event.property("enhanced class count", _cachedConstructors.size());
+ event.collection("enhanced classes", _cachedConstructors.keySet());
+ }
+
public ComponentConstructor getComponentConstructor(IComponentSpecification specification,
String className)
{
@@ -120,5 +132,10 @@
public void setLog(Log log)
{
_log = log;
+ }
+
+ public void setServiceId(String serviceId)
+ {
+ _serviceId = serviceId;
}
}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ExpressionCacheImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ExpressionCacheImpl.java?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ExpressionCacheImpl.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ExpressionCacheImpl.java Wed Nov 9 07:42:50 2005
@@ -20,6 +20,8 @@
import ognl.Ognl;
import org.apache.hivemind.ApplicationRuntimeException;
+import org.apache.tapestry.event.ReportStatusEvent;
+import org.apache.tapestry.event.ReportStatusListener;
import org.apache.tapestry.event.ResetEventListener;
import org.apache.tapestry.services.ExpressionCache;
@@ -27,14 +29,25 @@
* @author Howard M. Lewis Ship
* @since 4.0
*/
-public class ExpressionCacheImpl implements ExpressionCache, ResetEventListener
+public class ExpressionCacheImpl implements ExpressionCache, ResetEventListener,
+ ReportStatusListener
{
+ private String _serviceId;
+
+ private Map _cache = new HashMap();
+
public synchronized void resetEventDidOccur()
{
_cache.clear();
}
- private Map _cache = new HashMap();
+ public void reportStatus(ReportStatusEvent event)
+ {
+ event.title(_serviceId);
+
+ event.property("cached expression count", _cache.size());
+ event.collection("cached expressions", _cache.keySet());
+ }
public synchronized Object getCompiledExpression(String expression)
{
@@ -61,6 +74,11 @@
expression,
ex), ex);
}
+ }
+
+ public void setServiceId(String serviceId)
+ {
+ _serviceId = serviceId;
}
}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ObjectPoolImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ObjectPoolImpl.java?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ObjectPoolImpl.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/ObjectPoolImpl.java Wed Nov 9 07:42:50 2005
@@ -15,26 +15,31 @@
package org.apache.tapestry.services.impl;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import org.apache.tapestry.event.ReportStatusEvent;
+import org.apache.tapestry.event.ReportStatusListener;
import org.apache.tapestry.event.ResetEventListener;
import org.apache.tapestry.services.ObjectPool;
/**
* Implementation of the {@link org.apache.tapestry.services.ObjectPool} interface.
- *
* <p>
- * This ia a minimal implementation, one that has no concept of automatically removing
- * unused pooled objects. Eventually, it will also register for notifications about
- * general cache cleaning.
- *
+ * This ia a minimal implementation, one that has no concept of automatically removing unused pooled
+ * objects. Eventually, it will also register for notifications about general cache cleaning.
+ *
* @author Howard Lewis Ship
* @since 4.0
*/
-public class ObjectPoolImpl implements ObjectPool, ResetEventListener
+public class ObjectPoolImpl implements ObjectPool, ResetEventListener, ReportStatusListener
{
+ private String _serviceId;
+
+ private int _count = 0;
+
/**
* Pool of Lists (of pooled objects), keyed on arbitrary key.
*/
@@ -47,6 +52,8 @@
if (pooled == null || pooled.isEmpty())
return null;
+ _count--;
+
return pooled.remove(0);
}
@@ -61,11 +68,42 @@
}
pooled.add(value);
+
+ _count++;
}
public synchronized void resetEventDidOccur()
{
_pool.clear();
+
+ _count = 0;
+ }
+
+ public synchronized void reportStatus(ReportStatusEvent event)
+ {
+ event.title(_serviceId);
+
+ event.property("total count", _count);
+
+ event.section("Count by Key");
+
+ Iterator i = _pool.entrySet().iterator();
+
+ while (i.hasNext())
+ {
+ Map.Entry entry = (Map.Entry) i.next();
+
+ String key = entry.getKey().toString();
+
+ List pooled = (List) entry.getValue();
+
+ event.property(key, pooled.size());
+ }
+ }
+
+ public void setServiceId(String serviceId)
+ {
+ _serviceId = serviceId;
}
}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/SpecificationSourceImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/SpecificationSourceImpl.java?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/SpecificationSourceImpl.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/SpecificationSourceImpl.java Wed Nov 9 07:42:50 2005
@@ -25,6 +25,8 @@
import org.apache.tapestry.asset.AssetSource;
import org.apache.tapestry.engine.ISpecificationSource;
import org.apache.tapestry.engine.Namespace;
+import org.apache.tapestry.event.ReportStatusEvent;
+import org.apache.tapestry.event.ReportStatusListener;
import org.apache.tapestry.event.ResetEventListener;
import org.apache.tapestry.parse.ISpecificationParser;
import org.apache.tapestry.services.NamespaceResources;
@@ -38,12 +40,12 @@
* Default implementation of {@link ISpecificationSource} that expects to use the normal class
* loader to locate component specifications from within the classpath.
* <p>
- * Caches specifications in memory forever, or until {@link #resetDidOccur()()} is invoked.
+ * Caches specifications in memory forever, or until {@link #resetDidOccur()} is invoked.
*
* @author Howard Lewis Ship
*/
-
-public class SpecificationSourceImpl implements ISpecificationSource, ResetEventListener
+public class SpecificationSourceImpl implements ISpecificationSource, ResetEventListener,
+ ReportStatusListener
{
private ClassResolver _classResolver;
@@ -59,6 +61,8 @@
private AssetSource _assetSource;
+ private String _serviceId;
+
/**
* Contains previously parsed component specifications.
*/
@@ -88,6 +92,16 @@
private Map _namespaceCache = new HashMap();
+ public void reportStatus(ReportStatusEvent event)
+ {
+ event.title(_serviceId);
+
+ event.property("page specification count", _pageCache.size());
+ event.collection("page specifications", _pageCache.keySet());
+ event.property("component specification count", _componentCache.size());
+ event.collection("component specifications", _componentCache.keySet());
+ }
+
public void initializeService()
{
_namespaceResources = new NamespaceResourcesImpl(this, _assetSource);
@@ -236,4 +250,10 @@
{
_assetSource = assetSource;
}
+
+ public void setServiceId(String serviceId)
+ {
+ _serviceId = serviceId;
+ }
+
}
Modified: jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/TemplateSourceImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/TemplateSourceImpl.java?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/TemplateSourceImpl.java (original)
+++ jakarta/tapestry/trunk/framework/src/java/org/apache/tapestry/services/impl/TemplateSourceImpl.java Wed Nov 9 07:42:50 2005
@@ -21,6 +21,7 @@
import java.net.URL;
import java.util.Collections;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
@@ -33,12 +34,16 @@
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.Tapestry;
import org.apache.tapestry.engine.ITemplateSourceDelegate;
+import org.apache.tapestry.event.ReportStatusEvent;
+import org.apache.tapestry.event.ReportStatusListener;
import org.apache.tapestry.event.ResetEventListener;
import org.apache.tapestry.parse.ComponentTemplate;
import org.apache.tapestry.parse.ITemplateParser;
import org.apache.tapestry.parse.ITemplateParserDelegate;
import org.apache.tapestry.parse.TemplateParseException;
import org.apache.tapestry.parse.TemplateToken;
+import org.apache.tapestry.parse.TextToken;
+import org.apache.tapestry.parse.TokenType;
import org.apache.tapestry.resolver.ComponentSpecificationResolver;
import org.apache.tapestry.services.ComponentPropertySource;
import org.apache.tapestry.services.TemplateSource;
@@ -52,8 +57,10 @@
* @author Howard Lewis Ship
*/
-public class TemplateSourceImpl implements TemplateSource, ResetEventListener
+public class TemplateSourceImpl implements TemplateSource, ResetEventListener, ReportStatusListener
{
+ private String _serviceId;
+
private Log _log;
// The name of the component/application/etc property that will be used to
@@ -102,6 +109,59 @@
_templates.clear();
}
+ public void reportStatus(ReportStatusEvent event)
+ {
+ event.title(_serviceId);
+
+ int templateCount = 0;
+ int tokenCount = 0;
+ int characterCount = 0;
+
+ Iterator i = _templates.values().iterator();
+
+ while (i.hasNext())
+ {
+ ComponentTemplate template = (ComponentTemplate) i.next();
+
+ templateCount++;
+
+ int count = template.getTokenCount();
+
+ tokenCount += count;
+
+ for (int j = 0; j < count; j++)
+ {
+ TemplateToken token = template.getToken(j);
+
+ if (token.getType() == TokenType.TEXT)
+ {
+ TextToken tt = (TextToken) token;
+
+ characterCount += tt.getLength();
+ }
+ }
+ }
+
+ event.property("parsed templates", templateCount);
+ event.property("total template tokens", tokenCount);
+ event.property("total template characters", characterCount);
+
+ event.section("Parsed template token counts");
+
+ i = _templates.entrySet().iterator();
+
+ while (i.hasNext())
+ {
+ Map.Entry entry = (Map.Entry) i.next();
+
+ String key = entry.getKey().toString();
+
+ ComponentTemplate template = (ComponentTemplate) entry.getValue();
+
+ event.property(key, template.getTokenCount());
+ }
+ }
+
/**
* Reads the template for the component.
*/
@@ -497,5 +557,11 @@
public void setComponentPropertySource(ComponentPropertySource componentPropertySource)
{
_componentPropertySource = componentPropertySource;
+ }
+
+ /** @since 4.0 */
+ public void setServiceId(String serviceId)
+ {
+ _serviceId = serviceId;
}
}
Copied: jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/HTMLDescriptionReceiverTest.java (from r329587, jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/TestHTMLDescriptionReceiver.java)
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/HTMLDescriptionReceiverTest.java?p2=jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/HTMLDescriptionReceiverTest.java&p1=jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/TestHTMLDescriptionReceiver.java&r1=329587&r2=332071&rev=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/TestHTMLDescriptionReceiver.java (original)
+++ jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/HTMLDescriptionReceiverTest.java Wed Nov 9 07:42:50 2005
@@ -21,6 +21,8 @@
import org.apache.hivemind.Registry;
import org.apache.hivemind.impl.RegistryBuilder;
import org.apache.tapestry.IMarkupWriter;
+import org.apache.tapestry.services.ApplicationGlobals;
+import org.apache.tapestry.services.Infrastructure;
/**
* Tests for {@link org.apache.tapestry.describe.HTMLDescriptionReceiver}and
@@ -29,21 +31,13 @@
* @author Howard M. Lewis Ship
* @since 4.0
*/
-public class TestHTMLDescriptionReceiver extends BaseDescribeTestCase
+public class HTMLDescriptionReceiverTest extends BaseDescribeTestCase
{
protected DescribableStrategy newStrategy()
{
return (DescribableStrategy) newMock(DescribableStrategy.class);
}
- public static class NoOpStrategy implements DescribableStrategy
- {
- public void describeObject(Object object, DescriptionReceiver receiver)
- {
- // Does nothing; sufficient for the tests.
- }
- }
-
private void trainForTitle(IMarkupWriter writer, String title)
{
writer.begin("div");
@@ -381,7 +375,7 @@
replayControls();
- HTMLDescriptionReceiver dr = new HTMLDescriptionReceiver(writer, strategy);
+ RootDescriptionReciever dr = new HTMLDescriptionReceiver(writer, strategy);
dr.describe(null);
@@ -412,6 +406,10 @@
IMarkupWriter writer = newWriter();
DescribableStrategy strategy = new NoOpStrategy();
+ RootDescriptionReceiverFactory factory = newReceiverFactory();
+
+ trainGetReciever(factory, writer, new HTMLDescriptionReceiver(writer, strategy));
+
String object = "Tapestry";
writer.print("Tapestry");
@@ -420,13 +418,26 @@
replayControls();
HTMLDescriberImpl d = new HTMLDescriberImpl();
- d.setStrategy(strategy);
+ d.setReceiverFactory(factory);
d.describeObject(object, writer);
verifyControls();
}
+ protected void trainGetReciever(RootDescriptionReceiverFactory factory, IMarkupWriter writer,
+ RootDescriptionReciever receiver)
+ {
+ factory.newRootDescriptionReceiver(writer);
+ setReturnValue(factory, receiver);
+
+ }
+
+ protected RootDescriptionReceiverFactory newReceiverFactory()
+ {
+ return (RootDescriptionReceiverFactory) newMock(RootDescriptionReceiverFactory.class);
+ }
+
public void testDescribeAlternate()
{
IMarkupWriter writer = newWriter();
@@ -441,42 +452,6 @@
replayControls();
dr.describeAlternate(alternate);
-
- verifyControls();
- }
-
- public void testIntegration() throws Exception
- {
- IMarkupWriter writer = newWriter();
-
- Registry r = RegistryBuilder.constructDefaultRegistry();
- // The Portlet code, which may be in the classpath under Eclipse, adds a second
- // implementation.
- HTMLDescriber d = (HTMLDescriber) r.getService(
- "tapestry.describe.HTMLDescriber",
- HTMLDescriber.class);
-
- writer.print("Tapestry");
- writer.println();
-
- replayControls();
-
- d.describeObject("Tapestry", writer);
-
- verifyControls();
-
- writer.print("Anonymous Describable");
- writer.println();
-
- replayControls();
-
- d.describeObject(new Describable()
- {
- public void describeTo(DescriptionReceiver receiver)
- {
- receiver.title("Anonymous Describable");
- }
- }, writer);
verifyControls();
}
Added: jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/NoOpStrategy.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/NoOpStrategy.java?rev=332071&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/NoOpStrategy.java (added)
+++ jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/NoOpStrategy.java Wed Nov 9 07:42:50 2005
@@ -0,0 +1,26 @@
+// Copyright 2005 The Apache Software Foundation
+//
+// Licensed 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.tapestry.describe;
+
+public class NoOpStrategy implements DescribableStrategy
+{
+ public void describeObject(Object object, DescriptionReceiver receiver)
+ {
+ // Does nothing; sufficient for the tests.
+ }
+}
\ No newline at end of file
Added: jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/ReportStatusHubTest.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/ReportStatusHubTest.java?rev=332071&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/ReportStatusHubTest.java (added)
+++ jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/describe/ReportStatusHubTest.java Wed Nov 9 07:42:50 2005
@@ -0,0 +1,104 @@
+// Copyright 2005 The Apache Software Foundation
+//
+// Licensed 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.tapestry.describe;
+
+import org.apache.tapestry.IMarkupWriter;
+import org.apache.tapestry.event.ReportStatusEvent;
+import org.apache.tapestry.event.ReportStatusListener;
+
+/**
+ * Tests for {@link org.apache.tapestry.describe.ReportStatusHubImpl}.
+ *
+ * @author Howard M. Lewis Ship
+ * @since 4.0
+ */
+public class ReportStatusHubTest extends BaseDescribeTestCase
+{
+ public RootDescriptionReceiverFactory newReceiverFactory(IMarkupWriter writer,
+ RootDescriptionReciever receiver)
+ {
+ RootDescriptionReceiverFactory factory = newReceiverFactory();
+
+ factory.newRootDescriptionReceiver(writer);
+
+ setReturnValue(factory, receiver);
+
+ return factory;
+ }
+
+ protected RootDescriptionReceiverFactory newReceiverFactory()
+ {
+ return (RootDescriptionReceiverFactory) newMock(RootDescriptionReceiverFactory.class);
+ }
+
+ public static class ListenerFixture implements ReportStatusListener
+ {
+
+ public void reportStatus(ReportStatusEvent event)
+ {
+ event.title("Listener Invoked");
+ }
+
+ }
+
+ public void testAddAndFire()
+ {
+ IMarkupWriter writer = newWriter();
+ RootDescriptionReciever receiver = newRootReceiver();
+ RootDescriptionReceiverFactory factory = newReceiverFactory(writer, receiver);
+
+ receiver.title("Listener Invoked");
+
+ receiver.finishUp();
+
+ replayControls();
+
+ ReportStatusHubImpl hub = new ReportStatusHubImpl();
+
+ hub.setReceiverFactory(factory);
+
+ hub.addReportStatusListener(new ListenerFixture());
+
+ hub.fireReportStatus(writer);
+
+ verifyControls();
+ }
+
+ public void testRemove()
+ {
+ IMarkupWriter writer = newWriter();
+ RootDescriptionReceiverFactory factory = newReceiverFactory();
+
+ replayControls();
+
+ ReportStatusHubImpl hub = new ReportStatusHubImpl();
+
+ hub.setReceiverFactory(factory);
+
+ ListenerFixture listener = new ListenerFixture();
+ hub.addReportStatusListener(listener);
+ hub.removeReportStatusListener(listener);
+
+ hub.fireReportStatus(writer);
+
+ verifyControls();
+
+ }
+
+ protected RootDescriptionReciever newRootReceiver()
+ {
+ return (RootDescriptionReciever) newMock(RootDescriptionReciever.class);
+ }
+}
Added: jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/event/ReportStatusEventTest.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/event/ReportStatusEventTest.java?rev=332071&view=auto
==============================================================================
--- jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/event/ReportStatusEventTest.java (added)
+++ jakarta/tapestry/trunk/framework/src/test/org/apache/tapestry/event/ReportStatusEventTest.java Wed Nov 9 07:42:50 2005
@@ -0,0 +1,91 @@
+// Copyright 2005 The Apache Software Foundation
+//
+// Licensed 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.tapestry.event;
+
+import org.apache.hivemind.test.HiveMindTestCase;
+import org.apache.tapestry.describe.DescriptionReceiver;
+
+/**
+ * Tests for {@link org.apache.tapestry.event.ReportStatusEvent}.
+ *
+ * @author Howard M. Lewis Ship
+ * @since 4.0
+ */
+public class ReportStatusEventTest extends HiveMindTestCase
+{
+ protected DescriptionReceiver newReceiver()
+ {
+ return (DescriptionReceiver) newMock(DescriptionReceiver.class);
+ }
+
+ public void testConstructor()
+ {
+ DescriptionReceiver receiver = newReceiver();
+
+ replayControls();
+
+ ReportStatusEvent event = new ReportStatusEvent(this, receiver);
+
+ assertSame(this, event.getSource());
+
+ verifyControls();
+ }
+
+ public void testDelegation()
+ {
+ Object[] values = new Object[]
+ { 1, 2, 3 };
+ Object alternate = new Object();
+
+ DescriptionReceiver receiver = newReceiver();
+
+ receiver.array("array", values);
+ receiver.describeAlternate(alternate);
+ receiver.property("boolean-true", true);
+ receiver.property("boolean-false", false);
+ receiver.property("byte", (byte) 37);
+ receiver.property("char", 'z');
+ receiver.property("double", (double) 3.14);
+ receiver.property("float", (float) 9.99);
+ receiver.property("int", -373);
+ receiver.property("long", 373737l);
+ receiver.property("object", this);
+ receiver.property("short", (short) 99);
+ receiver.section("Section");
+ receiver.title("Title");
+
+ replayControls();
+
+ ReportStatusEvent event = new ReportStatusEvent(this, receiver);
+
+ event.array("array", values);
+ event.describeAlternate(alternate);
+ event.property("boolean-true", true);
+ event.property("boolean-false", false);
+ event.property("byte", (byte) 37);
+ event.property("char", 'z');
+ event.property("double", (double) 3.14);
+ event.property("float", (float) 9.99);
+ event.property("int", -373);
+ event.property("long", 373737l);
+ event.property("object", this);
+ event.property("short", (short) 99);
+ event.section("Section");
+ event.title("Title");
+
+ verifyControls();
+
+ }
+}
Modified: jakarta/tapestry/trunk/portlet/src/descriptor/META-INF/hivemodule.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/portlet/src/descriptor/META-INF/hivemodule.xml?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/portlet/src/descriptor/META-INF/hivemodule.xml (original)
+++ jakarta/tapestry/trunk/portlet/src/descriptor/META-INF/hivemodule.xml Wed Nov 9 07:42:50 2005
@@ -220,7 +220,7 @@
<contribution configuration-id="tapestry.Infrastructure">
<property name="linkFactory" mode="portlet" object="service:PortletLinkFactory"/>
- <property name="HTMLDescriber" mode="portlet" object="service:PortletHTMLDescriber"/>
+ <property name="rootDescriptionReceiverFactory " mode="portlet" object="PortletRootDescriptionReceiverFactory "/>
<property name="exceptionPresenter" mode="portlet" object="service:PortletExceptionPresenter"/>
<property name="staleLinkExceptionPresenter" mode="portlet" object="service:PortletStaleLinkExceptionPresenter"/>
<property name="staleSessionExceptionPresenter" mode="portlet" object="service:PortletStaleSessionExceptionPresenter"/>
@@ -231,19 +231,21 @@
<command id="SetupServletApplicationGlobals" object="service:SetupPortletApplicationGlobals"/>
</contribution>
- <service-point id="PortletHTMLDescriber" interface="org.apache.tapestry.describe.HTMLDescriber">
-
- Describes an object in an HTML format.
-
- <invoke-factory>
- <construct class="org.apache.tapestry.describe.HTMLDescriberImpl">
- <set-service property="strategy" service-id="tapestry.describe.DescribableStrategy"/>
+
+ <service-point id="PortletRootDescriptionReceiverFactory" interface="org.apache.tapestry.describe.RootDescriptionReceiverFactory">
+
+ Overrides the standard tapestry.describe.RootDescriptionReceiverFactory to change
+ the CSS styles used.
+
+ <invoke-factory>
+ <construct class="org.apache.tapestry.describe.RootDescriptionReceiverFactory Impl">
+ <set-service property="strategy" service-id="tapestry.describe.DescribableStrategy"/>
<set property="headerClass" value="portlet-section-header"/>
<set property="subheaderClass" value="portlet-section-subheader"/>
<set property="tableClass" value="portlet-section-body"/>
- </construct>
- </invoke-factory>
- </service-point>
+ </construct>
+ </invoke-factory>
+ </service-point>
<service-point id="PortletExceptionPresenter" interface="org.apache.tapestry.error.ExceptionPresenter">
Modified: jakarta/tapestry/trunk/status.xml
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/status.xml?rev=332071&r1=332070&r2=332071&view=diff
==============================================================================
--- jakarta/tapestry/trunk/status.xml (original)
+++ jakarta/tapestry/trunk/status.xml Wed Nov 9 07:42:50 2005
@@ -53,6 +53,7 @@
<release version="4.0-beta-13" date="unreleased">
<action type="update" dev="HLS">Switch to HiveMind 1.1 (final)</action>
<action type="fix" dev="HLS" fixes-bug="TAPESTRT-678">LinkSubmit does not work correctly when the browser's back button is used and the form resubmitted normally</action>
+ <action type="add" dev="HLS" fixes-bug="TAPESTRY-731">Extend RequestDisplay component (used on the Exception page) to also report the internal status of key Tapestry services</action>
</release>
<release version="4.0-beta-12" date="Oct 30 2005">
<action type="fix" dev="HLS" fixes-bug="TAPESTRY-718">Asset injection makes assets appear as null inside finishLoad()</action>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org