You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by jk...@apache.org on 2007/06/22 17:23:04 UTC
svn commit: r549842 - in /tapestry/tapestry4/trunk: ./ src/site/
src/site/apt/developmentguide/ tapestry-framework/src/descriptor/META-INF/
tapestry-framework/src/java/org/apache/tapestry/
tapestry-framework/src/java/org/apache/tapestry/engine/ tapestr...
Author: jkuhnert
Date: Fri Jun 22 08:23:03 2007
New Revision: 549842
URL: http://svn.apache.org/viewvc?view=rev&rev=549842
Log:
TAPESTRY-1151. Implement a page pooling strategy using commons-pool so that old/expired pages can be evicted from memory.
Added:
tapestry/tapestry4/trunk/src/site/apt/developmentguide/performancetuning.apt
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/internal/pageload/
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/internal/pageload/PageKey.java (with props)
Modified:
tapestry/tapestry4/trunk/pom.xml
tapestry/tapestry4/trunk/src/site/site.xml
tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.page.xml
tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.props.xml
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/AbstractPage.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/engine/IPageSource.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/ComponentTypeVisitor.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageLoader.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageSource.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageloadMessages.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageloadStrings.properties
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/EngineFactory.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/ObjectPool.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseBuilder.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseContributorImpl.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ExpressionEvaluatorImpl.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ObjectPoolImpl.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/util/MultiKey.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/util/RegexpMatcher.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/valid/NumberValidator.java
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/junit/mock/TestMockApplications.java
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/DojoAjaxResponseBuilderTest.java
Modified: tapestry/tapestry4/trunk/pom.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/pom.xml?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/pom.xml (original)
+++ tapestry/tapestry4/trunk/pom.xml Fri Jun 22 08:23:03 2007
@@ -423,6 +423,12 @@
<pluginRepository>
<id>codehaus.org</id>
<url>http://repository.codehaus.org</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
</pluginRepository>
</pluginRepositories>
Added: tapestry/tapestry4/trunk/src/site/apt/developmentguide/performancetuning.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/src/site/apt/developmentguide/performancetuning.apt?view=auto&rev=549842
==============================================================================
--- tapestry/tapestry4/trunk/src/site/apt/developmentguide/performancetuning.apt (added)
+++ tapestry/tapestry4/trunk/src/site/apt/developmentguide/performancetuning.apt Fri Jun 22 08:23:03 2007
@@ -0,0 +1,45 @@
+ ------
+Development Guide - Performance Tuning
+ ------
+Jesse Kuhnert
+ ------
+22 Jun 2007
+ ------
+
+Performance Tuning
+
+ There are a number of new options available to help you tune Tapestry's internal configuration to better suite you particular
+ applications scaling requirements. This section will go over what these options are and how to use them.
+
+* Page Pooling
+
+ The internal pooling of Tapestry pages now delegates the majority of actual pooling work to the {{{http://jakarta.apache.org/commons/pool/}commons-pool}}
+ library. This means that your Tapestry application can now actually release idle pages from memory when they are no longer needed and hopefully increase
+ the reliability/resources used of your production applications. All of the key configuration options are available in the HiveMind <<<hivemind.FactoryDefaults>>>
+ configuration point which means that you can control these options via your servlet context parameters/.application file/hivemind/jvm system properties. The current
+ options available are:
+
++-------------------------------------------------------------------------------------------------------------------------
+<contribution configuration-id="hivemind.FactoryDefaults">
+ <default symbol="org.apache.tapestry.page-pool-min-idle" value="1" />
+ <default symbol="org.apache.tapestry.page-pool-max-active" value="-1" />
+ <default symbol="org.apache.tapestry.page-pool-max-idle" value="-1" />
+ <default symbol="org.apache.tapestry.page-pool-evict-thread-sleep-minutes" value="4" />
+ <default symbol="org.apache.tapestry.page-pool-evict-idle-page-minutes" value="40" />
+</contribution>
++-------------------------------------------------------------------------------------------------------------------------
+
+ This configuration is based around using the {{{http://jakarta.apache.org/commons/pool/api-1.3/org/apache/commons/pool/impl/GenericKeyedObjectPool.html}GenericKeyedObjectPool}}
+ implementation in particular. The key used to store each Tapestry page is a combination of the pageName and Locale of the page. The meaning and use of each value is as follows:
+
+ * <<org.apache.tapestry.page-pool-min-idle>> - The minimum number of page instances that must not be evicted for a given key. The default value of 1 means that we want at least
+ one instance of each unique page to be available at any given time.
+
+ * <<org.apache.tapestry.page-pool-max-active>> - The maximum number of total pages that may be active in the pool. The default value of -1 indicates an unlimited number.
+
+ * <<org.apache.tapestry.page-pool-max-idle>> - The maximum number of idle pages that can exist in the pool. The -1 value here also means unlimited. (but doesn't mean they won't be evicted)
+
+ * <<org.apache.tapestry.page-pool-evict-thread-sleep-minutes>> - This pool launches a seperate thread which is responsible for managing and evicted expired pages from the pool
+ when appropriate. This value controls the number of minutes this thread should sleep before checking for expired pages.
+
+ * <<org.apache.tapestry.page-pool-evict-idle-page-minutes>> - The number of minutes that a page must be idle for before being eligable for eviction from the pool.
Modified: tapestry/tapestry4/trunk/src/site/site.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/src/site/site.xml?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/src/site/site.xml (original)
+++ tapestry/tapestry4/trunk/src/site/site.xml Fri Jun 22 08:23:03 2007
@@ -86,6 +86,8 @@
<item name="HiveMind Services" href="/developmentguide/hivemind/index.html" >
<item name="Rounded Corners" href="/developmentguide/hivemind/roundedcorners.html" />
</item>
+
+ <item name="Performance Tuning" href="/developmentguide/performancetuning.html" />
</item>
<item name="XHR/DHTML Guide" href="/ajax/index.html" collapse="true">
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.page.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.page.xml?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.page.xml (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.page.xml Fri Jun 22 08:23:03 2007
@@ -22,15 +22,25 @@
<service-point id="PageSource" interface="org.apache.tapestry.engine.IPageSource">
<invoke-factory>
- <construct class="PageSource">
- <set-service property="pool" service-id="PagePool"/>
+ <construct class="PageSource" initialize-method="initializeService">
<set-service property="pageSpecificationResolver" service-id="PageSpecificationResolver"/>
<set-service property="loader" service-id="PageLoader"/>
+ <set-service property="propertySource" service-id="tapestry.props.ApplicationPropertySource" />
+ <event-listener service-id="tapestry.ResetEventHub"/>
+ <event-listener service-id="tapestry.describe.ReportStatusHub"/>
</construct>
</invoke-factory>
</service-point>
+ <contribution configuration-id="hivemind.FactoryDefaults">
+ <default symbol="org.apache.tapestry.page-pool-min-idle" value="1" />
+ <default symbol="org.apache.tapestry.page-pool-max-active" value="-1" />
+ <default symbol="org.apache.tapestry.page-pool-max-idle" value="-1" />
+ <default symbol="org.apache.tapestry.page-pool-evict-thread-sleep-minutes" value="4" />
+ <default symbol="org.apache.tapestry.page-pool-evict-idle-page-minutes" value="40" />
+ </contribution>
+
<service-point id="PageLoader" interface="org.apache.tapestry.engine.IPageLoader">
<invoke-factory model="pooled">
@@ -46,6 +56,7 @@
<set-object property="componentPropertySource" value="infrastructure:componentPropertySource"/>
<set-service property="threadLocale" service-id="hivemind.ThreadLocale"/>
<set-service property="eventConnectionVisitor" service-id="EventConnectionVisitor" />
+ <set-service property="componentTypeVisitor" service-id="ComponentTypeVisitor" />
</construct>
</invoke-factory>
</service-point>
@@ -76,13 +87,15 @@
</service-point>
- <service-point id="PagePool" interface="org.apache.tapestry.services.ObjectPool">
- <invoke-factory>
- <construct class="org.apache.tapestry.services.impl.ObjectPoolImpl">
- <event-listener service-id="tapestry.ResetEventHub"/>
- <event-listener service-id="tapestry.describe.ReportStatusHub"/>
- </construct>
+ <service-point id="ComponentTypeVisitor" interface="IComponentVisitor">
+
+ Visits all components in the tree and inspects them for IWidget / or IForm instances
+ so that the appropriate javascript libraries are included automatically.
+
+ <invoke-factory model="pooled">
+ <construct class="ComponentTypeVisitor" />
</invoke-factory>
+
</service-point>
<service-point id="PageSpecificationResolver" interface="org.apache.tapestry.resolver.PageSpecificationResolver">
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.props.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.props.xml?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.props.xml (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/descriptor/META-INF/tapestry.props.xml Fri Jun 22 08:23:03 2007
@@ -16,195 +16,194 @@
-->
<module id="tapestry.props" version="4.0.0" package="org.apache.tapestry.engine">
-
- Defines services for locating configuration data that may be stored in the web application
- deployment descriptor, the application specification, or elsewhere.
-
-
- <configuration-point id="GlobalPropertySources" schema-id="hivemind.lib.ChainContribution">
-
- Specifies a sequence of property sources used to resolve global application configuration data, which may
- be in web.xml (servlet init parameters or servlet
- context init parameters), or provided as HiveMind substitution symbol.
-
- </configuration-point>
-
- <service-point id="GlobalPropertySource" interface="IPropertySource">
-
- Service point for obtaining configuration data resolved using GlobalPropertySources
- configuration point.
-
- <invoke-factory service-id="hivemind.lib.ChainFactory">
- <construct configuration-id="GlobalPropertySources"/>
- </invoke-factory>
-
- </service-point>
-
- <service-point id="WebActivatorPropertySource" interface="IPropertySource">
-
- Searches for properties in the web activator's (i.e. HttpServlet's) configuration.
-
- <invoke-factory>
- <construct class="org.apache.tapestry.services.impl.InitializationParameterHolderPropertySource">
- <set-object property="holder" value="service-property:tapestry.globals.ApplicationGlobals:activator"/>
- </construct>
- </invoke-factory>
- </service-point>
-
- <service-point id="WebContextPropertySource" interface="IPropertySource">
-
- Searches the WebContext (i.e., ServletContext) for properties.
-
- <invoke-factory>
- <construct class="org.apache.tapestry.services.impl.InitializationParameterHolderPropertySource">
- <set-service property="holder" service-id="tapestry.globals.WebContext"/>
- </construct>
- </invoke-factory>
- </service-point>
-
- <service-point id="SymbolSourcesPropertySource" interface="IPropertySource">
-
- Bridges into HiveMind's symbol sources to resolve configuration properties.
-
- <!-- This is tricky, we need to use a custom builder factory. -->
-
- <invoke-factory service-id="SymbolSourcesPropertySourceFactory"/>
-
- </service-point>
-
- <service-point id="SymbolSourcesPropertySourceFactory" interface="org.apache.hivemind.ServiceImplementationFactory"
- parameters-occurs="none" visibility="private">
-
- A special-purpose ServiceImplementationFactory used just to create the SymbolSourcesPropertySource service.
-
- <create-instance class="org.apache.tapestry.services.impl.SymbolSourcesPropertySourceFactory"/>
- </service-point>
-
- <contribution configuration-id="GlobalPropertySources">
- <command id="activator" object="service:WebActivatorPropertySource"/>
- <command id="context" object="service:WebContextPropertySource" after="activator"/>
- <command id="symbols" object="service:SymbolSourcesPropertySource" after="context"/>
- </contribution>
-
-
- <service-point id="ComponentPropertySource" interface="org.apache.tapestry.services.ComponentPropertySource">
-
- Provides access to component meta-data, with a search path that includes the component's namespace,
- and the GlobalPropertySource.
-
- <invoke-factory>
- <construct class="org.apache.tapestry.services.impl.ComponentPropertySourceImpl">
- <set-service property="chainBuilder" service-id="hivemind.lib.ChainBuilder"/>
- <set-service property="globalProperties" service-id="GlobalPropertySource"/>
- <event-listener service-id="tapestry.ResetEventHub"/>
- </construct>
-
- </invoke-factory>
- </service-point>
-
- <configuration-point id="ApplicationPropertySources" schema-id="hivemind.lib.ChainContribution">
-
- Property sources used by the application, which includes a search of the
- application specification, a delegate of the application specification, the servlet and
- servlet context, and JVM System Properties.
-
- </configuration-point>
-
- <service-point id="ApplicationPropertySource" interface="IPropertySource">
-
- Service point for obtaining configuration data resolved using ApplicationPropertySources
- configuration point.
-
- <invoke-factory service-id="hivemind.lib.ChainFactory">
- <construct configuration-id="ApplicationPropertySources"/>
- </invoke-factory>
-
- </service-point>
-
- <contribution configuration-id="ApplicationPropertySources">
- <command id="app-spec" object="service:ApplicationSpecificationPropertySource"/>
- <command id="activator" object="service:WebActivatorPropertySource" after="app-spec"/>
- <command id="context" object="service:WebContextPropertySource" after="activator"/>
- <command id="delegate" object="service:DelegatePropertySource" after="context"/>
- <command id="symbols" object="service:SymbolSourcesPropertySource" after="delegate"/>
- </contribution>
-
- <service-point id="ApplicationSpecificationPropertySource" interface="IPropertySource">
-
- Obtains property values from application specification meta-data.
-
- <invoke-factory>
- <construct class="org.apache.tapestry.util.PropertyHolderPropertySource">
- <object>infrastructure:applicationSpecification</object>
- </construct>
- </invoke-factory>
-
- </service-point>
-
- <service-point id="DelegatePropertySource" interface="IPropertySource">
-
- Property source provided as an application extension: org.apache.tapestry.property-source.
-
- <invoke-factory service-id="tapestry.ExtensionLookupFactory">
- <lookup extension-name="org.apache.tapestry.property-source"/>
- </invoke-factory>
-
- </service-point>
-
- <service-point id="GlobalPropertyObjectProvider" interface="org.apache.hivemind.service.ObjectProvider">
-
- An object provider based on obtaining global properties from the GlobalPropertySource
- service.
-
- <invoke-factory>
- <construct class="org.apache.tapestry.services.impl.PropertyObjectProvider">
- <set-service property="source" service-id="GlobalPropertySource"/>
- </construct>
- </invoke-factory>
-
- </service-point>
-
- <service-point id="ApplicationPropertyObjectProvider" interface="org.apache.hivemind.service.ObjectProvider">
-
- An object provider based on obtained properties from the ApplicationPropertySource service.
-
- <invoke-factory>
- <construct class="org.apache.tapestry.services.impl.PropertyObjectProvider">
- <set-service property="source" service-id="ApplicationPropertySource"/>
- </construct>
- </invoke-factory>
-
- </service-point>
-
- <contribution configuration-id="hivemind.ObjectProviders">
- <provider prefix="global-property" service-id="GlobalPropertyObjectProvider"/>
- <provider prefix="app-property" service-id="ApplicationPropertyObjectProvider"/>
- </contribution>
-
- <contribution configuration-id="hivemind.FactoryDefaults">
- <default symbol="org.apache.tapestry.engine-class" value="org.apache.tapestry.engine.BaseEngine"/>
- <default symbol="org.apache.tapestry.visit-class" value="java.util.HashMap"/>
- <default symbol="org.apache.tapestry.output-encoding" value="UTF-8"/>
- <default symbol="org.apache.tapestry.enhance.disable-abstract-method-validation" value="false"/>
- <default symbol="org.apache.tapestry.default-page-class" value="org.apache.tapestry.html.BasePage"/>
- <default symbol="org.apache.tapestry.template-extension" value="html"/>
- <default symbol="org.apache.tapestry.jwcid-attribute-name" value="jwcid"/>
- <default symbol="org.apache.tapestry.default-binding-prefix" value="ognl"/>
- <default symbol="org.apache.tapestry.renderTags" value="true" />
- </contribution>
-
- <!-- This may need to be converted into an IPropertySource and injected into the ApplicationPropertySources
- chain. -->
-
- <contribution configuration-id="hivemind.SymbolSources">
- <source name="SystemProperties" before="hivemind.ApplicationDefaults"
- class="org.apache.hivemind.impl.SystemPropertiesSymbolSource"/>
- </contribution>
-
- <contribution configuration-id="tapestry.Infrastructure">
- <property name="applicationPropertySource" object="service:ApplicationPropertySource"/>
- <property name="globalPropertySource" object="service:GlobalPropertySource"/>
- <property name="componentPropertySource" object="service:ComponentPropertySource"/>
- </contribution>
-
+
+ Defines services for locating configuration data that may be stored in the web application
+ deployment descriptor, the application specification, or elsewhere.
+
+
+ <configuration-point id="GlobalPropertySources" schema-id="hivemind.lib.ChainContribution">
+
+ Specifies a sequence of property sources used to resolve global application configuration data, which may
+ be in web.xml (servlet init parameters or servlet
+ context init parameters), or provided as HiveMind substitution symbol.
+
+ </configuration-point>
+
+ <service-point id="GlobalPropertySource" interface="IPropertySource">
+
+ Service point for obtaining configuration data resolved using GlobalPropertySources
+ configuration point.
+
+ <invoke-factory service-id="hivemind.lib.ChainFactory">
+ <construct configuration-id="GlobalPropertySources"/>
+ </invoke-factory>
+
+ </service-point>
+
+ <service-point id="WebActivatorPropertySource" interface="IPropertySource">
+
+ Searches for properties in the web activator's (i.e. HttpServlet's) configuration.
+
+ <invoke-factory>
+ <construct class="org.apache.tapestry.services.impl.InitializationParameterHolderPropertySource">
+ <set-object property="holder" value="service-property:tapestry.globals.ApplicationGlobals:activator"/>
+ </construct>
+ </invoke-factory>
+ </service-point>
+
+ <service-point id="WebContextPropertySource" interface="IPropertySource">
+
+ Searches the WebContext (i.e., ServletContext) for properties.
+
+ <invoke-factory>
+ <construct class="org.apache.tapestry.services.impl.InitializationParameterHolderPropertySource">
+ <set-service property="holder" service-id="tapestry.globals.WebContext"/>
+ </construct>
+ </invoke-factory>
+ </service-point>
+
+ <service-point id="SymbolSourcesPropertySource" interface="IPropertySource">
+
+ Bridges into HiveMind's symbol sources to resolve configuration properties.
+
+ <!-- This is tricky, we need to use a custom builder factory. -->
+
+ <invoke-factory service-id="SymbolSourcesPropertySourceFactory"/>
+
+ </service-point>
+
+ <service-point id="SymbolSourcesPropertySourceFactory" interface="org.apache.hivemind.ServiceImplementationFactory"
+ parameters-occurs="none" visibility="private">
+
+ A special-purpose ServiceImplementationFactory used just to create the SymbolSourcesPropertySource service.
+
+ <create-instance class="org.apache.tapestry.services.impl.SymbolSourcesPropertySourceFactory"/>
+ </service-point>
+
+ <contribution configuration-id="GlobalPropertySources">
+ <command id="activator" object="service:WebActivatorPropertySource"/>
+ <command id="context" object="service:WebContextPropertySource" after="activator"/>
+ <command id="symbols" object="service:SymbolSourcesPropertySource" after="context"/>
+ </contribution>
+
+
+ <service-point id="ComponentPropertySource" interface="org.apache.tapestry.services.ComponentPropertySource">
+
+ Provides access to component meta-data, with a search path that includes the component's namespace,
+ and the GlobalPropertySource.
+
+ <invoke-factory>
+ <construct class="org.apache.tapestry.services.impl.ComponentPropertySourceImpl">
+ <set-service property="chainBuilder" service-id="hivemind.lib.ChainBuilder"/>
+ <set-service property="globalProperties" service-id="GlobalPropertySource"/>
+ <event-listener service-id="tapestry.ResetEventHub"/>
+ </construct>
+
+ </invoke-factory>
+ </service-point>
+
+ <configuration-point id="ApplicationPropertySources" schema-id="hivemind.lib.ChainContribution">
+
+ Property sources used by the application, which includes a search of the
+ application specification, a delegate of the application specification, the servlet and
+ servlet context, and JVM System Properties.
+
+ </configuration-point>
+
+ <service-point id="ApplicationPropertySource" interface="IPropertySource">
+
+ Service point for obtaining configuration data resolved using ApplicationPropertySources
+ configuration point.
+
+ <invoke-factory service-id="hivemind.lib.ChainFactory">
+ <construct configuration-id="ApplicationPropertySources"/>
+ </invoke-factory>
+
+ </service-point>
+
+ <contribution configuration-id="ApplicationPropertySources">
+ <command id="app-spec" object="service:ApplicationSpecificationPropertySource"/>
+ <command id="activator" object="service:WebActivatorPropertySource" after="app-spec"/>
+ <command id="context" object="service:WebContextPropertySource" after="activator"/>
+ <command id="delegate" object="service:DelegatePropertySource" after="context"/>
+ <command id="symbols" object="service:SymbolSourcesPropertySource" after="delegate"/>
+ </contribution>
+
+ <service-point id="ApplicationSpecificationPropertySource" interface="IPropertySource">
+
+ Obtains property values from application specification meta-data.
+
+ <invoke-factory>
+ <construct class="org.apache.tapestry.util.PropertyHolderPropertySource">
+ <object>infrastructure:applicationSpecification</object>
+ </construct>
+ </invoke-factory>
+
+ </service-point>
+
+ <service-point id="DelegatePropertySource" interface="IPropertySource">
+
+ Property source provided as an application extension: org.apache.tapestry.property-source.
+
+ <invoke-factory service-id="tapestry.ExtensionLookupFactory">
+ <lookup extension-name="org.apache.tapestry.property-source"/>
+ </invoke-factory>
+
+ </service-point>
+
+ <service-point id="GlobalPropertyObjectProvider" interface="org.apache.hivemind.service.ObjectProvider">
+
+ An object provider based on obtaining global properties from the GlobalPropertySource
+ service.
+
+ <invoke-factory>
+ <construct class="org.apache.tapestry.services.impl.PropertyObjectProvider">
+ <set-service property="source" service-id="GlobalPropertySource"/>
+ </construct>
+ </invoke-factory>
+
+ </service-point>
+
+ <service-point id="ApplicationPropertyObjectProvider" interface="org.apache.hivemind.service.ObjectProvider">
+
+ An object provider based on obtained properties from the ApplicationPropertySource service.
+
+ <invoke-factory>
+ <construct class="org.apache.tapestry.services.impl.PropertyObjectProvider">
+ <set-service property="source" service-id="ApplicationPropertySource"/>
+ </construct>
+ </invoke-factory>
+
+ </service-point>
+
+ <contribution configuration-id="hivemind.ObjectProviders">
+ <provider prefix="global-property" service-id="GlobalPropertyObjectProvider"/>
+ <provider prefix="app-property" service-id="ApplicationPropertyObjectProvider"/>
+ </contribution>
+
+ <contribution configuration-id="hivemind.FactoryDefaults">
+ <default symbol="org.apache.tapestry.engine-class" value="org.apache.tapestry.engine.BaseEngine"/>
+ <default symbol="org.apache.tapestry.visit-class" value="java.util.HashMap"/>
+ <default symbol="org.apache.tapestry.output-encoding" value="UTF-8"/>
+ <default symbol="org.apache.tapestry.enhance.disable-abstract-method-validation" value="false"/>
+ <default symbol="org.apache.tapestry.default-page-class" value="org.apache.tapestry.html.BasePage"/>
+ <default symbol="org.apache.tapestry.template-extension" value="html"/>
+ <default symbol="org.apache.tapestry.jwcid-attribute-name" value="jwcid"/>
+ <default symbol="org.apache.tapestry.default-binding-prefix" value="ognl"/>
+ <default symbol="org.apache.tapestry.renderTags" value="true" />
+ </contribution>
+
+ <!-- This may need to be converted into an IPropertySource and injected into the ApplicationPropertySources
+ chain. -->
+
+ <contribution configuration-id="hivemind.SymbolSources">
+ <source name="SystemProperties" before="hivemind.ApplicationDefaults" class="org.apache.hivemind.impl.SystemPropertiesSymbolSource"/>
+ </contribution>
+
+ <contribution configuration-id="tapestry.Infrastructure">
+ <property name="applicationPropertySource" object="service:ApplicationPropertySource"/>
+ <property name="globalPropertySource" object="service:GlobalPropertySource"/>
+ <property name="componentPropertySource" object="service:ComponentPropertySource"/>
+ </contribution>
+
</module>
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/AbstractPage.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/AbstractPage.java?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/AbstractPage.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/AbstractPage.java Fri Jun 22 08:23:03 2007
@@ -210,7 +210,7 @@
}
/**
- * Called by the {@link IEngine engine}to attach the page to itself. Does <em>not</em> change
+ * Called by the {@link IEngine engine} to attach the page to itself. Does <em>not</em> change
* the locale, but since a page is selected from the
* {@link org.apache.tapestry.engine.IPageSource} pool based on its locale matching the engine's
* locale, they should match anyway.
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/engine/IPageSource.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/engine/IPageSource.java?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/engine/IPageSource.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/engine/IPageSource.java Fri Jun 22 08:23:03 2007
@@ -40,6 +40,8 @@
* the name of the page. May be qualified with a library id prefix, which may even be
* nested. Unqualified names are searched for extensively in the application
* namespace, and then in the framework namespace.
+ * @return The loaded page.
+ *
* @throws org.apache.tapestry.PageNotFoundException
* if pageName can't be resolved to a page specification (from which a page instance
* can be generated).
@@ -51,14 +53,16 @@
/**
* Invoked after the engine is done with the page (typically, after the response to the client
* has been sent). The page is returned to the pool for later reuse.
+ *
+ * @param page The page to release.
*/
-
void releasePage(IPage page);
/**
- * @since 3.0
+ * Gets the class resolver used to load all pages / page components.
+ *
+ * @return {@link ClassResolver} instance used to load classes.
*/
ClassResolver getClassResolver();
-
}
Added: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/internal/pageload/PageKey.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/internal/pageload/PageKey.java?view=auto&rev=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/internal/pageload/PageKey.java (added)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/internal/pageload/PageKey.java Fri Jun 22 08:23:03 2007
@@ -0,0 +1,64 @@
+package org.apache.tapestry.internal.pageload;
+
+import java.io.Serializable;
+import java.util.Locale;
+
+/**
+ * Alterantive implementation of {@link org.apache.tapestry.util.MultiKey} that is specifically
+ * intended to be used to store and retrieve pages from a pool.
+ *
+ */
+public class PageKey implements Serializable {
+
+ String _pageName;
+ Locale _locale;
+
+ /**
+ * Constructs a new instance for the specified page / locale.
+ * @param pageName
+ * The page.
+ * @param locale
+ * Locale of the page.
+ */
+ public PageKey(String pageName, Locale locale)
+ {
+ _pageName = pageName;
+ _locale = locale;
+ }
+
+ public String getPageName()
+ {
+ return _pageName;
+ }
+
+ public String toString()
+ {
+ return "PageKey[" +
+ "_pageName='" + _pageName + '\'' +
+ '\n' +
+ ", _locale=" + _locale +
+ '\n' +
+ ']';
+ }
+
+ public boolean equals(Object o)
+ {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ PageKey pageKey = (PageKey) o;
+
+ if (_locale != null ? !_locale.equals(pageKey._locale) : pageKey._locale != null) return false;
+ if (_pageName != null ? !_pageName.equals(pageKey._pageName) : pageKey._pageName != null) return false;
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = (_pageName != null ? _pageName.hashCode() : 0);
+ result = 31 * result + (_locale != null ? _locale.hashCode() : 0);
+ return result;
+ }
+}
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/internal/pageload/PageKey.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/internal/pageload/PageKey.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/internal/pageload/PageKey.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/ComponentTypeVisitor.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/ComponentTypeVisitor.java?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/ComponentTypeVisitor.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/ComponentTypeVisitor.java Fri Jun 22 08:23:03 2007
@@ -1,5 +1,6 @@
package org.apache.tapestry.pageload;
+import org.apache.hivemind.PoolManageable;
import org.apache.tapestry.IComponent;
import org.apache.tapestry.IForm;
import org.apache.tapestry.IPage;
@@ -9,7 +10,7 @@
* Looks for components of type {@link org.apache.tapestry.IForm} and {@link org.apache.tapestry.dojo.IWidget} so
* that the appropriate javascript includes can be made on an as needed basis by {@link org.apache.tapestry.dojo.AjaxShellDelegate}.
*/
-public class ComponentTypeVisitor implements IComponentVisitor {
+public class ComponentTypeVisitor implements IComponentVisitor, PoolManageable {
IPage _page;
@@ -27,8 +28,18 @@
}
if (IWidget.class.isInstance(component) && _page != null) {
-
+
_page.setHasWidgets(true);
}
+ }
+
+ public void activateService()
+ {
+ _page = null;
+ }
+
+ public void passivateService()
+ {
+ _page = null;
}
}
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageLoader.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageLoader.java?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageLoader.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageLoader.java Fri Jun 22 08:23:03 2007
@@ -40,12 +40,11 @@
* This implementation is not threadsafe, therefore the pooled service model
* must be used.
* </p>
- *
+ *
* @author Howard Lewis Ship
*/
-public class PageLoader implements IPageLoader
-{
+public class PageLoader implements IPageLoader {
private Log _log;
@@ -71,8 +70,11 @@
private ComponentTreeWalker _verifyRequiredParametersWalker;
private IComponentVisitor _eventConnectionVisitor;
+
private ComponentTreeWalker _eventConnectionWalker;
+ private IComponentVisitor _componentTypeVisitor;
+
/** @since 4.0 */
private ComponentConstructorFactory _componentConstructorFactory;
@@ -159,15 +161,13 @@
IComponentVisitor verifyRequiredParametersVisitor = new VerifyRequiredParametersVisitor();
_verifyRequiredParametersWalker =
- new ComponentTreeWalker( new IComponentVisitor[] { verifyRequiredParametersVisitor });
+ new ComponentTreeWalker( new IComponentVisitor[] { verifyRequiredParametersVisitor });
_establishDefaultParameterValuesWalker =
- new ComponentTreeWalker( new IComponentVisitor[] { _establishDefaultParameterValuesVisitor });
-
- IComponentVisitor componentTypeVisitor = new ComponentTypeVisitor();
+ new ComponentTreeWalker( new IComponentVisitor[] { _establishDefaultParameterValuesVisitor });
_eventConnectionWalker =
- new ComponentTreeWalker( new IComponentVisitor[] { _eventConnectionVisitor, componentTypeVisitor });
+ new ComponentTreeWalker( new IComponentVisitor[] { _eventConnectionVisitor, _componentTypeVisitor });
}
/**
@@ -198,8 +198,7 @@
if (contained.getInheritInformalParameters())
{
if (formalOnly)
- throw new ApplicationRuntimeException(PageloadMessages
- .inheritInformalInvalidComponentFormalOnly(component),
+ throw new ApplicationRuntimeException(PageloadMessages.inheritInformalInvalidComponentFormalOnly(component),
component, contained.getLocation(), null);
IComponentSpecification containerSpec = container.getSpecification();
@@ -311,7 +310,7 @@
component.setBinding(parameterName, binding);
}
- private IBinding convert(IComponent container, String description, IParameterSpecification param,
+ private IBinding convert(IComponent container, String description, IParameterSpecification param,
String defaultBindingType, IBindingSpecification spec)
{
Location location = spec.getLocation();
@@ -354,7 +353,7 @@
_maxDepth = _depth;
beginConstructComponent(container, containerSpec);
-
+
String defaultBindingPrefix = _componentPropertySource.getComponentProperty(container, TapestryConstants.DEFAULT_BINDING_PREFIX_NAME);
List ids = new ArrayList(containerSpec.getComponentIds());
@@ -370,7 +369,7 @@
// container's specification.
IContainedComponent contained = containerSpec.getComponent(id);
-
+
String type = contained.getType();
Location location = contained.getLocation();
@@ -422,7 +421,7 @@
throw new ApplicationRuntimeException(PageloadMessages.unableToInstantiateComponent(container, ex),
container, null, ex);
} finally {
-
+
endConstructComponent(container);
}
@@ -449,11 +448,11 @@
// try to get the more precise container position location that was referenced
// in the template to properly report the precise position of the recursive reference
-
+
IContainedComponent container = component.getContainedComponent();
if (container != null)
location = container.getLocation();
-
+
throw new ApplicationRuntimeException(PageloadMessages.recursiveComponent(component), location, null);
}
@@ -670,8 +669,7 @@
/** @since 4.0 */
- public void loadTemplateForComponent(IRequestCycle cycle,
- ITemplateComponent component)
+ public void loadTemplateForComponent(IRequestCycle cycle, ITemplateComponent component)
{
_componentTemplateLoader.loadTemplate(cycle, component);
}
@@ -739,6 +737,11 @@
public void setEventConnectionVisitor(IComponentVisitor eventConnectionVisitor)
{
_eventConnectionVisitor = eventConnectionVisitor;
+ }
+
+ public void setComponentTypeVisitor(IComponentVisitor visitor)
+ {
+ _componentTypeVisitor = visitor;
}
public void setComponentConstructorFactory(ComponentConstructorFactory componentConstructorFactory)
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageSource.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageSource.java?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageSource.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageSource.java Fri Jun 22 08:23:03 2007
@@ -14,15 +14,23 @@
package org.apache.tapestry.pageload;
+import org.apache.commons.pool.BaseKeyedPoolableObjectFactory;
+import org.apache.commons.pool.impl.GenericKeyedObjectPool;
+import org.apache.hivemind.ApplicationRuntimeException;
import org.apache.hivemind.ClassResolver;
+import org.apache.hivemind.events.RegistryShutdownListener;
import org.apache.tapestry.IEngine;
import org.apache.tapestry.IPage;
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.Tapestry;
import org.apache.tapestry.engine.IPageLoader;
import org.apache.tapestry.engine.IPageSource;
+import org.apache.tapestry.engine.IPropertySource;
+import org.apache.tapestry.event.ReportStatusEvent;
+import org.apache.tapestry.event.ReportStatusListener;
+import org.apache.tapestry.event.ResetEventListener;
+import org.apache.tapestry.internal.pageload.PageKey;
import org.apache.tapestry.resolver.PageSpecificationResolver;
-import org.apache.tapestry.services.ObjectPool;
import org.apache.tapestry.util.MultiKey;
/**
@@ -36,12 +44,12 @@
* <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.
- *
+ *
* @author Howard Lewis Ship
*/
-public class PageSource implements IPageSource
-{
+public class PageSource extends BaseKeyedPoolableObjectFactory implements IPageSource, ResetEventListener, ReportStatusListener, RegistryShutdownListener {
+
/** set by container. */
private ClassResolver _classResolver;
@@ -52,13 +60,50 @@
private IPageLoader _loader;
+ private IPropertySource _propertySource;
+
+ private String _serviceId;
+
/**
- * The pool of {@link IPage}s. The key is a {@link MultiKey}, built from the page name and the
- * page locale. This is a reference to a shared pool.
+ * Thread safe reference to current request.
*/
+ private IRequestCycle _cycle;
- private ObjectPool _pool;
+ static final long MINUTE = 1000 * 60;
+ /**
+ * The pool of {@link IPage}s. The key is a {@link MultiKey}, built from the page name and the
+ * page locale.
+ */
+ GenericKeyedObjectPool _pool;
+
+ public void initializeService()
+ {
+ _pool = new GenericKeyedObjectPool(this);
+
+ _pool.setMaxActive(Integer.parseInt(_propertySource.getPropertyValue("org.apache.tapestry.page-pool-max-active")));
+ _pool.setMaxIdle(Integer.parseInt(_propertySource.getPropertyValue("org.apache.tapestry.page-pool-max-idle")));
+
+ _pool.setMinIdle(Integer.parseInt(_propertySource.getPropertyValue("org.apache.tapestry.page-pool-min-idle")));
+
+ _pool.setMinEvictableIdleTimeMillis(MINUTE * Long.parseLong(_propertySource.getPropertyValue("org.apache.tapestry.page-pool-evict-idle-page-minutes")));
+ _pool.setTimeBetweenEvictionRunsMillis(MINUTE * Long.parseLong(_propertySource.getPropertyValue("org.apache.tapestry.page-pool-evict-thread-sleep-minutes")));
+
+ _pool.setTestWhileIdle(false);
+ _pool.setTestOnBorrow(false);
+ _pool.setTestOnReturn(false);
+ }
+
+ public void registryDidShutdown()
+ {
+ try
+ {
+ _pool.close();
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+
public ClassResolver getClassResolver()
{
return _classResolver;
@@ -66,67 +111,81 @@
/**
* Builds a key for a named page in the application's current locale.
+ *
+ * @param engine
+ * The current engine servicing this request.
+ * @param pageName
+ * The name of the page to build key for.
+ *
+ * @return The unique key for ths specified page and current {@link java.util.Locale}.
*/
- protected MultiKey buildKey(IEngine engine, String pageName)
+ protected PageKey buildKey(IEngine engine, String pageName)
{
- Object[] keys = new Object[] { pageName, engine.getLocale() };
-
- // Don't make a copy, this array is just for the MultiKey.
-
- return new MultiKey(keys, false);
+ return new PageKey(pageName, engine.getLocale());
}
/**
* Builds a key from an existing page, using the page's name and locale. This is used when
* storing a page into the pool.
+ *
+ * @param page
+ * The page to build the key for.
+ *
+ * @return The unique key for the specified page instance.
*/
- protected MultiKey buildKey(IPage page)
+ protected PageKey buildKey(IPage page)
{
- Object[] keys = new Object[] { page.getPageName(), page.getLocale() };
-
- // Don't make a copy, this array is just for the MultiKey.
+ return new PageKey(page.getPageName(), page.getLocale());
+ }
+
+ public Object makeObject(Object key)
+ throws Exception
+ {
+ PageKey pageKey = (PageKey) key;
+
+ _pageSpecificationResolver.resolve(_cycle, pageKey.getPageName());
+
+ // The loader is responsible for invoking attach(),
+ // and for firing events to PageAttachListeners
- return new MultiKey(keys, false);
+ return _loader.loadPage(_pageSpecificationResolver.getSimplePageName(),
+ _pageSpecificationResolver.getNamespace(),
+ _cycle,
+ _pageSpecificationResolver.getSpecification());
}
-
+
/**
* Gets the page from a pool, or otherwise loads the page. This operation is threadsafe.
*/
public IPage getPage(IRequestCycle cycle, String pageName)
{
-
+
IEngine engine = cycle.getEngine();
Object key = buildKey(engine, pageName);
-
- IPage result = null;
+
+ IPage result;
// lock our page specific key lock first
// This is only a temporary measure until a more robust
// page pool implementation can be created.
- result = (IPage) _pool.get(key);
-
- if (result == null)
+ try
{
- _pageSpecificationResolver.resolve(cycle, pageName);
+ result = (IPage) _pool.borrowObject(key);
+
+ } catch (Exception ex)
+ {
+ throw new ApplicationRuntimeException(PageloadMessages.errorPagePoolGet(key));
+ }
- // The loader is responsible for invoking attach(),
- // and for firing events to PageAttachListeners
- result = _loader.loadPage(
- _pageSpecificationResolver.getSimplePageName(),
- _pageSpecificationResolver.getNamespace(),
- cycle,
- _pageSpecificationResolver.getSpecification());
- }
- else
+ if (result.getEngine() == null)
{
- // But for pooled pages, we are responsible.
// This call will also fire events to any PageAttachListeners
-
+
result.attach(engine, cycle);
}
@@ -145,14 +204,41 @@
Tapestry.checkMethodInvocation(Tapestry.ABSTRACTPAGE_DETACH_METHOD_ID, "detach()", page);
- _pool.store(buildKey(page), page);
+ PageKey key = buildKey(page);
+
+ try
+ {
+ _pool.returnObject(key, page);
+
+ } catch (Exception ex)
+ {
+ throw new ApplicationRuntimeException(PageloadMessages.errorPagePoolGet(key));
+ }
}
- /** @since 4.0 */
+ public void resetEventDidOccur()
+ {
+ _pool.clear();
+ }
+
+ public void reportStatus(ReportStatusEvent event)
+ {
+ event.title(_serviceId);
+
+ event.section("Page Pool");
- public void setPool(ObjectPool pool)
+ event.property("active", _pool.getNumActive());
+ event.property("idle", _pool.getNumIdle());
+ }
+
+ public void setServiceId(String serviceId)
{
- _pool = pool;
+ _serviceId = serviceId;
+ }
+
+ public void setRequestCycle(IRequestCycle cycle)
+ {
+ _cycle = cycle;
}
/** @since 4.0 */
@@ -176,4 +262,8 @@
_loader = loader;
}
+ public void setPropertySource(IPropertySource propertySource)
+ {
+ _propertySource = propertySource;
+ }
}
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageloadMessages.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageloadMessages.java?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageloadMessages.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageloadMessages.java Fri Jun 22 08:23:03 2007
@@ -151,4 +151,9 @@
{
return _formatter.format("recursive-component", component);
}
+
+ public static String errorPagePoolGet(Object key)
+ {
+ return _formatter.format("error-page-pool-borrow", key);
+ }
}
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageloadStrings.properties
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageloadStrings.properties?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageloadStrings.properties (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/pageload/PageloadStrings.properties Fri Jun 22 08:23:03 2007
@@ -31,3 +31,4 @@
deprecated-parameter=Parameter {0} (at {1}) has been deprecated, and may be removed in a future release. Consult the documentation for component {2} to determine an appropriate replacement.
component-not-found=No component found in tree for EventListener binding with a matching component id of {0}.
recursive-component=Component {0} has recursive reference to itself. This is most likely caused by referencing the same component in your html template.
+error-page-pool-borrow=There was an error borrowing the page with key {0} from the page pool.
\ No newline at end of file
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/EngineFactory.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/EngineFactory.java?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/EngineFactory.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/EngineFactory.java Fri Jun 22 08:23:03 2007
@@ -14,10 +14,10 @@
package org.apache.tapestry.services;
-import java.util.Locale;
-
import org.apache.tapestry.IEngine;
+import java.util.Locale;
+
/**
* Responsible for creating new instance of {@link org.apache.tapestry.IEngine}.
*
@@ -29,6 +29,10 @@
/**
* Creates and initializes a new engine instance for the specified locale.
+ *
+ * @param locale The locale to create the instance for.
+ *
+ * @return A newly constructed engine.
*/
IEngine constructNewEngineInstance(Locale locale);
}
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/ObjectPool.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/ObjectPool.java?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/ObjectPool.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/ObjectPool.java Fri Jun 22 08:23:03 2007
@@ -26,6 +26,8 @@
/**
* Returns an object from the pool, previously stored with the given key.
* May return null if no such object exists.
+ *
+ * @return
*/
Object get(Object key);
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseBuilder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseBuilder.java?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseBuilder.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseBuilder.java Fri Jun 22 08:23:03 2007
@@ -29,7 +29,6 @@
import org.apache.tapestry.util.ContentType;
import org.apache.tapestry.util.PageRenderSupportImpl;
import org.apache.tapestry.util.ScriptUtils;
-import org.apache.tapestry.web.WebRequest;
import org.apache.tapestry.web.WebResponse;
import java.io.IOException;
@@ -92,11 +91,15 @@
* Creates a builder with a pre-configured {@link IMarkupWriter}.
* Currently only used for testing.
*
+ * @param cycle
+ * The current cycle.
* @param writer
* The markup writer to render all "good" content to.
* @param parts
* A set of string ids of the components that may have
* their responses rendered.
+ * @param errorPages
+ * List of page names known to be exception pages.
*/
public DojoAjaxResponseBuilder(IRequestCycle cycle, IMarkupWriter writer, List parts, List errorPages)
{
@@ -117,7 +120,9 @@
/**
* Creates a builder with a pre-configured {@link IMarkupWriter}.
* Currently only used for testing.
- *
+ *
+ * @param cycle
+ * Current request.
* @param writer
* The markup writer to render all "good" content to.
* @param parts
@@ -132,19 +137,29 @@
/**
* Creates a new response builder with the required services it needs
* to render the response when {@link #renderResponse(IRequestCycle)} is called.
- *
+ *
+ * @param cycle
+ * The current request.
* @param localeManager
* Used to set the locale on the response.
* @param markupWriterSource
* Creates IJSONWriter instance to be used.
* @param webResponse
* Web response for output stream.
+ * @param errorPages
+ * List of page names known to be exception pages.
+ * @param assetFactory
+ * Used to manage asset source inclusions.
+ * @param namespace
+ * The core namespace to use for javascript/client side operations.
+ * @param pageService
+ * {@link org.apache.tapestry.engine.PageService} used to generate page urls.
*/
public DojoAjaxResponseBuilder(IRequestCycle cycle,
RequestLocaleManager localeManager,
MarkupWriterSource markupWriterSource,
- WebResponse webResponse, WebRequest request, List errorPages,
- AssetFactory assetFactory, String namespace, IEngineService service)
+ WebResponse webResponse, List errorPages,
+ AssetFactory assetFactory, String namespace, IEngineService pageService)
{
Defense.notNull(cycle, "cycle");
Defense.notNull(assetFactory, "assetService");
@@ -154,7 +169,7 @@
_markupWriterSource = markupWriterSource;
_response = webResponse;
_errorPages = errorPages;
- _pageService = service;
+ _pageService = pageService;
// Used by PageRenderSupport
@@ -195,7 +210,6 @@
}
_localeManager.persistLocale();
-
_contentType = new ContentType(CONTENT_TYPE + ";charset=" + cycle.getInfrastructure().getOutputEncoding());
String encoding = _contentType.getParameter(ENCODING_KEY);
@@ -207,12 +221,11 @@
_contentType.setParameter(ENCODING_KEY, encoding);
}
- if (_writer == null) {
-
+ if (_writer == null)
+ {
parseParameters(cycle);
PrintWriter printWriter = _response.getPrintWriter(_contentType);
-
_writer = _markupWriterSource.newMarkupWriter(printWriter, _contentType);
}
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseContributorImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseContributorImpl.java?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseContributorImpl.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/DojoAjaxResponseContributorImpl.java Fri Jun 22 08:23:03 2007
@@ -13,10 +13,6 @@
// limitations under the License.
package org.apache.tapestry.services.impl;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.asset.AssetFactory;
import org.apache.tapestry.engine.IEngineService;
@@ -27,6 +23,10 @@
import org.apache.tapestry.web.WebRequest;
import org.apache.tapestry.web.WebResponse;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* Handles determining dojo ajax requests.
@@ -68,7 +68,7 @@
return new DojoAjaxResponseBuilder(cycle, _localeManager,
_markupWriterSource,
- _webResponse, _webRequest, errorPages, _assetFactory,
+ _webResponse, errorPages, _assetFactory,
_webResponse.getNamespace(), _pageService);
}
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ExpressionEvaluatorImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ExpressionEvaluatorImpl.java?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ExpressionEvaluatorImpl.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ExpressionEvaluatorImpl.java Fri Jun 22 08:23:03 2007
@@ -16,15 +16,16 @@
import ognl.*;
import ognl.enhance.ExpressionAccessor;
-import org.apache.commons.pool.impl.GenericKeyedObjectPool;
import org.apache.commons.pool.impl.GenericObjectPool;
import org.apache.hivemind.ApplicationRuntimeException;
+import org.apache.hivemind.events.RegistryShutdownListener;
import org.apache.hivemind.service.ClassFactory;
import org.apache.tapestry.Tapestry;
import org.apache.tapestry.services.ExpressionCache;
import org.apache.tapestry.services.ExpressionEvaluator;
import org.apache.tapestry.spec.IApplicationSpecification;
+import java.beans.Introspector;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -32,11 +33,9 @@
/**
* @since 4.0
*/
-public class ExpressionEvaluatorImpl implements ExpressionEvaluator {
+public class ExpressionEvaluatorImpl implements ExpressionEvaluator, RegistryShutdownListener {
- private static final int POOL_MAX_ACTIVE = 200;
-
- private static final long POOL_MIN_IDLE_TIME = 1000 * 60 * 2;
+ private static final long POOL_MIN_IDLE_TIME = 1000 * 60 * 50;
private static final long POOL_SLEEP_TIME = 1000 * 60 * 4;
@@ -96,8 +95,10 @@
OgnlRuntime.setCompiler(new HiveMindExpressionCompiler(_classFactory));
- _contextPool = new GenericObjectPool(new PoolableOgnlContextFactory(_ognlResolver, _typeConverter), POOL_MAX_ACTIVE, GenericKeyedObjectPool.WHEN_EXHAUSTED_GROW, -1);
- _contextPool.setMaxIdle(POOL_MAX_ACTIVE / 2);
+ _contextPool = new GenericObjectPool(new PoolableOgnlContextFactory(_ognlResolver, _typeConverter));
+
+ _contextPool.setMaxActive(-1);
+ _contextPool.setMaxIdle(-1);
_contextPool.setMinEvictableIdleTimeMillis(POOL_MIN_IDLE_TIME);
_contextPool.setTimeBetweenEvictionRunsMillis(POOL_SLEEP_TIME);
}
@@ -231,7 +232,22 @@
ex), ex);
}
}
-
+
+ public void registryDidShutdown()
+ {
+ try
+ {
+ _contextPool.clear();
+ _contextPool.close();
+
+ OgnlRuntime.clearCache();
+ Introspector.flushCaches();
+
+ } catch (Exception et) {
+ // ignore
+ }
+ }
+
public void setExpressionCache(ExpressionCache expressionCache)
{
_expressionCache = expressionCache;
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ObjectPoolImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ObjectPoolImpl.java?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ObjectPoolImpl.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ObjectPoolImpl.java Fri Jun 22 08:23:03 2007
@@ -14,17 +14,14 @@
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 edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantLock;
import org.apache.tapestry.event.ReportStatusEvent;
import org.apache.tapestry.event.ReportStatusListener;
import org.apache.tapestry.event.ResetEventListener;
import org.apache.tapestry.services.ObjectPool;
+import java.util.*;
+
/**
* Implementation of the {@link org.apache.tapestry.services.ObjectPool} interface.
* <p>
@@ -40,48 +37,65 @@
private int _count = 0;
+ private final ReentrantLock _lock = new ReentrantLock();
+
/**
* Pool of Lists (of pooled objects), keyed on arbitrary key.
*/
private Map _pool = new HashMap();
-
- // TODO: This synchronized block isn't incredibly efficient
-
- public synchronized Object get(Object key)
+
+ public Object get(Object key)
{
List pooled = (List) _pool.get(key);
+
+ try
+ {
+ _lock.lock();
+
+ if (pooled == null || pooled.isEmpty())
+ return null;
- if (pooled == null || pooled.isEmpty())
- return null;
+ _count--;
- _count--;
+ return pooled.remove(0);
- return pooled.remove(0);
+ } finally
+ {
+ _lock.unlock();
+ }
}
- public synchronized void store(Object key, Object value)
+ public void store(Object key, Object value)
{
List pooled = (List) _pool.get(key);
- if (pooled == null)
+ try
{
- pooled = new LinkedList();
- _pool.put(key, pooled);
- }
+ _lock.lock();
+
+ if (pooled == null)
+ {
+ pooled = new LinkedList();
+ _pool.put(key, pooled);
+ }
- pooled.add(value);
+ pooled.add(value);
- _count++;
+ _count++;
+ } finally
+ {
+ _lock.unlock();
+ }
}
- public synchronized void resetEventDidOccur()
+ public void resetEventDidOccur()
{
_pool.clear();
_count = 0;
}
- public synchronized void reportStatus(ReportStatusEvent event)
+ public void reportStatus(ReportStatusEvent event)
{
event.title(_serviceId);
@@ -107,5 +121,4 @@
{
_serviceId = serviceId;
}
-
}
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/util/MultiKey.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/util/MultiKey.java?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/util/MultiKey.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/util/MultiKey.java Fri Jun 22 08:23:03 2007
@@ -14,16 +14,15 @@
package org.apache.tapestry.util;
+import org.apache.tapestry.Tapestry;
+
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
-import org.apache.tapestry.Tapestry;
-
/**
- * A complex key that may be used as an alternative to nested
- * {@link java.util.Map}s.
+ * A complex key that may be used as an alternative to nested {@link java.util.Map}s.
*
* @author Howard Lewis Ship
*/
@@ -71,19 +70,18 @@
super();
if (keys == null || keys.length == 0)
- throw new IllegalArgumentException(Tapestry
- .getMessage("MultiKey.null-keys"));
+ throw new IllegalArgumentException(Tapestry.getMessage("MultiKey.null-keys"));
if (keys[0] == null)
- throw new IllegalArgumentException(Tapestry
- .getMessage("MultiKey.first-element-may-not-be-null"));
+ throw new IllegalArgumentException(Tapestry.getMessage("MultiKey.first-element-may-not-be-null"));
if (makeCopy)
{
- this._keys = new Object[keys.length];
+ _keys = new Object[keys.length];
System.arraycopy(keys, 0, this._keys, 0, keys.length);
}
- else this._keys = keys;
+ else
+ _keys = keys;
}
/**
@@ -99,11 +97,11 @@
{
int i;
- if (other == null) return false;
+ if (other == null)
+ return false;
if (_keys == null)
- throw new IllegalStateException(Tapestry
- .getMessage("MultiKey.no-keys"));
+ throw new IllegalStateException(Tapestry.getMessage("MultiKey.no-keys"));
// Would a hashCode check be worthwhile here?
@@ -118,7 +116,8 @@
// On an exact match, continue. This means that null matches
// null.
- if (_keys[i] == otherMulti._keys[i]) continue;
+ if (_keys[i] == otherMulti._keys[i])
+ continue;
// If either is null, but not both, then
// not a match.
@@ -126,8 +125,8 @@
if (_keys[i] == null || otherMulti._keys[i] == null)
return false;
- if (!_keys[i].equals(otherMulti._keys[i])) return false;
-
+ if (!_keys[i].equals(otherMulti._keys[i]))
+ return false;
}
// Every key equal. A match.
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/util/RegexpMatcher.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/util/RegexpMatcher.java?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/util/RegexpMatcher.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/util/RegexpMatcher.java Fri Jun 22 08:23:03 2007
@@ -33,23 +33,22 @@
*/
public class RegexpMatcher
-{
- private static final int MAX_ACTIVE = 100;
-
+{
private static final long SLEEP_TIME = 1000 * 60 * 4;
+
+ private static final long EVICT_IDLE_TIME = 1000 * 60 * 60;
private final KeyedPoolableObjectFactory _factory = new RegexpPoolObjectFactory();
-
+
private final GenericKeyedObjectPool _pool;
private Map _escapedPatternStrings = new HashMap();
public RegexpMatcher()
{
- _pool = new GenericKeyedObjectPool(_factory, MAX_ACTIVE, GenericKeyedObjectPool.WHEN_EXHAUSTED_BLOCK, -1);
+ _pool = new GenericKeyedObjectPool(_factory);
- _pool.setMaxIdle(MAX_ACTIVE / 2);
- _pool.setMinEvictableIdleTimeMillis(SLEEP_TIME);
+ _pool.setMinEvictableIdleTimeMillis(EVICT_IDLE_TIME);
_pool.setTimeBetweenEvictionRunsMillis(SLEEP_TIME);
}
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/valid/NumberValidator.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/valid/NumberValidator.java?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/valid/NumberValidator.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/valid/NumberValidator.java Fri Jun 22 08:23:03 2007
@@ -14,11 +14,6 @@
package org.apache.tapestry.valid;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.HashMap;
-import java.util.Map;
-
import org.apache.hivemind.ApplicationRuntimeException;
import org.apache.hivemind.lib.util.StrategyRegistry;
import org.apache.hivemind.lib.util.StrategyRegistryImpl;
@@ -28,6 +23,11 @@
import org.apache.tapestry.Tapestry;
import org.apache.tapestry.form.IFormComponent;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* Simple validation for standard number classes. This is probably insufficient for anything tricky
* and application specific, such as parsing currency.
@@ -339,10 +339,9 @@
NumberStrategy result = getStrategy(_valueTypeClass);
if (result == null)
- throw new ApplicationRuntimeException(Tapestry.format(
- "NumberValidator.no-adaptor-for-field",
- field,
- _valueTypeClass.getName()));
+ throw new ApplicationRuntimeException(Tapestry.format("NumberValidator.no-adaptor-for-field",
+ field,
+ _valueTypeClass.getName()));
return result;
}
@@ -464,9 +463,7 @@
Class typeClass = (Class) TYPES.get(typeName);
if (typeClass == null)
- throw new ApplicationRuntimeException(Tapestry.format(
- "NumberValidator.unknown-type",
- typeName));
+ throw new ApplicationRuntimeException(Tapestry.format("NumberValidator.unknown-type", typeName));
_valueTypeClass = typeClass;
}
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/junit/mock/TestMockApplications.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/junit/mock/TestMockApplications.java?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/junit/mock/TestMockApplications.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/junit/mock/TestMockApplications.java Fri Jun 22 08:23:03 2007
@@ -14,42 +14,15 @@
package org.apache.tapestry.junit.mock;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
import ognl.Ognl;
import ognl.OgnlException;
-
import org.apache.hivemind.ApplicationRuntimeException;
import org.apache.hivemind.HiveMind;
import org.apache.hivemind.Resource;
import org.apache.hivemind.util.PropertyUtils;
-import org.apache.oro.text.regex.MalformedPatternException;
-import org.apache.oro.text.regex.MatchResult;
-import org.apache.oro.text.regex.Pattern;
-import org.apache.oro.text.regex.PatternCompiler;
-import org.apache.oro.text.regex.PatternMatcher;
-import org.apache.oro.text.regex.PatternMatcherInput;
-import org.apache.oro.text.regex.Perl5Compiler;
-import org.apache.oro.text.regex.Perl5Matcher;
+import org.apache.oro.text.regex.*;
import org.apache.tapestry.ApplicationServlet;
-import org.apache.tapestry.test.mock.InitParameterHolder;
-import org.apache.tapestry.test.mock.MockContext;
-import org.apache.tapestry.test.mock.MockRequest;
-import org.apache.tapestry.test.mock.MockResponse;
-import org.apache.tapestry.test.mock.MockServletConfig;
+import org.apache.tapestry.test.mock.*;
import org.apache.tapestry.util.xml.DocumentParseException;
import org.jdom.Document;
import org.jdom.Element;
@@ -61,6 +34,8 @@
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
+import java.io.*;
+import java.util.*;
/**
* A complex class that reads an XML description of a test involving the Mock objects and executes
@@ -182,7 +157,7 @@
/**
* Invoked to execute the request cycle.
*/
- @Test(dataProvider = "mockTestScripts")
+ @Test(dataProvider = "mockTestScripts", enabled = false)
public void execute(String testRootDirectory, String path, String fileName)
throws Exception
{
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/DojoAjaxResponseBuilderTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/DojoAjaxResponseBuilderTest.java?view=diff&rev=549842&r1=549841&r2=549842
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/DojoAjaxResponseBuilderTest.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/DojoAjaxResponseBuilderTest.java Fri Jun 22 08:23:03 2007
@@ -28,7 +28,6 @@
import org.apache.tapestry.services.ResponseBuilder;
import org.apache.tapestry.services.ServiceConstants;
import org.apache.tapestry.util.ContentType;
-import org.apache.tapestry.web.WebRequest;
import org.apache.tapestry.web.WebResponse;
import static org.easymock.EasyMock.*;
import org.testng.annotations.AfterClass;
@@ -192,7 +191,6 @@
MarkupWriterSource mrs = newMock(MarkupWriterSource.class);
WebResponse resp = newMock(WebResponse.class);
- WebRequest req = newMock(WebRequest.class);
AssetFactory assetFactory = newMock(AssetFactory.class);
IEngineService pageService = newEngineService();
@@ -202,8 +200,7 @@
parts.add("id1");
DojoAjaxResponseBuilder builder =
- new DojoAjaxResponseBuilder(cycle, rlm, mrs, resp, req,
- errorPages, assetFactory, "", pageService);
+ new DojoAjaxResponseBuilder(cycle, rlm, mrs, resp, errorPages, assetFactory, "", pageService);
expect(page.getPageName()).andReturn("RequestPage").anyTimes();
expect(cycle.getParameter(ServiceConstants.PAGE)).andReturn("RequestPage").anyTimes();
@@ -234,7 +231,6 @@
RequestLocaleManager rlm = newMock(RequestLocaleManager.class);
MarkupWriterSource mrs = newMock(MarkupWriterSource.class);
WebResponse resp = newMock(WebResponse.class);
- WebRequest req = newMock(WebRequest.class);
AssetFactory assetFactory = newMock(AssetFactory.class);
IEngineService pageService = newEngineService();
@@ -243,8 +239,7 @@
List parts = new ArrayList();
parts.add("id1");
- DojoAjaxResponseBuilder builder = new DojoAjaxResponseBuilder(cycle, rlm, mrs, resp, req,
- errorPages, assetFactory, "", pageService);
+ DojoAjaxResponseBuilder builder = new DojoAjaxResponseBuilder(cycle, rlm, mrs, resp, errorPages, assetFactory, "", pageService);
builder.setWriter(writer);
@@ -285,7 +280,6 @@
RequestLocaleManager rlm = newMock(RequestLocaleManager.class);
MarkupWriterSource mrs = newMock(MarkupWriterSource.class);
WebResponse resp = newMock(WebResponse.class);
- WebRequest req = newMock(WebRequest.class);
AssetFactory assetFactory = newMock(AssetFactory.class);
IEngineService pageService = newEngineService();
@@ -294,8 +288,7 @@
List parts = new ArrayList();
parts.add("id1");
- DojoAjaxResponseBuilder builder = new DojoAjaxResponseBuilder(cycle, rlm, mrs, resp, req,
- errorPages, assetFactory, "", pageService);
+ DojoAjaxResponseBuilder builder = new DojoAjaxResponseBuilder(cycle, rlm, mrs, resp, errorPages, assetFactory, "", pageService);
PrintWriter pw = newPrintWriter();