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 2009/12/11 00:05:16 UTC
svn commit: r889459 [2/2] - in
/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5:
internal/services/SyntheticStackTraceElementAnalyzer.java
services/TapestryModule.java
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java?rev=889459&r1=889458&r2=889459&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java Thu Dec 10 23:05:16 2009
@@ -76,7 +76,8 @@
/**
* The root module for Tapestry.
*/
-@SuppressWarnings({ "JavaDoc" })
+@SuppressWarnings(
+{ "JavaDoc" })
@Marker(Core.class)
@SubModule(InternalModule.class)
public final class TapestryModule
@@ -106,34 +107,38 @@
private final EndOfRequestEventHub endOfRequestEventHub;
/**
- * We inject all sorts of common dependencies (including builders) into the module itself (note: even though some of
- * these service are defined by the module itself, that's ok because services are always lazy proxies). This isn't
- * about efficiency (it may be slightly more efficient, but not in any noticable way), it's about eliminating the
- * need to keep injecting these dependencies into invividual service builder and contribution methods.
+ * We inject all sorts of common dependencies (including builders) into the
+ * module itself (note: even though some of
+ * these service are defined by the module itself, that's ok because
+ * services are always lazy proxies). This isn't
+ * about efficiency (it may be slightly more efficient, but not in any
+ * noticable way), it's about eliminating the
+ * need to keep injecting these dependencies into invividual service builder
+ * and contribution methods.
*/
public TapestryModule(PipelineBuilder pipelineBuilder,
- PropertyShadowBuilder shadowBuilder,
+ PropertyShadowBuilder shadowBuilder,
- RequestGlobals requestGlobals,
+ RequestGlobals requestGlobals,
- ApplicationGlobals applicationGlobals,
+ ApplicationGlobals applicationGlobals,
- ChainBuilder chainBuilder,
+ ChainBuilder chainBuilder,
- Environment environment,
+ Environment environment,
- StrategyBuilder strategyBuilder,
+ StrategyBuilder strategyBuilder,
- PropertyAccess propertyAccess,
+ PropertyAccess propertyAccess,
- Request request,
+ Request request,
- Response response,
+ Response response,
- EnvironmentalShadowBuilder environmentalBuilder,
+ EnvironmentalShadowBuilder environmentalBuilder,
- EndOfRequestEventHub endOfRequestEventHub)
+ EndOfRequestEventHub endOfRequestEventHub)
{
this.pipelineBuilder = pipelineBuilder;
this.shadowBuilder = shadowBuilder;
@@ -173,28 +178,30 @@
private final String applicationCharset;
private final SessionPersistedObjectAnalyzer analyzer;
- public HttpServletRequestHandlerTerminator(RequestHandler handler, String applicationCharset,
- SessionPersistedObjectAnalyzer analyzer)
+ public HttpServletRequestHandlerTerminator(RequestHandler handler,
+ String applicationCharset, SessionPersistedObjectAnalyzer analyzer)
{
this.handler = handler;
this.applicationCharset = applicationCharset;
this.analyzer = analyzer;
}
- public boolean service(HttpServletRequest servletRequest, HttpServletResponse servletResponse)
- throws IOException
+ public boolean service(HttpServletRequest servletRequest,
+ HttpServletResponse servletResponse) throws IOException
{
requestGlobals.storeServletRequestResponse(servletRequest, servletResponse);
Request request = new RequestImpl(servletRequest, applicationCharset, analyzer);
Response response = new ResponseImpl(servletResponse);
- // TAP5-257: Make sure that the "initial guess" for request/response is available, even if
+ // TAP5-257: Make sure that the "initial guess" for request/response
+ // is available, even if
// some filter in the RequestHandler pipeline replaces them.
requestGlobals.storeRequestResponse(request, response);
- // Transition from the Servlet API-based pipeline, to the Tapestry-based pipeline.
+ // Transition from the Servlet API-based pipeline, to the
+ // Tapestry-based pipeline.
return handler.service(request, response);
}
@@ -240,7 +247,8 @@
public boolean service(Request request, Response response) throws IOException
{
- // Update RequestGlobals with the current request/response (in case some filter replaced the
+ // Update RequestGlobals with the current request/response (in case
+ // some filter replaced the
// normal set).
requestGlobals.storeRequestResponse(request, response);
@@ -254,7 +262,7 @@
binder.bind(PersistentLocale.class, PersistentLocaleImpl.class);
binder.bind(ApplicationStateManager.class, ApplicationStateManagerImpl.class);
binder.bind(ApplicationStatePersistenceStrategySource.class,
- ApplicationStatePersistenceStrategySourceImpl.class);
+ ApplicationStatePersistenceStrategySourceImpl.class);
binder.bind(BindingSource.class, BindingSourceImpl.class);
binder.bind(FieldValidatorSource.class, FieldValidatorSourceImpl.class);
binder.bind(ApplicationGlobals.class, ApplicationGlobalsImpl.class);
@@ -274,10 +282,11 @@
binder.bind(ObjectRenderer.class, LocationRenderer.class).withId("LocationRenderer");
binder.bind(ObjectProvider.class, AssetObjectProvider.class).withId("AssetObjectProvider");
binder.bind(RequestExceptionHandler.class, DefaultRequestExceptionHandler.class);
- binder.bind(ComponentEventResultProcessor.class, ComponentInstanceResultProcessor.class).withId(
- "ComponentInstanceResultProcessor");
+ binder.bind(ComponentEventResultProcessor.class, ComponentInstanceResultProcessor.class)
+ .withId("ComponentInstanceResultProcessor");
binder.bind(NullFieldStrategySource.class, NullFieldStrategySourceImpl.class);
- binder.bind(HttpServletRequestFilter.class, IgnoredPathsFilter.class).withId("IgnoredPathsFilter");
+ binder.bind(HttpServletRequestFilter.class, IgnoredPathsFilter.class).withId(
+ "IgnoredPathsFilter");
binder.bind(ContextValueEncoder.class, ContextValueEncoderImpl.class);
binder.bind(BaseURLSource.class, BaseURLSourceImpl.class);
binder.bind(BeanBlockOverrideSource.class, BeanBlockOverrideSourceImpl.class);
@@ -286,17 +295,22 @@
binder.bind(PageDocumentGenerator.class, PageDocumentGeneratorImpl.class);
binder.bind(ResponseRenderer.class, ResponseRendererImpl.class);
binder.bind(FieldTranslatorSource.class, FieldTranslatorSourceImpl.class);
- binder.bind(BindingFactory.class, MessageBindingFactory.class).withId("MessageBindingFactory");
- binder.bind(BindingFactory.class, ValidateBindingFactory.class).withId("ValidateBindingFactory");
- binder.bind(BindingFactory.class, TranslateBindingFactory.class).withId("TranslateBindingFactory");
+ binder.bind(BindingFactory.class, MessageBindingFactory.class).withId(
+ "MessageBindingFactory");
+ binder.bind(BindingFactory.class, ValidateBindingFactory.class).withId(
+ "ValidateBindingFactory");
+ binder.bind(BindingFactory.class, TranslateBindingFactory.class).withId(
+ "TranslateBindingFactory");
binder.bind(BindingFactory.class, AssetBindingFactory.class).withId("AssetBindingFactory");
- binder.bind(BindingFactory.class, ContextBindingFactory.class).withId("ContextBindingFactory");
+ binder.bind(BindingFactory.class, ContextBindingFactory.class).withId(
+ "ContextBindingFactory");
binder.bind(BindingFactory.class, NullFieldStrategyBindingFactory.class).withId(
"NullFieldStrategyBindingFactory");
binder.bind(URLEncoder.class, URLEncoderImpl.class);
binder.bind(ContextPathEncoder.class, ContextPathEncoderImpl.class);
binder.bind(UpdateListenerHub.class, UpdateListenerHubImpl.class);
- binder.bind(ApplicationStatePersistenceStrategy.class, SessionApplicationStatePersistenceStrategy.class).withId(
+ binder.bind(ApplicationStatePersistenceStrategy.class,
+ SessionApplicationStatePersistenceStrategy.class).withId(
"SessionApplicationStatePersistenceStrategy");
binder.bind(AssetPathConverter.class, IdentityAssetPathConverter.class);
binder.bind(NumericTranslatorSupport.class);
@@ -305,8 +319,10 @@
binder.bind(PageRenderLinkSource.class, PageRenderLinkSourceImpl.class);
binder.bind(ClientInfrastructure.class, ClientInfrastructureImpl.class);
binder.bind(URLRewriter.class, URLRewriterImpl.class);
- binder.bind(Dispatcher.class, AssetProtectionDispatcher.class).withId("AssetProtectionDispatcher");
- binder.bind(AssetPathAuthorizer.class, WhitelistAuthorizer.class).withId("WhitelistAuthorizer");
+ binder.bind(Dispatcher.class, AssetProtectionDispatcher.class).withId(
+ "AssetProtectionDispatcher");
+ binder.bind(AssetPathAuthorizer.class, WhitelistAuthorizer.class).withId(
+ "WhitelistAuthorizer");
binder.bind(AssetPathAuthorizer.class, RegexAuthorizer.class).withId("RegexAuthorizer");
}
@@ -319,13 +335,14 @@
@PreventServiceDecoration
public static Alias buildAlias(Logger logger,
- @Inject @Symbol(InternalSymbols.ALIAS_MODE)
- String mode,
+ @Inject
+ @Symbol(InternalSymbols.ALIAS_MODE)
+ String mode,
- @InjectService("AliasOverrides")
- AliasManager overridesManager,
+ @InjectService("AliasOverrides")
+ AliasManager overridesManager,
- Collection<AliasContribution> configuration)
+ Collection<AliasContribution> configuration)
{
AliasManager manager = new AliasManagerImpl(logger, configuration);
@@ -339,31 +356,33 @@
// ========================================================================
/**
- * Contributes the factory for serveral built-in binding prefixes ("asset", "block", "component", "literal", prop",
+ * Contributes the factory for serveral built-in binding prefixes ("asset",
+ * "block", "component", "literal", prop",
* "nullfieldstrategy", "message", "validate", "translate", "var").
*/
- public static void contributeBindingSource(MappedConfiguration<String, BindingFactory> configuration,
+ public static void contributeBindingSource(
+ MappedConfiguration<String, BindingFactory> configuration,
- @InjectService("PropBindingFactory")
- BindingFactory propBindingFactory,
+ @InjectService("PropBindingFactory")
+ BindingFactory propBindingFactory,
- @InjectService("MessageBindingFactory")
- BindingFactory messageBindingFactory,
+ @InjectService("MessageBindingFactory")
+ BindingFactory messageBindingFactory,
- @InjectService("ValidateBindingFactory")
- BindingFactory validateBindingFactory,
+ @InjectService("ValidateBindingFactory")
+ BindingFactory validateBindingFactory,
- @InjectService("TranslateBindingFactory")
- BindingFactory translateBindingFactory,
+ @InjectService("TranslateBindingFactory")
+ BindingFactory translateBindingFactory,
- @InjectService("AssetBindingFactory")
- BindingFactory assetBindingFactory,
+ @InjectService("AssetBindingFactory")
+ BindingFactory assetBindingFactory,
- @InjectService("NullFieldStrategyBindingFactory")
- BindingFactory nullFieldStrategyBindingFactory,
+ @InjectService("NullFieldStrategyBindingFactory")
+ BindingFactory nullFieldStrategyBindingFactory,
- @InjectService("ContextBindingFactory")
- BindingFactory contextBindingFactory)
+ @InjectService("ContextBindingFactory")
+ BindingFactory contextBindingFactory)
{
configuration.add(BindingConstants.LITERAL, new LiteralBindingFactory());
configuration.add(BindingConstants.COMPONENT, new ComponentBindingFactory());
@@ -379,29 +398,32 @@
configuration.add(BindingConstants.CONTEXT, contextBindingFactory);
}
- public static void contributeClasspathAssetAliasManager(MappedConfiguration<String, String> configuration,
+ public static void contributeClasspathAssetAliasManager(
+ MappedConfiguration<String, String> configuration,
- @Symbol(SymbolConstants.TAPESTRY_VERSION)
- String tapestryVersion,
+ @Symbol(SymbolConstants.TAPESTRY_VERSION)
+ String tapestryVersion,
- @Symbol(SymbolConstants.APPLICATION_VERSION)
- String applicationVersion,
+ @Symbol(SymbolConstants.APPLICATION_VERSION)
+ String applicationVersion,
- @Symbol(InternalConstants.TAPESTRY_APP_PACKAGE_PARAM)
- String appPackage,
+ @Symbol(InternalConstants.TAPESTRY_APP_PACKAGE_PARAM)
+ String appPackage,
- // @Inject not needed, because this isn't a service builder method
- @Symbol("tapestry.scriptaculous.path")
- String scriptaculousPath,
+ // @Inject not needed, because this isn't a service builder method
+ @Symbol("tapestry.scriptaculous.path")
+ String scriptaculousPath,
- @Symbol("tapestry.datepicker.path")
- String datepickerPath,
+ @Symbol("tapestry.datepicker.path")
+ String datepickerPath,
- @Symbol("tapestry.blackbird.path")
- String blackbirdPath)
+ @Symbol("tapestry.blackbird.path")
+ String blackbirdPath)
{
- // TAPESTRY-2159: All the classpath assets are inside a version numbered folder (i.e., 5.0.12).
- // For scriptaculous, etc., this version is not the version of the library, but the version
+ // TAPESTRY-2159: All the classpath assets are inside a version numbered
+ // folder (i.e., 5.0.12).
+ // For scriptaculous, etc., this version is not the version of the
+ // library, but the version
// of Tapestry.
configuration.add("tapestry/" + tapestryVersion, "org/apache/tapestry5");
@@ -423,32 +445,76 @@
}
/**
- * Adds a number of standard component class transform workers: <dl> <dt>Retain </dt> <dd>Allows fields to retain
- * their values between requests</dd> <dt>Persist </dt> <dd>Allows fields to store their their value persistently
- * between requests</dd> <dt>Parameter </dt> <dd>Identifies parameters based on the {@link
- * org.apache.tapestry5.annotations.Parameter} annotation</dd> <dt>Component </dt> <dd>Defines embedded components
- * based on the {@link org.apache.tapestry5.annotations.Component} annotation</dd> <dt>Mixin </dt> <dd>Adds a mixin
- * as part of a component's implementation</dd> <dt>Environment </dt> <dd>Allows fields to contain values extracted
- * from the {@link org.apache.tapestry5.services.Environment} service</dd> <dt>Inject </dt> <dd>Used with the {@link
- * org.apache.tapestry5.ioc.annotations.Inject} annotation, when a value is supplied</dd> <dt>InjectService</dt>
- * <dd>Handles the {@link org.apache.tapestry5.ioc.annotations.InjectService} annotation</dd> <dt>InjectPage</dt>
- * <dd>Adds code to allow access to other pages via the {@link org.apache.tapestry5.annotations.InjectPage} field
- * annotation</dd> <dt>InjectBlock </dt> <dd>Allows a block from the template to be injected into a field</dd>
- * <dt>IncludeStylesheet </dt> <dd>Supports the {@link org.apache.tapestry5.annotations.IncludeStylesheet}
- * annotation</dd> <dt>IncludeJavaScriptLibrary </dt> <dd>Supports the {@link org.apache.tapestry5.annotations.IncludeJavaScriptLibrary}
- * annotation</dd> <dt>SupportsInformalParameters </dt> <dd>Checks for the annotation</dd> <dt>Meta </dt> <dd>Checks
- * for meta data and adds it to the component model</dd> <dt>ApplicationState </dt> <dd>Converts fields that
- * reference application state objects <dt>UnclaimedField </dt> <dd>Identifies unclaimed fields and resets them to
- * null/0/false at the end of the request</dd> <dt>RenderCommand </dt> <dd>Ensures all components also implement
- * {@link org.apache.tapestry5.runtime.RenderCommand}</dd> <dt>SetupRender, BeginRender, etc. </dt> <dd>Correspond
- * to component render phases and annotations</dd> <dt>InvokePostRenderCleanupOnResources </dt> <dd>Makes sure
- * {@link org.apache.tapestry5.internal.InternalComponentResources#postRenderCleanup()} is invoked after a component
- * finishes rendering</dd> <dt>Secure</dt> <dd>Checks for the {@link org.apache.tapestry5.annotations.Secure}
- * annotation</dd> <dt>ContentType</dt> <dd>Checks for {@link org.apache.tapestry5.annotations.ContentType}
- * annotation</dd> <dt>GenerateAccessors</dt> <dd>Generates accessor methods if {@link
- * org.apache.tapestry5.annotations.Property} annotation is present </dd> <dt>Cached</dt> <dd>Checks for the {@link
- * org.apache.tapestry5.annotations.Cached} annotation</dd><dt>Log</dt> <dd>Checks for the {@link
- * org.apache.tapestry5.annotations.Log} annotation</dd></dl>
+ * Adds a number of standard component class transform workers:
+ * <dl>
+ * <dt>Retain</dt>
+ * <dd>Allows fields to retain their values between requests</dd>
+ * <dt>Persist</dt>
+ * <dd>Allows fields to store their their value persistently between
+ * requests</dd>
+ * <dt>Parameter</dt>
+ * <dd>Identifies parameters based on the
+ * {@link org.apache.tapestry5.annotations.Parameter} annotation</dd>
+ * <dt>Component</dt>
+ * <dd>Defines embedded components based on the
+ * {@link org.apache.tapestry5.annotations.Component} annotation</dd>
+ * <dt>Mixin</dt>
+ * <dd>Adds a mixin as part of a component's implementation</dd>
+ * <dt>Environment</dt>
+ * <dd>Allows fields to contain values extracted from the
+ * {@link org.apache.tapestry5.services.Environment} service</dd>
+ * <dt>Inject</dt>
+ * <dd>Used with the {@link org.apache.tapestry5.ioc.annotations.Inject}
+ * annotation, when a value is supplied</dd>
+ * <dt>InjectService</dt>
+ * <dd>Handles the
+ * {@link org.apache.tapestry5.ioc.annotations.InjectService} annotation</dd>
+ * <dt>InjectPage</dt>
+ * <dd>Adds code to allow access to other pages via the
+ * {@link org.apache.tapestry5.annotations.InjectPage} field annotation</dd>
+ * <dt>InjectBlock</dt>
+ * <dd>Allows a block from the template to be injected into a field</dd>
+ * <dt>IncludeStylesheet</dt>
+ * <dd>Supports the
+ * {@link org.apache.tapestry5.annotations.IncludeStylesheet} annotation</dd>
+ * <dt>IncludeJavaScriptLibrary</dt>
+ * <dd>Supports the
+ * {@link org.apache.tapestry5.annotations.IncludeJavaScriptLibrary}
+ * annotation</dd>
+ * <dt>SupportsInformalParameters</dt>
+ * <dd>Checks for the annotation</dd>
+ * <dt>Meta</dt>
+ * <dd>Checks for meta data and adds it to the component model</dd>
+ * <dt>ApplicationState</dt>
+ * <dd>Converts fields that reference application state objects
+ * <dt>UnclaimedField</dt>
+ * <dd>Identifies unclaimed fields and resets them to null/0/false at the
+ * end of the request</dd>
+ * <dt>RenderCommand</dt>
+ * <dd>Ensures all components also implement
+ * {@link org.apache.tapestry5.runtime.RenderCommand}</dd>
+ * <dt>SetupRender, BeginRender, etc.</dt>
+ * <dd>Correspond to component render phases and annotations</dd>
+ * <dt>InvokePostRenderCleanupOnResources</dt>
+ * <dd>Makes sure
+ * {@link org.apache.tapestry5.internal.InternalComponentResources#postRenderCleanup()}
+ * is invoked after a component finishes rendering</dd>
+ * <dt>Secure</dt>
+ * <dd>Checks for the {@link org.apache.tapestry5.annotations.Secure}
+ * annotation</dd>
+ * <dt>ContentType</dt>
+ * <dd>Checks for {@link org.apache.tapestry5.annotations.ContentType}
+ * annotation</dd>
+ * <dt>GenerateAccessors</dt>
+ * <dd>Generates accessor methods if
+ * {@link org.apache.tapestry5.annotations.Property} annotation is present</dd>
+ * <dt>Cached</dt>
+ * <dd>Checks for the {@link org.apache.tapestry5.annotations.Cached}
+ * annotation</dd>
+ * <dt>Log</dt>
+ * <dd>Checks for the {@link org.apache.tapestry5.annotations.Log}
+ * annotation</dd>
+ * </dl>
*/
public static void contributeComponentClassTransformWorker(
OrderedConfiguration<ComponentClassTransformWorker> configuration,
@@ -459,8 +525,10 @@
ComponentClassResolver resolver)
{
- // TODO: Proper scheduling of all of this. Since a given field or method should
- // only have a single annotation, the order doesn't matter so much, as long as
+ // TODO: Proper scheduling of all of this. Since a given field or method
+ // should
+ // only have a single annotation, the order doesn't matter so much, as
+ // long as
// UnclaimedField is last.
configuration.addInstance("Cached", CachedWorker.class);
@@ -482,88 +550,122 @@
configuration.add("InjectComponent", new InjectComponentWorker());
configuration.add("RenderCommand", new RenderCommandWorker());
- // Default values for parameters are often some form of injection, so make sure
+ // Default values for parameters are often some form of injection, so
+ // make sure
// that Parameter fields are processed after injections.
configuration.addInstance("Parameter", ParameterWorker.class, "after:Inject*");
- //bind parameter should always go after parameter to make sure all parameters
- //have been properly setup.
-
- configuration.addInstance("BindParameter",BindParameterWorker.class, "after:Parameter");
+ // bind parameter should always go after parameter to make sure all
+ // parameters
+ // have been properly setup.
+ configuration.addInstance("BindParameter", BindParameterWorker.class, "after:Parameter");
- // Workers for the component rendering state machine methods; this is in typical
+ // Workers for the component rendering state machine methods; this is in
+ // typical
// execution order.
add(configuration, TransformConstants.SETUP_RENDER_SIGNATURE, SetupRender.class, false);
add(configuration, TransformConstants.BEGIN_RENDER_SIGNATURE, BeginRender.class, false);
- add(configuration, TransformConstants.BEFORE_RENDER_TEMPLATE_SIGNATURE, BeforeRenderTemplate.class, false);
- add(configuration, TransformConstants.BEFORE_RENDER_BODY_SIGNATURE, BeforeRenderBody.class, false);
+ add(configuration, TransformConstants.BEFORE_RENDER_TEMPLATE_SIGNATURE,
+ BeforeRenderTemplate.class, false);
+ add(configuration, TransformConstants.BEFORE_RENDER_BODY_SIGNATURE, BeforeRenderBody.class,
+ false);
// These phases operate in reverse order.
- add(configuration, TransformConstants.AFTER_RENDER_BODY_SIGNATURE, AfterRenderBody.class, true);
- add(configuration, TransformConstants.AFTER_RENDER_TEMPLATE_SIGNATURE, AfterRenderTemplate.class, true);
+ add(configuration, TransformConstants.AFTER_RENDER_BODY_SIGNATURE, AfterRenderBody.class,
+ true);
+ add(configuration, TransformConstants.AFTER_RENDER_TEMPLATE_SIGNATURE,
+ AfterRenderTemplate.class, true);
add(configuration, TransformConstants.AFTER_RENDER_SIGNATURE, AfterRender.class, true);
add(configuration, TransformConstants.CLEANUP_RENDER_SIGNATURE, CleanupRender.class, true);
- // Ideally, these should be ordered pretty late in the process to make sure there are no
- // side effects with other workers that do work inside the page lifecycle methods.
-
- add(configuration, PageLoaded.class, TransformConstants.CONTAINING_PAGE_DID_LOAD_SIGNATURE, "pageLoaded");
- add(configuration, PageAttached.class, TransformConstants.CONTAINING_PAGE_DID_ATTACH_SIGNATURE, "pageAttached");
- add(configuration, PageDetached.class, TransformConstants.CONTAINING_PAGE_DID_DETACH_SIGNATURE, "pageDetached");
+ // Ideally, these should be ordered pretty late in the process to make
+ // sure there are no
+ // side effects with other workers that do work inside the page
+ // lifecycle methods.
+
+ add(configuration, PageLoaded.class, TransformConstants.CONTAINING_PAGE_DID_LOAD_SIGNATURE,
+ "pageLoaded");
+ add(configuration, PageAttached.class,
+ TransformConstants.CONTAINING_PAGE_DID_ATTACH_SIGNATURE, "pageAttached");
+ add(configuration, PageDetached.class,
+ TransformConstants.CONTAINING_PAGE_DID_DETACH_SIGNATURE, "pageDetached");
configuration.add("Retain", new RetainWorker());
configuration.add("Persist", new PersistWorker());
- configuration.addInstance("IncludeStylesheet", IncludeStylesheetWorker.class, "after:SetupRender");
+ configuration.addInstance("IncludeStylesheet", IncludeStylesheetWorker.class,
+ "after:SetupRender");
configuration.addInstance("IncludeJavaScriptLibrary", IncludeJavaScriptLibraryWorker.class,
- "after:SetupRender");
+ "after:SetupRender");
- configuration.add("InvokePostRenderCleanupOnResources", new InvokePostRenderCleanupOnResourcesWorker());
+ configuration.add("InvokePostRenderCleanupOnResources",
+ new InvokePostRenderCleanupOnResourcesWorker());
configuration.add("ContentType", new ContentTypeWorker());
configuration.add("Property", new PropertyWorker());
- // These must come after Property, since they actually delete fields that may still have the annotation
- configuration.addInstance("ApplicationState", ApplicationStateWorker.class, "after:Property");
+ // These must come after Property, since they actually delete fields
+ // that may still have the annotation
+ configuration.addInstance("ApplicationState", ApplicationStateWorker.class,
+ "after:Property");
configuration.addInstance("Environment", EnvironmentalWorker.class, "after:Property");
configuration.addInstance("Log", LogWorker.class);
- // This one is always last. Any additional private fields that aren't annotated will
+ // This one is always last. Any additional private fields that aren't
+ // annotated will
// be converted to clear out at the end of the request.
configuration.add("UnclaimedField", new UnclaimedFieldWorker(), "after:*");
- configuration.add("PageActivationContext", new PageActivationContextWorker(), "before:OnEvent");
-
+ configuration.add("PageActivationContext", new PageActivationContextWorker(),
+ "before:OnEvent");
+
configuration.add("SessionAttribute", new SessionAttributeWorker(locator));
}
/**
- * <dl> <dt>Annotation</dt> <dd>Checks for {@link org.apache.tapestry5.beaneditor.DataType} annotation</dd>
- * <dt>Default (ordered last)</dt> <dd>{@link org.apache.tapestry5.internal.services.DefaultDataTypeAnalyzer}
- * service ({@link #contributeDefaultDataTypeAnalyzer(org.apache.tapestry5.ioc.MappedConfiguration)} })</dd> </dl>
- */
- public static void contributeDataTypeAnalyzer(OrderedConfiguration<DataTypeAnalyzer> configuration,
- @InjectService("DefaultDataTypeAnalyzer")
- DataTypeAnalyzer defaultDataTypeAnalyzer)
+ * <dl>
+ * <dt>Annotation</dt>
+ * <dd>Checks for {@link org.apache.tapestry5.beaneditor.DataType}
+ * annotation</dd>
+ * <dt>Default (ordered last)</dt>
+ * <dd>
+ * {@link org.apache.tapestry5.internal.services.DefaultDataTypeAnalyzer}
+ * service (
+ * {@link #contributeDefaultDataTypeAnalyzer(org.apache.tapestry5.ioc.MappedConfiguration)}
+ * )</dd>
+ * </dl>
+ */
+ public static void contributeDataTypeAnalyzer(
+ OrderedConfiguration<DataTypeAnalyzer> configuration,
+ @InjectService("DefaultDataTypeAnalyzer")
+ DataTypeAnalyzer defaultDataTypeAnalyzer)
{
configuration.add("Annotation", new AnnotationDataTypeAnalyzer());
configuration.add("Default", defaultDataTypeAnalyzer, "after:*");
}
/**
- * Maps property types to data type names: <ul> <li>String --> text <li>Number --> number <li>Enum --> enum
- * <li>Boolean --> boolean <li>Date --> date </ul>
+ * Maps property types to data type names:
+ * <ul>
+ * <li>String --> text
+ * <li>Number --> number
+ * <li>Enum --> enum
+ * <li>Boolean --> boolean
+ * <li>Date --> date
+ * </ul>
*/
- public static void contributeDefaultDataTypeAnalyzer(MappedConfiguration<Class, String> configuration)
+ public static void contributeDefaultDataTypeAnalyzer(
+ MappedConfiguration<Class, String> configuration)
{
- // This is a special case contributed to avoid exceptions when a property type can't be
+ // This is a special case contributed to avoid exceptions when a
+ // property type can't be
// matched. DefaultDataTypeAnalyzer converts the empty string to null.
configuration.add(Object.class, "");
@@ -599,33 +701,44 @@
addDisplayBlock(configuration, "longtext");
}
- private static void addEditBlock(Configuration<BeanBlockContribution> configuration, String dataType)
+ private static void addEditBlock(Configuration<BeanBlockContribution> configuration,
+ String dataType)
{
addEditBlock(configuration, dataType, dataType);
}
- private static void addEditBlock(Configuration<BeanBlockContribution> configuration, String dataType,
- String blockId)
+ private static void addEditBlock(Configuration<BeanBlockContribution> configuration,
+ String dataType, String blockId)
{
configuration.add(new BeanBlockContribution(dataType, "PropertyEditBlocks", blockId, true));
}
- private static void addDisplayBlock(Configuration<BeanBlockContribution> configuration, String dataType)
+ private static void addDisplayBlock(Configuration<BeanBlockContribution> configuration,
+ String dataType)
{
addDisplayBlock(configuration, dataType, dataType);
}
- private static void addDisplayBlock(Configuration<BeanBlockContribution> configuration, String dataType,
- String blockId)
+ private static void addDisplayBlock(Configuration<BeanBlockContribution> configuration,
+ String dataType, String blockId)
{
- configuration.add(new BeanBlockContribution(dataType, "PropertyDisplayBlocks", blockId, false));
+ configuration.add(new BeanBlockContribution(dataType, "PropertyDisplayBlocks", blockId,
+ false));
}
/**
- * Contributes the basic set of validators: <ul> <li>required</li> <li>minlength</li> <li>maxlength</li>
- * <li>min</li> <li>max</li> <li>regexp</li> </ul>
+ * Contributes the basic set of validators:
+ * <ul>
+ * <li>required</li>
+ * <li>minlength</li>
+ * <li>maxlength</li>
+ * <li>min</li>
+ * <li>max</li>
+ * <li>regexp</li>
+ * </ul>
*/
- public static void contributeFieldValidatorSource(MappedConfiguration<String, Validator> configuration)
+ public static void contributeFieldValidatorSource(
+ MappedConfiguration<String, Validator> configuration)
{
configuration.add("required", new Required());
configuration.add("minlength", new MinLength());
@@ -637,33 +750,48 @@
}
/**
- * Contributes the base set of injection providers: <dl> <dt>Default</dt> <dd>based on {@link
- * MasterObjectProvider}</dd> <dt>Block</dt> <dd>injects fields of type Block</dd> <dt>ComponentResources</dt>
- * <dd>give component access to its resources</dd> <dt>CommonResources</dt> <dd>access to properties of resources
- * (log, messages, etc.)</dd> <dt>Asset</dt> <dd>injection of assets (triggered via {@link Path} annotation), with
- * the path relative to the component class</dd> <dt>Service</dt> <dd>ordered last, for use when Inject is present
- * and nothing else works, matches field type against Tapestry IoC services</dd> </dl>
+ * Contributes the base set of injection providers:
+ * <dl>
+ * <dt>Default</dt>
+ * <dd>based on {@link MasterObjectProvider}</dd>
+ * <dt>Block</dt>
+ * <dd>injects fields of type Block</dd>
+ * <dt>ComponentResources</dt>
+ * <dd>give component access to its resources</dd>
+ * <dt>CommonResources</dt>
+ * <dd>access to properties of resources (log, messages, etc.)</dd>
+ * <dt>Asset</dt>
+ * <dd>injection of assets (triggered via {@link Path} annotation), with the
+ * path relative to the component class</dd>
+ * <dt>Service</dt>
+ * <dd>ordered last, for use when Inject is present and nothing else works,
+ * matches field type against Tapestry IoC services</dd>
+ * </dl>
*/
- public static void contributeInjectionProvider(OrderedConfiguration<InjectionProvider> configuration,
+ public static void contributeInjectionProvider(
+ OrderedConfiguration<InjectionProvider> configuration,
- MasterObjectProvider masterObjectProvider,
+ MasterObjectProvider masterObjectProvider,
- ObjectLocator locator,
+ ObjectLocator locator,
- SymbolSource symbolSource,
+ SymbolSource symbolSource,
- AssetSource assetSource)
+ AssetSource assetSource)
{
configuration.add("Default", new DefaultInjectionProvider(masterObjectProvider, locator));
configuration.add("ComponentResources", new ComponentResourcesInjectionProvider());
- // This comes after default, to deal with conflicts between injecting a String as the
+ // This comes after default, to deal with conflicts between injecting a
+ // String as the
// component id, and injecting a string with @Symbol or @Value.
- configuration.add("CommonResources", new CommonResourcesInjectionProvider(), "after:Default");
+ configuration.add("CommonResources", new CommonResourcesInjectionProvider(),
+ "after:Default");
- configuration.add("Asset", new AssetInjectionProvider(symbolSource, assetSource), "before:Default");
+ configuration.add("Asset", new AssetInjectionProvider(symbolSource, assetSource),
+ "before:Default");
configuration.add("Block", new BlockInjectionProvider(), "before:Default");
@@ -673,29 +801,44 @@
}
/**
- * Contributes two object providers: <dl> <dt>Alias</dt> <dd> Searches by type among {@linkplain AliasContribution
- * contributions} to the {@link Alias} service</dd> <dt>Asset<dt> <dd> Checks for the {@link Path} annotation, and
- * injects an {@link Asset}</dd> <dt>Service</dt> <dd>Injects based on the {@link Service} annotation, if
- * present</dd> </dl>
- */
- public static void contributeMasterObjectProvider(OrderedConfiguration<ObjectProvider> configuration,
-
- @Local
- final Alias alias,
-
- @InjectService("AssetObjectProvider")
- ObjectProvider assetObjectProvider)
- {
- // There's a nasty web of dependencies related to Alias; this wrapper class lets us
- // defer instantiating the Alias service implementation just long enough to defuse those
- // dependencies. The @Local annotation prevents a recursive call through the
- // MasterObjectProvider to resolve the Alias service itself; that is MasterObjectProvider
- // gets built using this proxy, then the proxy will trigger the construction of AliasImpl
- // (which itself needs MasterObjectProvider to resolve some dependencies).
+ * Contributes two object providers:
+ * <dl>
+ * <dt>Alias</dt>
+ * <dd>Searches by type among {@linkplain AliasContribution
+ * contributions} to the {@link Alias} service</dd>
+ * <dt>Asset
+ * <dt>
+ * <dd>Checks for the {@link Path} annotation, and injects an {@link Asset}</dd>
+ * <dt>Service</dt>
+ * <dd>Injects based on the {@link Service} annotation, if present</dd>
+ * </dl>
+ */
+ public static void contributeMasterObjectProvider(
+ OrderedConfiguration<ObjectProvider> configuration,
+
+ @Local
+ final Alias alias,
+
+ @InjectService("AssetObjectProvider")
+ ObjectProvider assetObjectProvider)
+ {
+ // There's a nasty web of dependencies related to Alias; this wrapper
+ // class lets us
+ // defer instantiating the Alias service implementation just long enough
+ // to defuse those
+ // dependencies. The @Local annotation prevents a recursive call through
+ // the
+ // MasterObjectProvider to resolve the Alias service itself; that is
+ // MasterObjectProvider
+ // gets built using this proxy, then the proxy will trigger the
+ // construction of AliasImpl
+ // (which itself needs MasterObjectProvider to resolve some
+ // dependencies).
ObjectProvider wrapper = new ObjectProvider()
{
- public <T> T provide(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator)
+ public <T> T provide(Class<T> objectType, AnnotationProvider annotationProvider,
+ ObjectLocator locator)
{
return alias.getObjectProvider().provide(objectType, annotationProvider, locator);
}
@@ -705,37 +848,43 @@
configuration.add("Asset", assetObjectProvider, "before:AnnotationBasedContributions");
- configuration.add("Service", new ServiceAnnotationObjectProvider(), "before:AnnotationBasedContributions");
+ configuration.add("Service", new ServiceAnnotationObjectProvider(),
+ "before:AnnotationBasedContributions");
}
-
/**
- * <dl> <dt>StoreIntoGlobals</dt> <dd>Stores the request and response into {@link
- * org.apache.tapestry5.services.RequestGlobals} at the start of the pipeline</dd> <dt>IgnoredPaths</dt>
- * <dd>Identifies requests that are known (via the IgnoredPathsFilter service's configuration) to be mapped to other
- * applications</dd> <dt>GZip</dt> <dd>Handles GZIP compression of response streams (if supported by client)</dd>
- */
- public void contributeHttpServletRequestHandler(OrderedConfiguration<HttpServletRequestFilter> configuration,
+ * <dl>
+ * <dt>StoreIntoGlobals</dt>
+ * <dd>Stores the request and response into
+ * {@link org.apache.tapestry5.services.RequestGlobals} at the start of the
+ * pipeline</dd>
+ * <dt>IgnoredPaths</dt>
+ * <dd>Identifies requests that are known (via the IgnoredPathsFilter
+ * service's configuration) to be mapped to other applications</dd>
+ * <dt>GZip</dt>
+ * <dd>Handles GZIP compression of response streams (if supported by client)
+ * </dd>
+ */
+ public void contributeHttpServletRequestHandler(
+ OrderedConfiguration<HttpServletRequestFilter> configuration,
- @Symbol(SymbolConstants.GZIP_COMPRESSION_ENABLED)
- boolean gzipCompressionEnabled,
+ @Symbol(SymbolConstants.GZIP_COMPRESSION_ENABLED)
+ boolean gzipCompressionEnabled,
- @Autobuild GZipFilter gzipFilter,
+ @Autobuild
+ GZipFilter gzipFilter,
- @InjectService("IgnoredPathsFilter")
- HttpServletRequestFilter ignoredPathsFilter)
+ @InjectService("IgnoredPathsFilter")
+ HttpServletRequestFilter ignoredPathsFilter)
{
configuration.add("IgnoredPaths", ignoredPathsFilter);
- configuration.add("GZIP",
- gzipCompressionEnabled ? gzipFilter : null,
- "after:IgnoredPaths");
+ configuration.add("GZIP", gzipCompressionEnabled ? gzipFilter : null, "after:IgnoredPaths");
HttpServletRequestFilter storeIntoGlobals = new HttpServletRequestFilter()
{
public boolean service(HttpServletRequest request, HttpServletResponse response,
- HttpServletRequestHandler handler)
- throws IOException
+ HttpServletRequestHandler handler) throws IOException
{
requestGlobals.storeServletRequestResponse(request, response);
@@ -747,29 +896,41 @@
}
/**
- * Continues a number of filters into the RequestHandler service: <dl> <dt>StaticFiles</dt> <dd>Checks to see if the
- * request is for an actual file, if so, returns true to let the servlet container process the request</dd>
- * <dt>CheckForUpdates</dt> <dd>Periodically fires events that checks to see if the file system sources for any
- * cached data has changed (see {@link org.apache.tapestry5.internal.services.CheckForUpdatesFilter}).
- * <dt>ErrorFilter</dt> <dd>Catches request errors and lets the {@link org.apache.tapestry5.services.RequestExceptionHandler}
- * handle them</dd> <dt>StoreIntoGlobals</dt> <dd>Stores the request and response into the {@link
- * org.apache.tapestry5.services.RequestGlobals} service (this is repeated at the end of the pipeline, in case any
- * filter substitutes the request or response). </dl>
- */
- public void contributeRequestHandler(OrderedConfiguration<RequestFilter> configuration, Context context,
-
- // @Inject not needed because its a long, not a String
- @Symbol(SymbolConstants.FILE_CHECK_INTERVAL)
- @IntermediateType(TimeInterval.class)
- long checkInterval,
-
- @Symbol(SymbolConstants.FILE_CHECK_UPDATE_TIMEOUT)
- @IntermediateType(TimeInterval.class)
- long updateTimeout,
+ * Continues a number of filters into the RequestHandler service:
+ * <dl>
+ * <dt>StaticFiles</dt>
+ * <dd>Checks to see if the request is for an actual file, if so, returns
+ * true to let the servlet container process the request</dd>
+ * <dt>CheckForUpdates</dt>
+ * <dd>Periodically fires events that checks to see if the file system
+ * sources for any cached data has changed (see
+ * {@link org.apache.tapestry5.internal.services.CheckForUpdatesFilter}).
+ * <dt>ErrorFilter</dt>
+ * <dd>Catches request errors and lets the
+ * {@link org.apache.tapestry5.services.RequestExceptionHandler} handle them
+ * </dd>
+ * <dt>StoreIntoGlobals</dt>
+ * <dd>Stores the request and response into the
+ * {@link org.apache.tapestry5.services.RequestGlobals} service (this is
+ * repeated at the end of the pipeline, in case any filter substitutes the
+ * request or response).
+ * </dl>
+ */
+ public void contributeRequestHandler(OrderedConfiguration<RequestFilter> configuration,
+ Context context,
+
+ // @Inject not needed because its a long, not a String
+ @Symbol(SymbolConstants.FILE_CHECK_INTERVAL)
+ @IntermediateType(TimeInterval.class)
+ long checkInterval,
- UpdateListenerHub updateListenerHub,
+ @Symbol(SymbolConstants.FILE_CHECK_UPDATE_TIMEOUT)
+ @IntermediateType(TimeInterval.class)
+ long updateTimeout,
- URLRewriter urlRewriter)
+ UpdateListenerHub updateListenerHub,
+
+ URLRewriter urlRewriter)
{
RequestFilter staticFilesFilter = new StaticFilesFilter(context);
@@ -801,9 +962,10 @@
};
configuration.add("CheckForUpdates", new CheckForUpdatesFilter(updateListenerHub,
- checkInterval, updateTimeout), "before:*");
+ checkInterval, updateTimeout), "before:*");
- // we just need the URLRewriterRequestFilter if we have URL rewriter rules, of course.
+ // we just need the URLRewriterRequestFilter if we have URL rewriter
+ // rules, of course.
if (urlRewriter.hasRequestRules())
{
@@ -817,31 +979,36 @@
configuration.addInstance("ErrorFilter", RequestErrorFilter.class);
- configuration.add(
- "StoreIntoGlobals",
- storeIntoGlobals,
- "after:StaticFiles",
+ configuration.add("StoreIntoGlobals", storeIntoGlobals, "after:StaticFiles",
"before:ErrorFilter");
- configuration.add(
- "EndOfRequest",
- fireEndOfRequestEvent,
- "after:StoreIntoGlobals",
+ configuration.add("EndOfRequest", fireEndOfRequestEvent, "after:StoreIntoGlobals",
"before:ErrorFilter");
}
/**
- * Contributes the basic set of translators: <ul> <li>string</li> <li>byte</li> <li>short</li> <li>integer</li>
- * <li>long</li> <li>float</li> <li>double</li> <li>BigInteger</li> <li>BigDecimal</li></ul>
+ * Contributes the basic set of translators:
+ * <ul>
+ * <li>string</li>
+ * <li>byte</li>
+ * <li>short</li>
+ * <li>integer</li>
+ * <li>long</li>
+ * <li>float</li>
+ * <li>double</li>
+ * <li>BigInteger</li>
+ * <li>BigDecimal</li>
+ * </ul>
*/
public static void contributeTranslatorSource(Configuration<Translator> configuration,
- NumericTranslatorSupport support)
+ NumericTranslatorSupport support)
{
configuration.add(new StringTranslator());
- Class[] types = new Class[] { Byte.class, Short.class, Integer.class, Long.class, Float.class, Double.class,
+ Class[] types = new Class[]
+ { Byte.class, Short.class, Integer.class, Long.class, Float.class, Double.class,
BigInteger.class, BigDecimal.class };
for (Class type : types)
@@ -852,40 +1019,53 @@
}
}
-
/**
- * Adds coercions: <ul> <li>String to {@link org.apache.tapestry5.SelectModel} <li>String to {@link
- * org.apache.tapestry5.corelib.data.InsertPosition} <li>Map to {@link org.apache.tapestry5.SelectModel}
- * <li>Collection to {@link GridDataSource} <li>null to {@link org.apache.tapestry5.grid.GridDataSource} <li>String
- * to {@link org.apache.tapestry5.corelib.data.GridPagerPosition} <li>List to {@link
- * org.apache.tapestry5.SelectModel} <li>{@link org.apache.tapestry5.runtime.ComponentResourcesAware} (typically, a
- * component) to {@link org.apache.tapestry5.ComponentResources} <li>String to {@link
- * org.apache.tapestry5.corelib.data.BlankOption} <li> {@link org.apache.tapestry5.ComponentResources} to {@link
- * org.apache.tapestry5.PropertyOverrides} <li>String to {@link org.apache.tapestry5.Renderable} <li>{@link
- * org.apache.tapestry5.Renderable} to {@link org.apache.tapestry5.Block} <li>String to {@link java.text.DateFormat}
- * <li>{@link org.apache.tapestry5.PrimaryKeyEncoder} to {@link org.apache.tapestry5.ValueEncoder} <li>String to
- * {@link org.apache.tapestry5.ioc.Resource} (via {@link org.apache.tapestry5.services.AssetSource#resourceForPath(String)})
- * <li>{@link org.apache.tapestry5.Renderable} to {@link org.apache.tapestry5.runtime.RenderCommand}</li> </ul>
+ * Adds coercions:
+ * <ul>
+ * <li>String to {@link org.apache.tapestry5.SelectModel}
+ * <li>String to {@link org.apache.tapestry5.corelib.data.InsertPosition}
+ * <li>Map to {@link org.apache.tapestry5.SelectModel}
+ * <li>Collection to {@link GridDataSource}
+ * <li>null to {@link org.apache.tapestry5.grid.GridDataSource}
+ * <li>String to {@link org.apache.tapestry5.corelib.data.GridPagerPosition}
+ * <li>List to {@link org.apache.tapestry5.SelectModel}
+ * <li>{@link org.apache.tapestry5.runtime.ComponentResourcesAware}
+ * (typically, a component) to
+ * {@link org.apache.tapestry5.ComponentResources}
+ * <li>String to {@link org.apache.tapestry5.corelib.data.BlankOption}
+ * <li> {@link org.apache.tapestry5.ComponentResources} to
+ * {@link org.apache.tapestry5.PropertyOverrides}
+ * <li>String to {@link org.apache.tapestry5.Renderable}
+ * <li>{@link org.apache.tapestry5.Renderable} to
+ * {@link org.apache.tapestry5.Block}
+ * <li>String to {@link java.text.DateFormat}
+ * <li>{@link org.apache.tapestry5.PrimaryKeyEncoder} to
+ * {@link org.apache.tapestry5.ValueEncoder}
+ * <li>String to {@link org.apache.tapestry5.ioc.Resource} (via
+ * {@link org.apache.tapestry5.services.AssetSource#resourceForPath(String)})
+ * <li>{@link org.apache.tapestry5.Renderable} to
+ * {@link org.apache.tapestry5.runtime.RenderCommand}</li>
+ * </ul>
*/
public static void contributeTypeCoercer(Configuration<CoercionTuple> configuration,
- @Builtin
- TypeCoercer coercer,
+ @Builtin
+ TypeCoercer coercer,
- @Builtin
- final ThreadLocale threadLocale,
+ @Builtin
+ final ThreadLocale threadLocale,
- @Core
- final AssetSource assetSource)
+ @Core
+ final AssetSource assetSource)
{
add(configuration, ComponentResources.class, PropertyOverrides.class,
- new Coercion<ComponentResources, PropertyOverrides>()
- {
- public PropertyOverrides coerce(ComponentResources input)
+ new Coercion<ComponentResources, PropertyOverrides>()
{
- return new PropertyOverridesImpl(input);
- }
- });
+ public PropertyOverrides coerce(ComponentResources input)
+ {
+ return new PropertyOverridesImpl(input);
+ }
+ });
add(configuration, String.class, SelectModel.class, new Coercion<String, SelectModel>()
{
@@ -904,13 +1084,14 @@
}
});
- add(configuration, Collection.class, GridDataSource.class, new Coercion<Collection, GridDataSource>()
- {
- public GridDataSource coerce(Collection input)
- {
- return new CollectionGridDataSource(input);
- }
- });
+ add(configuration, Collection.class, GridDataSource.class,
+ new Coercion<Collection, GridDataSource>()
+ {
+ public GridDataSource coerce(Collection input)
+ {
+ return new CollectionGridDataSource(input);
+ }
+ });
add(configuration, void.class, GridDataSource.class, new Coercion<Void, GridDataSource>()
{
@@ -922,14 +1103,17 @@
}
});
- add(configuration, String.class, GridPagerPosition.class,
- StringToEnumCoercion.create(GridPagerPosition.class));
+ add(configuration, String.class, GridPagerPosition.class, StringToEnumCoercion
+ .create(GridPagerPosition.class));
- add(configuration, String.class, InsertPosition.class, StringToEnumCoercion.create(InsertPosition.class));
+ add(configuration, String.class, InsertPosition.class, StringToEnumCoercion
+ .create(InsertPosition.class));
- add(configuration, String.class, BlankOption.class, StringToEnumCoercion.create(BlankOption.class));
+ add(configuration, String.class, BlankOption.class, StringToEnumCoercion
+ .create(BlankOption.class));
- add(configuration, String.class, LoopFormState.class, StringToEnumCoercion.create(LoopFormState.class));
+ add(configuration, String.class, LoopFormState.class, StringToEnumCoercion
+ .create(LoopFormState.class));
add(configuration, List.class, SelectModel.class, new Coercion<List, SelectModel>()
{
@@ -949,14 +1133,14 @@
});
add(configuration, ComponentResourcesAware.class, ComponentResources.class,
- new Coercion<ComponentResourcesAware, ComponentResources>()
- {
-
- public ComponentResources coerce(ComponentResourcesAware input)
+ new Coercion<ComponentResourcesAware, ComponentResources>()
{
- return input.getComponentResources();
- }
- });
+
+ public ComponentResources coerce(ComponentResourcesAware input)
+ {
+ return input.getComponentResources();
+ }
+ });
add(configuration, String.class, Renderable.class, new Coercion<String, Renderable>()
{
@@ -982,7 +1166,6 @@
}
});
-
add(configuration, String.class, Resource.class, new Coercion<String, Resource>()
{
public Resource coerce(String input)
@@ -991,22 +1174,24 @@
}
});
- add(configuration, Renderable.class, RenderCommand.class, new Coercion<Renderable, RenderCommand>()
- {
- public RenderCommand coerce(final Renderable input)
- {
- return new RenderCommand()
+ add(configuration, Renderable.class, RenderCommand.class,
+ new Coercion<Renderable, RenderCommand>()
{
- public void render(MarkupWriter writer, RenderQueue queue)
+ public RenderCommand coerce(final Renderable input)
{
- input.render(writer);
+ return new RenderCommand()
+ {
+ public void render(MarkupWriter writer, RenderQueue queue)
+ {
+ input.render(writer);
+ }
+ };
}
- };
- }
- });
+ });
+
+ add(configuration, PrimaryKeyEncoder.class, ValueEncoder.class,
+ new PrimaryKeyEncoder2ValueEncoder(coercer));
- add(configuration, PrimaryKeyEncoder.class, ValueEncoder.class, new PrimaryKeyEncoder2ValueEncoder(coercer));
-
add(configuration, Date.class, Calendar.class, new Coercion<Date, Calendar>()
{
public Calendar coerce(Date input)
@@ -1019,8 +1204,12 @@
}
/**
- * Adds built-in constraint generators: <ul> <li>PrimtiveField -- primitive fields are always required
- * <li>ValidateAnnotation -- adds constraints from a {@link Validate} annotation </ul>
+ * Adds built-in constraint generators:
+ * <ul>
+ * <li>PrimtiveField -- primitive fields are always required
+ * <li>ValidateAnnotation -- adds constraints from a {@link Validate}
+ * annotation
+ * </ul>
*/
public static void contributeValidationConstraintGenerator(
OrderedConfiguration<ValidationConstraintGenerator> configuration)
@@ -1030,8 +1219,8 @@
configuration.addInstance("Messages", MessagesConstraintGenerator.class);
}
- private static <S, T> void add(Configuration<CoercionTuple> configuration, Class<S> sourceType, Class<T> targetType,
- Coercion<S, T> coercion)
+ private static <S, T> void add(Configuration<CoercionTuple> configuration, Class<S> sourceType,
+ Class<T> targetType, Coercion<S, T> coercion)
{
CoercionTuple<S, T> tuple = new CoercionTuple<S, T>(sourceType, targetType, coercion);
@@ -1039,11 +1228,11 @@
}
private static void add(OrderedConfiguration<ComponentClassTransformWorker> configuration,
- Class<? extends Annotation> annotationClass,
- TransformMethodSignature lifecycleMethodSignature, String methodAlias)
+ Class<? extends Annotation> annotationClass,
+ TransformMethodSignature lifecycleMethodSignature, String methodAlias)
{
ComponentClassTransformWorker worker = new PageLifecycleAnnotationWorker(annotationClass,
- lifecycleMethodSignature, methodAlias);
+ lifecycleMethodSignature, methodAlias);
String name = TapestryInternalUtils.lastTerm(annotationClass.getName());
@@ -1051,8 +1240,8 @@
}
private static void add(OrderedConfiguration<ComponentClassTransformWorker> configuration,
- TransformMethodSignature signature, Class<? extends Annotation> annotationClass,
- boolean reverse)
+ TransformMethodSignature signature, Class<? extends Annotation> annotationClass,
+ boolean reverse)
{
// make the name match the annotation class name.
@@ -1072,10 +1261,12 @@
return shadowBuilder.build(globals, "context", Context.class);
}
- public static ComponentClassResolver buildComponentClassResolver(@Autobuild ComponentClassResolverImpl service,
- @ComponentClasses InvalidationEventHub hub)
+ public static ComponentClassResolver buildComponentClassResolver(@Autobuild
+ ComponentClassResolverImpl service, @ComponentClasses
+ InvalidationEventHub hub)
{
- // Allow the resolver to clean its cache when the component classes change
+ // Allow the resolver to clean its cache when the component classes
+ // change
hub.addInvalidationListener(service);
@@ -1083,10 +1274,11 @@
}
@Marker(ClasspathProvider.class)
- public AssetFactory buildClasspathAssetFactory(ResourceCache resourceCache, ClasspathAssetAliasManager aliasManager,
- AssetPathConverter converter)
+ public AssetFactory buildClasspathAssetFactory(ResourceCache resourceCache,
+ ClasspathAssetAliasManager aliasManager, AssetPathConverter converter)
{
- ClasspathAssetFactory factory = new ClasspathAssetFactory(resourceCache, aliasManager, converter);
+ ClasspathAssetFactory factory = new ClasspathAssetFactory(resourceCache, aliasManager,
+ converter);
resourceCache.addInvalidationListener(factory);
@@ -1096,27 +1288,33 @@
@Marker(ContextProvider.class)
public AssetFactory buildContextAssetFactory(ApplicationGlobals globals,
- @Inject @Symbol(SymbolConstants.APPLICATION_VERSION)
- String applicationVersion,
+ @Inject
+ @Symbol(SymbolConstants.APPLICATION_VERSION)
+ String applicationVersion,
- AssetPathConverter converter)
+ AssetPathConverter converter)
{
return new ContextAssetFactory(request, globals.getContext(), applicationVersion, converter);
}
/**
- * Builds the PropBindingFactory as a chain of command. The terminator of the chain is responsible for ordinary
+ * Builds the PropBindingFactory as a chain of command. The terminator of
+ * the chain is responsible for ordinary
* property names (and property paths).
* <p/>
- * This mechanism has been replaced in 5.1 with a more sophisticated parser based on ANTLR. See <a
- * href="https://issues.apache.org/jira/browse/TAP5-79">TAP5-79</a> for details. There are no longer any built-in
- * contributions to the configuration.
- *
- * @param configuration contributions of special factories for some constants, each contributed factory may return a
- * binding if applicable, or null otherwise
+ * This mechanism has been replaced in 5.1 with a more sophisticated parser
+ * based on ANTLR. See <a
+ * href="https://issues.apache.org/jira/browse/TAP5-79">TAP5-79</a> for
+ * details. There are no longer any built-in contributions to the
+ * configuration.
+ *
+ * @param configuration
+ * contributions of special factories for some constants, each
+ * contributed factory may return a
+ * binding if applicable, or null otherwise
*/
- public BindingFactory buildPropBindingFactory(List<BindingFactory> configuration,
- @Autobuild PropBindingFactory service)
+ public BindingFactory buildPropBindingFactory(List<BindingFactory> configuration, @Autobuild
+ PropBindingFactory service)
{
configuration.add(service);
@@ -1124,35 +1322,39 @@
}
/**
- * Builds the source of {@link Messages} containing validation messages. The contributions are paths to message
- * bundles (resource paths within the classpath); the default contribution is "org/apache/tapestry5/internal/ValidationMessages".
+ * Builds the source of {@link Messages} containing validation messages. The
+ * contributions are paths to message
+ * bundles (resource paths within the classpath); the default contribution
+ * is "org/apache/tapestry5/internal/ValidationMessages".
*/
public ValidationMessagesSource buildValidationMessagesSource(List<String> configuration,
- UpdateListenerHub updateListenerHub,
+ UpdateListenerHub updateListenerHub,
- @ClasspathProvider AssetFactory classpathAssetFactory,
+ @ClasspathProvider
+ AssetFactory classpathAssetFactory,
- ClasspathURLConverter classpathURLConverter)
+ ClasspathURLConverter classpathURLConverter)
{
ValidationMessagesSourceImpl service = new ValidationMessagesSourceImpl(configuration,
- classpathAssetFactory.getRootResource(),
- classpathURLConverter);
+ classpathAssetFactory.getRootResource(), classpathURLConverter);
updateListenerHub.addUpdateListener(service);
return service;
}
- public static MetaDataLocator buildMetaDataLocator(@Autobuild MetaDataLocatorImpl service,
- @ComponentClasses InvalidationEventHub hub)
+ public static MetaDataLocator buildMetaDataLocator(@Autobuild
+ MetaDataLocatorImpl service, @ComponentClasses
+ InvalidationEventHub hub)
{
hub.addInvalidationListener(service);
return service;
}
- public PersistentFieldStrategy buildClientPersistentFieldStrategy(LinkCreationHub linkCreationHub,
- @Autobuild ClientPersistentFieldStrategy service)
+ public PersistentFieldStrategy buildClientPersistentFieldStrategy(
+ LinkCreationHub linkCreationHub, @Autobuild
+ ClientPersistentFieldStrategy service)
{
linkCreationHub.addListener(service);
@@ -1160,8 +1362,8 @@
}
/**
- * Builds a proxy to the current {@link org.apache.tapestry5.RenderSupport} inside this thread's {@link
- * org.apache.tapestry5.services.Environment}.
+ * Builds a proxy to the current {@link org.apache.tapestry5.RenderSupport}
+ * inside this thread's {@link org.apache.tapestry5.services.Environment}.
*/
public RenderSupport buildRenderSupport()
{
@@ -1169,9 +1371,10 @@
}
/**
- * Builds a proxy to the current {@link org.apache.tapestry5.services.ClientBehaviorSupport} inside this thread's
- * {@link org.apache.tapestry5.services.Environment}.
- *
+ * Builds a proxy to the current
+ * {@link org.apache.tapestry5.services.ClientBehaviorSupport} inside this
+ * thread's {@link org.apache.tapestry5.services.Environment}.
+ *
* @since 5.1.0.1
*/
@@ -1181,8 +1384,9 @@
}
/**
- * Builds a proxy to the current {@link org.apache.tapestry5.services.FormSupport} inside this thread's {@link
- * org.apache.tapestry5.services.Environment}.
+ * Builds a proxy to the current
+ * {@link org.apache.tapestry5.services.FormSupport} inside this thread's
+ * {@link org.apache.tapestry5.services.Environment}.
*/
public FormSupport buildFormSupport()
{
@@ -1190,7 +1394,8 @@
}
/**
- * Allows the exact steps in the component class transformation process to be defined.
+ * Allows the exact steps in the component class transformation process to
+ * be defined.
*/
public ComponentClassTransformWorker buildComponentClassTransformWorker(
List<ComponentClassTransformWorker> configuration)
@@ -1199,9 +1404,11 @@
}
/**
- * Analyzes properties to determine the data types, used to {@linkplain #contributeBeanBlockSource(org.apache.tapestry5.ioc.Configuration)}
- * locale display and edit blocks} for properties. The default behaviors look for a {@link
- * org.apache.tapestry5.beaneditor.DataType} annotation before deriving the data type from the property type.
+ * Analyzes properties to determine the data types, used to
+ * {@linkplain #contributeBeanBlockSource(org.apache.tapestry5.ioc.Configuration)}
+ * locale display and edit blocks} for properties. The default behaviors
+ * look for a {@link org.apache.tapestry5.beaneditor.DataType} annotation
+ * before deriving the data type from the property type.
*/
@Marker(Primary.class)
public DataTypeAnalyzer buildDataTypeAnalyzer(List<DataTypeAnalyzer> configuration)
@@ -1210,8 +1417,10 @@
}
/**
- * A chain of command for providing values for {@link Inject}-ed fields in component classes. The service's
- * configuration can be extended to allow for different automatic injections (based on some combination of field
+ * A chain of command for providing values for {@link Inject}-ed fields in
+ * component classes. The service's
+ * configuration can be extended to allow for different automatic injections
+ * (based on some combination of field
* type and field name).
*/
@@ -1220,67 +1429,71 @@
return chainBuilder.build(InjectionProvider.class, configuration);
}
-
/**
- * Initializes the application, using a pipeline of {@link org.apache.tapestry5.services.ApplicationInitializer}s.
+ * Initializes the application, using a pipeline of
+ * {@link org.apache.tapestry5.services.ApplicationInitializer}s.
*/
@Marker(Primary.class)
public ApplicationInitializer buildApplicationInitializer(Logger logger,
- List<ApplicationInitializerFilter> configuration)
+ List<ApplicationInitializerFilter> configuration)
{
ApplicationInitializer terminator = new ApplicationInitializerTerminator();
- return pipelineBuilder.build(logger, ApplicationInitializer.class, ApplicationInitializerFilter.class,
- configuration, terminator);
+ return pipelineBuilder.build(logger, ApplicationInitializer.class,
+ ApplicationInitializerFilter.class, configuration, terminator);
}
public HttpServletRequestHandler buildHttpServletRequestHandler(Logger logger,
- List<HttpServletRequestFilter> configuration,
+ List<HttpServletRequestFilter> configuration,
- @Primary
- RequestHandler handler,
+ @Primary
+ RequestHandler handler,
- @Inject @Symbol(SymbolConstants.CHARSET)
- String applicationCharset,
+ @Inject
+ @Symbol(SymbolConstants.CHARSET)
+ String applicationCharset,
- @Primary
- SessionPersistedObjectAnalyzer analyzer)
+ @Primary
+ SessionPersistedObjectAnalyzer analyzer)
{
- HttpServletRequestHandler terminator = new HttpServletRequestHandlerTerminator(handler, applicationCharset,
- analyzer);
+ HttpServletRequestHandler terminator = new HttpServletRequestHandlerTerminator(handler,
+ applicationCharset, analyzer);
- return pipelineBuilder.build(logger, HttpServletRequestHandler.class, HttpServletRequestFilter.class,
- configuration, terminator);
+ return pipelineBuilder.build(logger, HttpServletRequestHandler.class,
+ HttpServletRequestFilter.class, configuration, terminator);
}
@Marker(Primary.class)
public RequestHandler buildRequestHandler(Logger logger, List<RequestFilter> configuration,
- @Primary
- Dispatcher masterDispatcher)
+ @Primary
+ Dispatcher masterDispatcher)
{
RequestHandler terminator = new RequestHandlerTerminator(masterDispatcher);
- return pipelineBuilder.build(logger, RequestHandler.class, RequestFilter.class, configuration, terminator);
+ return pipelineBuilder.build(logger, RequestHandler.class, RequestFilter.class,
+ configuration, terminator);
}
public ServletApplicationInitializer buildServletApplicationInitializer(Logger logger,
- List<ServletApplicationInitializerFilter> configuration,
+ List<ServletApplicationInitializerFilter> configuration,
- @Primary
- ApplicationInitializer initializer)
+ @Primary
+ ApplicationInitializer initializer)
{
- ServletApplicationInitializer terminator = new ServletApplicationInitializerTerminator(initializer);
+ ServletApplicationInitializer terminator = new ServletApplicationInitializerTerminator(
+ initializer);
return pipelineBuilder.build(logger, ServletApplicationInitializer.class,
- ServletApplicationInitializerFilter.class, configuration, terminator);
+ ServletApplicationInitializerFilter.class, configuration, terminator);
}
/**
* The component event result processor used for normal component requests.
*/
- @Marker({ Primary.class, Traditional.class })
+ @Marker(
+ { Primary.class, Traditional.class })
public ComponentEventResultProcessor buildComponentEventResultProcessor(
Map<Class, ComponentEventResultProcessor> configuration)
{
@@ -1288,7 +1501,8 @@
}
/**
- * The component event result processor used for Ajax-oriented component requests.
+ * The component event result processor used for Ajax-oriented component
+ * requests.
*/
@Marker(Ajax.class)
public ComponentEventResultProcessor buildAjaxComponentEventResultProcessor(
@@ -1313,19 +1527,23 @@
}
/**
- * The default data type analyzer is the final analyzer consulted and identifies the type entirely pased on the
- * property type, working against its own configuration (mapping property type class to data type).
- */
- public static DataTypeAnalyzer buildDefaultDataTypeAnalyzer(@Autobuild DefaultDataTypeAnalyzer service,
- @ComponentClasses InvalidationEventHub hub)
+ * The default data type analyzer is the final analyzer consulted and
+ * identifies the type entirely pased on the
+ * property type, working against its own configuration (mapping property
+ * type class to data type).
+ */
+ public static DataTypeAnalyzer buildDefaultDataTypeAnalyzer(@Autobuild
+ DefaultDataTypeAnalyzer service, @ComponentClasses
+ InvalidationEventHub hub)
{
hub.addInvalidationListener(service);
return service;
}
- public static TranslatorSource buildTranslatorSource(@Autobuild TranslatorSourceImpl service,
- @ComponentClasses InvalidationEventHub hub)
+ public static TranslatorSource buildTranslatorSource(@Autobuild
+ TranslatorSourceImpl service, @ComponentClasses
+ InvalidationEventHub hub)
{
hub.addInvalidationListener(service);
@@ -1338,13 +1556,17 @@
return strategyBuilder.build(ObjectRenderer.class, configuration);
}
-
/**
- * Returns a {@link org.apache.tapestry5.ioc.services.ClassFactory} that can be used to create extra classes around
- * component classes. This ClassFactory will be cleared whenever an underlying component class is discovered to have
- * changed. Use of this class factory implies that your code will become aware of this (if necessary) to discard any
- * cached object (alas, this currently involves dipping into the internals side to register for the correct
- * notifications). Failure to properly clean up can result in really nasty PermGen space memory leaks.
+ * Returns a {@link org.apache.tapestry5.ioc.services.ClassFactory} that can
+ * be used to create extra classes around
+ * component classes. This ClassFactory will be cleared whenever an
+ * underlying component class is discovered to have
+ * changed. Use of this class factory implies that your code will become
+ * aware of this (if necessary) to discard any
+ * cached object (alas, this currently involves dipping into the internals
+ * side to register for the correct
+ * notifications). Failure to properly clean up can result in really nasty
+ * PermGen space memory leaks.
*/
@Marker(ComponentLayer.class)
public ClassFactory buildComponentClassFactory(ComponentInstantiatorSource source)
@@ -1352,9 +1574,9 @@
return shadowBuilder.build(source, "classFactory", ClassFactory.class);
}
-
/**
- * Ordered contributions to the MasterDispatcher service allow different URL matching strategies to occur.
+ * Ordered contributions to the MasterDispatcher service allow different URL
+ * matching strategies to occur.
*/
@Marker(Primary.class)
public Dispatcher buildMasterDispatcher(List<Dispatcher> configuration)
@@ -1362,8 +1584,9 @@
return chainBuilder.build(Dispatcher.class, configuration);
}
- public PropertyConduitSource buildPropertyConduitSource(@Autobuild PropertyConduitSourceImpl service,
- @ComponentClasses InvalidationEventHub hub)
+ public PropertyConduitSource buildPropertyConduitSource(@Autobuild
+ PropertyConduitSourceImpl service, @ComponentClasses
+ InvalidationEventHub hub)
{
hub.addInvalidationListener(service);
@@ -1371,7 +1594,8 @@
}
/**
- * Builds a shadow of the RequestGlobals.request property. Note again that the shadow can be an ordinary singleton,
+ * Builds a shadow of the RequestGlobals.request property. Note again that
+ * the shadow can be an ordinary singleton,
* even though RequestGlobals is perthread.
*/
public Request buildRequest()
@@ -1380,8 +1604,9 @@
}
/**
- * Builds a shadow of the RequestGlobals.HTTPServletRequest property. Generally, you should inject the {@link
- * Request} service instead, as future version of Tapestry may operate beyond just the servlet API.
+ * Builds a shadow of the RequestGlobals.HTTPServletRequest property.
+ * Generally, you should inject the {@link Request} service instead, as
+ * future version of Tapestry may operate beyond just the servlet API.
*/
public HttpServletRequest buildHttpServletRequest()
{
@@ -1393,11 +1618,13 @@
*/
public HttpServletResponse buildHttpServletResponse()
{
- return shadowBuilder.build(requestGlobals, "HTTPServletResponse", HttpServletResponse.class);
+ return shadowBuilder
+ .build(requestGlobals, "HTTPServletResponse", HttpServletResponse.class);
}
/**
- * Builds a shadow of the RequestGlobals.response property. Note again that the shadow can be an ordinary singleton,
+ * Builds a shadow of the RequestGlobals.response property. Note again that
+ * the shadow can be an ordinary singleton,
* even though RequestGlobals is perthread.
*/
public Response buildResponse()
@@ -1405,70 +1632,77 @@
return shadowBuilder.build(requestGlobals, "response", Response.class);
}
-
/**
- * The MarkupRenderer service is used to render a full page as markup. Supports an ordered configuration of {@link
- * org.apache.tapestry5.services.MarkupRendererFilter}s.
- */
- public MarkupRenderer buildMarkupRenderer(Logger logger,
- @Autobuild MarkupRendererTerminator terminator,
- List<MarkupRendererFilter> configuration)
- {
- return pipelineBuilder.build(logger, MarkupRenderer.class, MarkupRendererFilter.class, configuration,
- terminator);
+ * The MarkupRenderer service is used to render a full page as markup.
+ * Supports an ordered configuration of
+ * {@link org.apache.tapestry5.services.MarkupRendererFilter}s.
+ */
+ public MarkupRenderer buildMarkupRenderer(Logger logger, @Autobuild
+ MarkupRendererTerminator terminator, List<MarkupRendererFilter> configuration)
+ {
+ return pipelineBuilder.build(logger, MarkupRenderer.class, MarkupRendererFilter.class,
+ configuration, terminator);
}
/**
- * A wrapper around {@link org.apache.tapestry5.internal.services.PageRenderQueue} used for partial page renders.
- * Supports an ordered configuration of {@link org.apache.tapestry5.services.PartialMarkupRendererFilter}s.
- *
- * @see #contributePartialMarkupRenderer(org.apache.tapestry5.ioc.OrderedConfiguration, org.apache.tapestry5.Asset,
+ * A wrapper around
+ * {@link org.apache.tapestry5.internal.services.PageRenderQueue} used for
+ * partial page renders.
+ * Supports an ordered configuration of
+ * {@link org.apache.tapestry5.services.PartialMarkupRendererFilter}s.
+ *
+ * @see #contributePartialMarkupRenderer(org.apache.tapestry5.ioc.OrderedConfiguration,
+ * org.apache.tapestry5.Asset,
* org.apache.tapestry5.ioc.services.SymbolSource, AssetSource)
*/
public PartialMarkupRenderer buildPartialMarkupRenderer(Logger logger,
- List<PartialMarkupRendererFilter> configuration,
- @Autobuild PartialMarkupRendererTerminator terminator)
+ List<PartialMarkupRendererFilter> configuration, @Autobuild
+ PartialMarkupRendererTerminator terminator)
{
- return pipelineBuilder.build(logger, PartialMarkupRenderer.class, PartialMarkupRendererFilter.class,
- configuration, terminator);
+ return pipelineBuilder.build(logger, PartialMarkupRenderer.class,
+ PartialMarkupRendererFilter.class, configuration, terminator);
}
public PageRenderRequestHandler buildPageRenderRequestHandler(
- List<PageRenderRequestFilter> configuration,
- Logger logger,
- @Autobuild PageRenderRequestHandlerImpl terminator)
+ List<PageRenderRequestFilter> configuration, Logger logger, @Autobuild
+ PageRenderRequestHandlerImpl terminator)
{
- return pipelineBuilder.build(logger, PageRenderRequestHandler.class, PageRenderRequestFilter.class,
- configuration, terminator);
+ return pipelineBuilder.build(logger, PageRenderRequestHandler.class,
+ PageRenderRequestFilter.class, configuration, terminator);
}
-
/**
- * Builds the component action request handler for traditional (non-Ajax) requests. These typically result in a
+ * Builds the component action request handler for traditional (non-Ajax)
+ * requests. These typically result in a
* redirect to a Tapestry render URL.
*/
- @Marker({ Traditional.class, Primary.class })
+ @Marker(
+ { Traditional.class, Primary.class })
public ComponentEventRequestHandler buildComponentEventRequestHandler(
- List<ComponentEventRequestFilter> configuration, Logger logger,
- @Autobuild ComponentEventRequestHandlerImpl terminator)
+ List<ComponentEventRequestFilter> configuration, Logger logger, @Autobuild
+ ComponentEventRequestHandlerImpl terminator)
{
- return pipelineBuilder.build(logger, ComponentEventRequestHandler.class, ComponentEventRequestFilter.class,
- configuration, terminator);
+ return pipelineBuilder.build(logger, ComponentEventRequestHandler.class,
+ ComponentEventRequestFilter.class, configuration, terminator);
}
/**
- * Builds the action request handler for Ajax requests, based on a {@linkplain org.apache.tapestry5.ioc.services.PipelineBuilder
- * pipeline} around {@link org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler}. Filters on the
+ * Builds the action request handler for Ajax requests, based on a
+ * {@linkplain org.apache.tapestry5.ioc.services.PipelineBuilder
+ * pipeline} around
+ * {@link org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler}
+ * . Filters on the
* request handler are supported here as well.
*/
- @Marker({ Ajax.class, Primary.class })
+ @Marker(
+ { Ajax.class, Primary.class })
public ComponentEventRequestHandler buildAjaxComponentEventRequestHandler(
- List<ComponentEventRequestFilter> configuration, Logger logger,
- @Autobuild AjaxComponentEventRequestHandler terminator)
+ List<ComponentEventRequestFilter> configuration, Logger logger, @Autobuild
+ AjaxComponentEventRequestHandler terminator)
{
- return pipelineBuilder.build(logger, ComponentEventRequestHandler.class, ComponentEventRequestFilter.class,
- configuration, terminator);
+ return pipelineBuilder.build(logger, ComponentEventRequestHandler.class,
+ ComponentEventRequestFilter.class, configuration, terminator);
}
// ========================================================================
@@ -1490,29 +1724,42 @@
}
public void contributeAssetSource(MappedConfiguration<String, AssetFactory> configuration,
- @ContextProvider AssetFactory contextAssetFactory,
+ @ContextProvider
+ AssetFactory contextAssetFactory,
- @ClasspathProvider AssetFactory classpathAssetFactory)
+ @ClasspathProvider
+ AssetFactory classpathAssetFactory)
{
configuration.add("context", contextAssetFactory);
configuration.add("classpath", classpathAssetFactory);
}
/**
- * Contributes handlers for the following types: <dl> <dt>Object</dt> <dd>Failure case, added to provide a more
- * useful exception message</dd> <dt>{@link Link}</dt> <dd>Sends a redirect to the link (which is typically a page
- * render link)</dd> <dt>String</dt> <dd>Sends a page render redirect</dd> <dt>Class</dt> <dd>Interpreted as the
- * class name of a page, sends a page render render redirect (this is more refactoring safe than the page name)</dd>
- * <dt>{@link Component}</dt> <dd>A page's root component (though a non-root component will work, but will generate
- * a warning). A direct to the containing page is sent.</dd> <dt>{@link org.apache.tapestry5.StreamResponse}</dt>
- * <dd>The stream response is sent as the actual reply.</dd> <dt>URL</dt> <dd>Sends a redirect to a (presumably)
- * external URL</dd> </dl>
- */
- public void contributeComponentEventResultProcessor(
- @Traditional @ComponentInstanceProcessor
- ComponentEventResultProcessor componentInstanceProcessor,
+ * Contributes handlers for the following types:
+ * <dl>
+ * <dt>Object</dt>
+ * <dd>Failure case, added to provide a more useful exception message</dd>
+ * <dt>{@link Link}</dt>
+ * <dd>Sends a redirect to the link (which is typically a page render link)</dd>
+ * <dt>String</dt>
+ * <dd>Sends a page render redirect</dd>
+ * <dt>Class</dt>
+ * <dd>Interpreted as the class name of a page, sends a page render render
+ * redirect (this is more refactoring safe than the page name)</dd>
+ * <dt>{@link Component}</dt>
[... 1155 lines stripped ...]