Author: buildbot
Date: Tue Dec 30 19:20:20 2014
New Revision: 934458
Log:
Production update by buildbot for tapestry
Modified:
websites/production/tapestry/content/cache/main.pageCache
websites/production/tapestry/content/injection-in-detail.html
Modified: websites/production/tapestry/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/tapestry/content/injection-in-detail.html
==============================================================================
--- websites/production/tapestry/content/injection-in-detail.html (original)
+++ websites/production/tapestry/content/injection-in-detail.html Tue Dec 30
19:20:20 2014
@@ -74,11 +74,7 @@ table.ScrollbarTable td.ScrollbarParent
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width:
16px;border: none;}
-/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td
colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect"
href="strategybuilder-service.html"><img align="middle" border="0"
src="https://cwiki.apache.org/confluence/images/icons/back_16.gif" width="16"
height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName"
width="33%"><a shape="rect" href="strategybuilder-service.html">StrategyBuilder
Service</a> </td><td colspan="1" rowspan="1" class="ScrollbarParent"
width="33%"><sup><a shape="rect" href="ioc.html"><img align="middle" border="0"
src="https://cwiki.apache.org/confluence/images/icons/up_16.gif" width="8"
height="8"></a></sup><a shape="rect" href="ioc.html">IoC</a></td><td
colspan="1" rowspan="1" class="ScrollbarNextName" width="33%"> <a
shape="rect" href="object-providers.html">Object Providers</a></td><td
colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect"
href="object-providers.html"><img align="middle"
border="0" src="https://cwiki.apache.org/confluence/images/icons/forwd_16.gif"
width="16" height="16"></a></td></tr></table></div>
-
-<h1 id="InjectioninDetail-InjectioninDetail">Injection in Detail</h1>
-
-<div class="navmenu" style="float:right; background:#eee; margin:3px;
padding:3px">
+/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td
colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect"
href="strategybuilder-service.html"><img align="middle" border="0"
src="https://cwiki.apache.org/confluence/images/icons/back_16.gif" width="16"
height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName"
width="33%"><a shape="rect" href="strategybuilder-service.html">StrategyBuilder
Service</a> </td><td colspan="1" rowspan="1" class="ScrollbarParent"
width="33%"><sup><a shape="rect" href="ioc.html"><img align="middle" border="0"
src="https://cwiki.apache.org/confluence/images/icons/up_16.gif" width="8"
height="8"></a></sup><a shape="rect" href="ioc.html">IoC</a></td><td
colspan="1" rowspan="1" class="ScrollbarNextName" width="33%"> <a
shape="rect" href="object-providers.html">Object Providers</a></td><td
colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect"
href="object-providers.html"><img align="middle"
border="0" src="https://cwiki.apache.org/confluence/images/icons/forwd_16.gif"
width="16" height="16"></a></td></tr></table></div><h1
id="InjectioninDetail-InjectioninDetail">Injection in Detail</h1><div
class="navmenu" style="float:right; background:#eee; margin:3px; padding:3px">
<h3>Related Articles</h3>
<ul class="content-by-label"><li>
<div>
@@ -94,7 +90,7 @@ table.ScrollbarTable td.ScrollbarNextIco
<span class="icon icon-page" title="Page">Page:</span>
</div>
<div class="details">
- <a shape="rect"
href="injection-in-detail.html">Injection in Detail</a>
+ <a shape="rect"
href="injection-faq.html">Injection FAQ</a>
</div>
@@ -103,177 +99,37 @@ table.ScrollbarTable td.ScrollbarNextIco
<span class="icon icon-page" title="Page">Page:</span>
</div>
<div class="details">
- <a shape="rect"
href="injection-faq.html">Injection FAQ</a>
+ <a shape="rect"
href="injection-in-detail.html">Injection in Detail</a>
</div>
</li></ul>
-</div>
-
-<p>Injection in Tapestry IoC can be a complicated subject for a number of
reasons:</p>
-
-<ul><li>Injection can occur in many places: on fields, and on parameters to
methods and constructors of certain objects.</li><li>Parts of Injection are
themselves defined in terms of Tapestry IoC services, many of which are
extensible.</li></ul>
-
-
-<p>Despite this, injection generally <em>Just Works</em>: most of the time,
you want Tapestry to inject a service, and only a single service implements the
service interface.</p>
-
-<p>This document discusses what to do when you hit a case that doesn't Just
Work, or when you want to extend the injection logic in some way.</p>
-
-<p>Some aspects of this discussion reflect Tapestry IoC used within a Tapestry
web application: the tapestry-core module makes some extensions to
injection.</p>
-
-<h1 id="InjectioninDetail-InjectionTriggers">Injection Triggers</h1>
-
-<p>Injection is triggered in a number of ways:</p>
-
-<ul><li>A field in a component class, autobuilt object, or service
implementation class the @<a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Inject.html">Inject</a>
annotation.</li><li>A method parameter to a service builder method, a
decorator method, or a contribute method (in a Tapestry IoC module
class).</li><li>A constructor parameter to an autobuilt object, or a service
implementation class.</li><li>Any of the above with an @<a shape="rect"
class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/InjectService.html">InjectService</a>
annotation.</li></ul>
-
-
-<p>Injection also covers a related matter: providing special resources to a
service or component. For a service, the service's id (as a string) or
extensible configuration (as a Collection, List or Map) may be provided. For a
component, the component's id, locale, message catalog, or component resources
may be provided.</p>
-
-<h1 id="InjectioninDetail-StandardInjectionProcessing">Standard Injection
Processing</h1>
-
-<p>This section describes standard injection, which applies at the IoC layer:
autobuild objects and service implementations. The steps for injection into
Tapestry components are slightly different and are covered later.</p>
-
-<p>So a the point of injection, Tapestry has identified a field or parameter
that should be injected. At this point, Tapestry knows the following:</p>
-
-<ul><li>The field name (if field injection). The parameter name is not
available.</li><li>The field or parameter type, as a Java class. In many cases,
this will be enough to identify what object shall be injected.</li><li>Any
additional annotations on the field or parameter.</li></ul>
-
-
-<p>Tapestry proceeds with this information.</p>
-
-<h2 id="InjectioninDetail-Checkfor@InjectService">Check for @InjectService</h2>
-
-<p>Tapestry checks first for the @InjectService annotation. The value of this
annotation is the service id to inject. When @InjectService is present at the
point of injection, that process is done, though it can fail if the service id
indicated does not exist, or if the service's interface is not compatible with
the field's type.</p>
-
-<h2 id="InjectioninDetail-Checkforserviceresources">Check for service
resources</h2>
-
-<p>This step applies only to IoC layer injection (not to injection into
components).</p>
-
-<p>When the @Inject annotation is <em>not present</em> at the point of
injection, Tapestry checks to see if a resource can be injected. When the
Inject annotation is present, this step is skipped (this is necessary when the
object to be injected has a type that conflicts with a resource type, such as
List or Class).</p>
-
-<ul><li>org.slf4j.Logger – The Logger of the service being constructed
(or the logger of the Module class being instantiated).</li><li><a shape="rect"
class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/ObjectLocator.html">ObjectLocator</a>
– For contribute methods, used to locate additional objects.</li><li><a
shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/ServiceResources.html">ServiceResources</a>
– For service builder methods, an extended version of ObjectLocator.
Class The service interface type.</li><li><a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/OperationTracker.html">OperationTracker</a>
– Used to track deeply nested operations so that errors can be reported
sensibly.</li><li>Object, or service interface type – Passed to decorator
methods.</li><li>Collection, List, Map ̵
1; Assembled service configurations passed to service builder methods (or
service class constructors).</li><li>Configuration, OrderedConfiguration,
MappedConfiguration – Configuration passed to contribute methods, to
build service configurations.
-<br clear="none" class="atl-forced-newline"> <br clear="none"
class="atl-forced-newline">
-If field type does not match any of the available resource types, or the
Inject annotation is present, logic continues to the next step.
-<br clear="none" class="atl-forced-newline"> <br clear="none"
class="atl-forced-newline">
- <div class="aui-message problem shadowed information-macro">
+</div><p>Injection in Tapestry IoC can be a complicated subject for a number
of reasons:</p><ul><li>Injection can occur in many places: on fields, and on
parameters to methods and constructors of certain objects.</li><li>Parts of
Injection are themselves defined in terms of Tapestry IoC services, many of
which are extensible.</li></ul><p>Despite this, injection generally <em>Just
Works</em>: most of the time, you want Tapestry to inject a service, and only a
single service implements the service interface.</p><p>This document discusses
what to do when you hit a case that doesn't Just Work, or when you want to
extend the injection logic in some way.</p><p>Some aspects of this discussion
reflect Tapestry IoC used within a Tapestry web application: the tapestry-core
module makes some extensions to injection.</p><h1
id="InjectioninDetail-InjectionTriggers">Injection Triggers</h1><p>Injection is
triggered in a number of ways:</p><ul><li>A field in a component class,
autobuilt object, or
service implementation class is annotated with @Inject.</li><li>A method
parameter to a service builder method, a decorator method, or a contribute
method (in a Tapestry IoC module class).</li><li>A constructor parameter to an
autobuilt object, or a service implementation class.</li><li>Any of the above
with an @InjectService annotation.</li></ul><p>These define the <em>point
of injection</em>.</p><p>Injection also covers a related matter: providing
special resources to a service or component (remember that pages are
specialized components). For a service, the service's id (as a string) or
extensible configuration (as a Collection, List or Map) may be provided. For a
component, the component's id, locale, message catalog, or component resources
may be provided.</p><h1
id="InjectioninDetail-StandardInjectionProcessing">Standard Injection
Processing</h1><p>This section describes standard injection, which applies at
the IoC layer: autobuilt objects and service implementations. The
steps for injection into Tapestry components are slightly different and are
covered later.</p><p>So a the point of injection, Tapestry has identified a
field or parameter that should be injected. At this point, Tapestry knows the
following:</p><ul><li>The field name (if field injection). The parameter name
is not available.</li><li>The field or parameter type, as a Java class. In many
cases, this will be enough to identify what object shall be
injected.</li><li>Any additional annotations on the field or
parameter.</li></ul><p>Tapestry proceeds with this information.</p><h2
id="InjectioninDetail-Checkfor@InjectService">Check for
@InjectService</h2><p>Tapestry checks first for the @InjectService annotation.
The value of this annotation is the service id to inject. When @InjectService
is present at the point of injection, the search is complete, though the
injection can fail (throwing an exception) if the service id indicated does not
exist, or if the service's interface is not compat
ible with the field's type.</p><h2
id="InjectioninDetail-Checkforserviceresources">Check for service
resources</h2><p>This step applies only to IoC layer injection (not to
injection into components).</p><p>When the @Inject annotation is <em>not
present</em> at the point of injection, Tapestry checks to see if a resource
can be injected. Services are global values, but resources are specific to the
service under construction.</p><p>When the Inject annotation is present, this
step is skipped (this is necessary when the object to be injected has a type
that conflicts with a resource type, such as List or
Class).</p><ul><li>org.slf4j.Logger – The Logger of the service being
constructed (or the logger of the Module class being instantiated).</li><li><a
shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/ObjectLocator.html">ObjectLocator</a>
– For contribute methods, used to locate additional objects.</li><li><a
shape="r
ect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/ServiceResources.html">ServiceResources</a>
– For service builder methods, an extended version of
ObjectLocator. </li><li>Class – The service interface
type.</li><li><a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/OperationTracker.html">OperationTracker</a>
– Used to track deeply nested operations so that errors can be reported
sensibly.</li><li>Object, or service interface type – Passed to decorator
methods.</li><li>Collection, List, Map – Assembled service configurations
passed to service builder methods (or service class
constructors).</li><li><p>Configuration, OrderedConfiguration,
MappedConfiguration – Configuration passed to contribute methods, to
build service configurations. <br clear="none" class="atl-forced-newline"> <br
clear="none" class="atl-forced-newline"> If f
ield type does not match any of the available resource types, or the Inject
annotation is present, logic continues to the next step.</p> <div
class="aui-message problem shadowed information-macro">
<span class="aui-icon icon-problem">Icon</span>
<div class="message-content">
-
-<p>Injection of resources into fields is triggered by the presence of the @<a
shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/InjectResource.html">InjectResource</a>
annotation, whereas injection of resources into parameters occurs when the
Inject or InjectService annotation is <em>not</em> present. These rules are
slightly tricky, which reflects a desire to avoid any annotations except when
needed, and the fact that field injection came much later than parameter
injection.</p>
+ <p>Injection of resources into fields is triggered
by the presence of the @<a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/InjectResource.html">InjectResource</a>
annotation, whereas injection of resources into parameters occurs when the
Inject or InjectService annotation is <em>not</em> present. These rules are
slightly tricky, which reflects a desire to avoid any annotations except when
needed, and the fact that field injection came much later than parameter
injection.</p>
</div>
</div>
-</li></ul>
-
-
-<h2 id="InjectioninDetail-ServiceLookupbyTypeandAnnotations">Service Lookup by
Type and Annotations</h2>
-
-<p>Tapestry attempts to find a matching <em>service</em>.</p>
-
-<p>First, it generates a set of services whose service interface is compatible
with the injection type. This is based on assignability.</p>
-
-<p>If the @<a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Local.html">Local</a>
annotation is present, then services not from the module containing the
service being constructed will be eliminated.</p>
-
-<p>Tapestry then works through the known marker annotations. For each marker
annotation that is present at the point of annotation, Tapestry eliminates
services which do not have the marker. Thus, if multiple marker annotations are
present, the final service must have <em>all of them</em>.</p>
-
-<p>At the end, of this, Tapestry determines how many services match.</p>
-
-<ul><li>If there is a single matching service, then the value to inject as
been identified.</li><li>If there are no matches, and there were no marker
annotations at the point of injection, then the Tapestry continues to the next
step.</li><li>Otherwise there were either no matches, or too many matches:
Tapestry will throw a RuntimeException.</li></ul>
-
-
-<h2 id="InjectioninDetail-MasterObjectProviderLookup">MasterObjectProvider
Lookup</h2>
-
-<p>This is the point at which Tapestry's extensibility comes into play.
MasterObjectProvider is a service, with a configuration of ObjectProviders (<a
shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/ObjectProvider.html">API</a>.</p>
-
-<p>The MasterObjectProvider is also the point at which Tapestry's IoC layer
injection, and Tapestry's component injection, unite.</p>
-
-<p>As a chain-of-command, each of the following ObjectProviders will be
considered and will attempt to identify the object to be injected.</p>
-
- <div class="aui-message warning shadowed information-macro">
+</li></ul><h2 id="InjectioninDetail-ServiceLookupbyTypeandAnnotations">Service
Lookup by Type and Annotations</h2><p>Tapestry attempts to find a matching
<em>service</em>.</p><p>First, it generates a set of services whose service
interface is compatible with the injection type. This is based on
assignability.</p><p>If the @<a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Local.html">Local</a>
annotation is present, then services not from the module containing the
service being constructed will be eliminated.</p><p>Tapestry then works through
the known marker annotations. For each marker annotation that is present at the
point of injection, Tapestry eliminates services which <em>do not</em> have the
marker. Thus, if multiple marker annotations are present, the final service
must have <em>all of them</em>.</p><p>At the end, of this, Tapestry determines
how many services match.</p><ul><li>If there is a single ma
tching service, then the service to inject as been identified.</li><li>If
there are no matches, and there were no marker annotations at the point of
injection, then the Tapestry continues to the next step.</li><li>Otherwise
there were either no matches, or too many matches: Tapestry will throw a
RuntimeException.</li></ul><h2
id="InjectioninDetail-MasterObjectProviderLookup">MasterObjectProvider
Lookup</h2><p>This is the point at which Tapestry's extensibility comes into
play. MasterObjectProvider is a service, with a configuration of <a
shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/ObjectProvider.html">ObjectProviders</a>.</p><p>The
MasterObjectProvider is also the point at which Tapestry's IoC layer
injection, and Tapestry's component injection, unite.</p><p>As a
chain-of-command, each of the following ObjectProviders will be considered and
will attempt to identify the object to be injected.</p> <div class="aui-mess
age warning shadowed information-macro">
<span class="aui-icon icon-warning">Icon</span>
<div class="message-content">
-
-<p>A common problem when extending injection is that contributions into the
MasterObjectProvider configuration have to be handled carefully. Any
dependencies of the contributed objects should be resolvable using the early
stages of the injection process, otherwise MasterObjectProvider will have to be
instantiated in order to handle its own injection: Tapestry will detect this
impossibility and throw an exception. In addition, the <a shape="rect"
href="typecoercer-service.html">TypeCoercer</a> service is used by several
ObjectProvider implementations, so the same restrictions apply to TypeCoercer
service contributions.</p>
+ <p>A common problem when extending injection is
that contributions into the MasterObjectProvider configuration have to be
handled carefully. Any dependencies of the contributed objects should be
resolvable using only the early stages of the injection process, otherwise
MasterObjectProvider will have to be instantiated in order to handle its own
injection: Tapestry will detect this impossibility and throw an exception. In
addition, the <a shape="rect" href="typecoercer-service.html">TypeCoercer</a>
service is used by several ObjectProvider implementations, so the same
restrictions apply to TypeCoercer service contributions.</p>
</div>
</div>
-
-
-<h3 id="InjectioninDetail-ValueObjectProvider">Value ObjectProvider</h3>
-
-<p>Checks for the presence of the @<a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Value.html">Value</a>
annotation. If present, then the annotations value is evaluated (to expand any
symbol references), and the TypeCoercer coverts the resulting String to the
injection type.</p>
-
-<h3 id="InjectioninDetail-SymbolObjectProvider">Symbol ObjectProvider</h3>
-
-<p>Similar to the Value ObjectProvider: the @<a shape="rect"
class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Symbol.html">Symbol</a>
annotation's value (if present) is lookup up and converted to the injection
type.</p>
-
-<h3 id="InjectioninDetail-AutobuildObjectProvider">Autobuild
ObjectProvider</h3>
-
-<p>Checks to see if the @<a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Autobuild.html">Autobuild</a>
annotation is present and, if so, autobuilds the value for the parameter. Of
course, the object being built will itself be configured via injection.</p>
-
-<h3 id="InjectioninDetail-ServiceOverrideObjectProvider">ServiceOverride
ObjectProvider</h3>
-
-<p>Checks any contributions to the ServiceOverride service (<a shape="rect"
class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/ServiceOverride.html">API</a>).
Contributions map a type to an object of that type. Thus, ServiceOverrides
will override injections of services that are not qualified with a marker
annotation.</p>
-
-<h3 id="InjectioninDetail-AliasObjectProvider(tapestry-core)">Alias
ObjectProvider (tapestry-core)</h3>
-
-<p>Uses the Alias service (<a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/Alias.html">API</a>)
to look for an object that can be injected.</p>
-
- <div class="aui-message problem shadowed information-macro">
+<h3 id="InjectioninDetail-ValueObjectProvider">Value
ObjectProvider</h3><p>Checks for the presence of the @<a shape="rect"
class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Value.html">Value</a>
annotation. If present, then the annotation's value is evaluated (to expand
any symbol references), and the TypeCoercer service is used to convert the
resulting String to the injection type (the field or parameter type).</p><h3
id="InjectioninDetail-SymbolObjectProvider">Symbol
ObjectProvider</h3><p>Similar to the Value ObjectProvider: the @<a shape="rect"
class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Symbol.html">Symbol</a>
annotation's value (if present) is looked up using the <a shape="rect"
class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/SymbolSource.html">SymbolSource</a>
service, and converted to the inject
ion type via the TypeCoercer service.</p><h3
id="InjectioninDetail-AutobuildObjectProvider">Autobuild
ObjectProvider</h3><p>Checks to see if the @<a shape="rect"
class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Autobuild.html">Autobuild</a>
annotation is present and, if so, autobuilds the value for the parameter. Of
course, the object being built will itself be configured via injection.</p><h3
id="InjectioninDetail-ServiceOverrideObjectProvider">ServiceOverride
ObjectProvider</h3><p>Checks any contributions to the <a shape="rect"
class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/ServiceOverride.html">ServiceOverride</a>
service. Contributions map a type to an object of that type. Thus,
ServiceOverrides will override injections of services that are not qualified
with a marker annotation.</p><h3
id="InjectioninDetail-AliasObjectProvider(tapestry-core)">Alias ObjectProvider
(tapestry-core)</h3><p>Uses the Alias service (<a shape="rect"
class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/Alias.html">API</a>)
to look for an object that can be injected.</p> <div class="aui-message
problem shadowed information-macro">
<span class="aui-icon icon-problem">Icon</span>
<div class="message-content">
-
-<p>Deprecated in Tapestry 5.2.</p>
+ <p>Deprecated in Tapestry 5.2 and removed in
5.4.</p>
</div>
</div>
-
-
-<p>This is commonly used to override a built-in service by contributing an
object with the exact same interface. This is an older and more complex version
of the ServiceOverride provider.</p>
-
-<h3 id="InjectioninDetail-AssetObjectProvider(tapestry-core)">Asset
ObjectProvider (tapestry-core)</h3>
-
-<p>Checks for the @<a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Path.html">Path</a>
annotation.</p>
-
-<p>If present, the annotation's value has embedded symbols expanded, and is
converted into an Asset (which must exist).</p>
-
-<p>The TypeCoercer can then convert the Asset to the injection type, for
example, as Resource.</p>
-
-<h3 id="InjectioninDetail-ServiceObjectProvider(tapestry-core)">Service
ObjectProvider (tapestry-core)</h3>
-
-<p>Looks for the @<a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Service.html">Service</a>
annotation; if present, the annotation's value is the exact service id to
inject. This is necessary because injections into <em>component</em> fields are
always triggered by the Inject annotation.</p>
-
- <div class="aui-message warning shadowed information-macro">
+<p>This is commonly used to override a built-in service by contributing an
object with the exact same interface. This is an older and more complex version
of the ServiceOverride provider.</p><h3
id="InjectioninDetail-AssetObjectProvider(tapestry-core)">Asset ObjectProvider
(tapestry-core)</h3><p>Checks for the @<a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Path.html">Path</a>
annotation.</p><p>If present, the annotation's value has embedded symbols
expanded, and is converted into an Asset (which must exist).</p><p>The
TypeCoercer can then convert the Asset to the injection type, for example, as
Resource.</p><h3
id="InjectioninDetail-ServiceObjectProvider(tapestry-core)">Service
ObjectProvider (tapestry-core)</h3><p>Looks for the @<a shape="rect"
class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Service.html">Service</a>
annotation; if present, the annotatio
n's value is the exact service id to inject. This is necessary because
injections into <em>component</em> fields are always triggered by the Inject
annotation.</p> <div class="aui-message warning shadowed information-macro">
<span class="aui-icon icon-warning">Icon</span>
<div class="message-content">
-
-<p>This is supported but no longer necessary, as the @InjectService annotation
is now also supported for component fields.</p>
+ <p>This is supported but no longer necessary, as
the @InjectService annotation is now also supported for component fields.</p>
</div>
</div>
-
-
-<h3
id="InjectioninDetail-SpringBeanObjectProvider(tapestry-spring)">SpringBean
ObjectProvider (tapestry-spring)</h3>
-
-<p>Attempts to resolve a Spring bean purely by object type (Spring qualifiers
are not supported). If no beans are assignable to the type, then processing
continues. If exactly one is assignable, it is used as the injection value. If
more than one bean is assignable, it is an error (and a list of matching beans
names will be part of the thrown exception).</p>
-
-<h2 id="InjectioninDetail-ServiceLookup">Service Lookup</h2>
-
-<p>If none of the ObjectProviders can identify the value to inject, a last
step occurs: lookup by service type. If exactly <em>one</em> service matches
the injection type, then that service is injected.</p>
-
-<p>Otherwise, the lookup fails because either no services match, or more than
one matches. An exception will be thrown with the details, including a list of
matching services (if there is more than one match).</p>
-
-<h1 id="InjectioninDetail-Post-InjectionMethods">Post-Injection Methods</h1>
-
-<p>Autobuilt objects (services and the like, but <em>not</em> components) may
have post-injection methods.</p>
-
-<p>Any public method may have the @<a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/PostInjection.html">PostInjection</a>
annotation.</p>
-
-<p>Such methods are invoked after constructor and/or field injection. Only
<strong>public methods</strong> will be invoked. Any return value is
ignored.</p>
-
-<p>Further injections may take place using the parameters of the method.</p>
-
-<p>Often this is used to perform additional setup, such as registerring a
service as a listener of events produced by another service:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent
panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[
-public class MyServiceImpl implements MyService, UpdateListener
+<h3
id="InjectioninDetail-SpringBeanObjectProvider(tapestry-spring)">SpringBean
ObjectProvider (tapestry-spring)</h3><p>Attempts to resolve a Spring bean
purely by object type (Spring qualifiers are not supported). If no beans are
assignable to the type, then processing continues. If exactly one is
assignable, it is used as the injection value. If more than one bean is
assignable, it is an error (and a list of matching beans names will be part of
the thrown exception).</p><h2 id="InjectioninDetail-ServiceLookup">Service
Lookup</h2><p>If none of the ObjectProviders can identify the value to inject,
a last step occurs: lookup by service type. If exactly <em>one</em> service
matches the injection type, then that service is injected.</p><p>Otherwise, the
lookup fails because either no services match, or more than one matches. An
exception will be thrown with the details, including a list of matching
services (if there is more than one match).</p><h1
id="InjectioninDetail-Post-InjectionM
ethods">Post-Injection Methods</h1><p>Autobuilt objects (services and the
like, but <em>not</em> components) may have post-injection methods.</p><p>Any
public method may have the @<a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/PostInjection.html">PostInjection</a>
annotation.</p><p>Such methods are invoked after constructor and/or field
injection. Only <strong>public methods</strong> will be invoked. Any return
value is ignored.</p><p>The method often takes no parameters; however if the
method has parameters, these parameters are new points of
injection.</p><p>Often this is used to perform additional setup, such as
registerring a service as a listener of events produced by another
service:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false"
type="syntaxhighlighter"><![CDATA[public class MyServiceImpl implements
MyService, UpdateListener
{
@PostInjection
public void registerAsListener(UpdateListenerHub hub)
@@ -282,36 +138,7 @@ public class MyServiceImpl implements My
}
}
]]></script>
-</div></div>
-
-<h1 id="InjectioninDetail-ComponentInjection">Component Injection</h1>
-
-<p>Inside Tapestry components, injection occurs exclusively on <em>fields</em>
and is always triggered by the @Inject (or @InjectService) annotation.</p>
-
-<p>Component field injection is very similar to IoC layer, but with a
different set of injectable resources.</p>
-
-<p>Injection is the responsibility of the <a shape="rect"
class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/InjectionProvider.html">InjectionProvider</a>
service, which is a chain-of-command across a number of implementations.</p>
-
-<h2 id="InjectioninDetail-BlockInjectionProvider">Block InjectionProvider</h2>
-
-<p>Checks if the field type is Block. If so, determines the block id to inject
(either from the field name, or from an @<a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Id.html">Id</a>
annotation, if present).</p>
-
-<h2 id="InjectioninDetail-DefaultInjectionProvider">Default
InjectionProvider</h2>
-
-<p>Uses the MasterObjectProvider service to provide the injectable value. The
Service Lookup stage is skipped.</p>
-
-<h2
id="InjectioninDetail-ComponentResourcesInjectionProvider">ComponentResources
InjectionProvider</h2>
-
-<p>Injects fields of type ComponentResources.</p>
-
-<h2 id="InjectioninDetail-CommonResourcesInjectionProvider">CommonResources
InjectionProvider</h2>
-
-<p>Injects fields with common resources:</p>
-
-<ul><li>String: the components' complete id</li><li>org.slf4j.Logger: Logger
for the component (based on component class name)</li><li>Locale: locale for
the containing page (page locale is immutable)</li><li>Messages: Component's
message catalog</li><li>ComponentResourceSelector: selector for the containing
page (selector is immutable)</li></ul>
-
-
-
+</div></div><h1 id="InjectioninDetail-ComponentInjection">Component
Injection</h1><p>Inside Tapestry components, injection occurs exclusively on
<em>fields</em> and is always triggered by the @Inject (or @InjectService)
annotation.</p><p>Component field injection is very similar to IoC layer, but
with a different set of injectable resources.</p><p>Injection is the
responsibility of the <a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/InjectionProvider.html">InjectionProvider</a>
service, which is a chain-of-command across a number of
implementations.</p><h2 id="InjectioninDetail-BlockInjectionProvider">Block
InjectionProvider</h2><p>Checks if the field type is Block. If so, determines
the block id to inject (either from the field name, or from an @<a shape="rect"
class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Id.html">Id</a>
annotation, if present).</p><h2 id=
"InjectioninDetail-DefaultInjectionProvider">Default
InjectionProvider</h2><p>Uses the MasterObjectProvider service to provide the
injectable value. The Service Lookup stage is skipped.</p><h2
id="InjectioninDetail-ComponentResourcesInjectionProvider">ComponentResources
InjectionProvider</h2><p>Injects fields of type ComponentResources.</p><h2
id="InjectioninDetail-CommonResourcesInjectionProvider">CommonResources
InjectionProvider</h2><p>Injects fields with common
resources:</p><ul><li>String: the components' complete
id</li><li>org.slf4j.Logger: Logger for the component (based on component class
name)</li><li>Locale: locale for the containing page (page locale is
immutable)</li><li>Messages: Component's message
catalog</li><li>ComponentResourceSelector: selector for the containing page
(selector is immutable)</li></ul>
<div class="aui-message hint shadowed information-macro">
<p class="title">Added in 5.3</p>
@@ -323,31 +150,8 @@ public class MyServiceImpl implements My
</div>
<div style="border-right: 20px solid #D8E4F1;border-left: 20px solid #D8E4F1;">
-
<p>ComponentResourceSelector is new as of release 5.3. It encapsulates a
locale plus additional application-specific data used for skinning and/or
themeing.</p>
-</div>
-
-<h2 id="InjectioninDetail-AssetInjectionProvider">Asset InjectionProvider</h2>
-
-<p>Triggered by the @Path annotation: the Path value has symbols expanded, and
is then converted to an Asset.</p>
-
-<h2 id="InjectioninDetail-ServiceInjectionProvider">Service
InjectionProvider</h2>
-
-<p>Equivalent to the Service Lookup phase in an IoC layer injection.</p>
-
-<h1 id="InjectioninDetail-@InjectServiceinComponents">@InjectService in
Components</h1>
-
-<p>You may use the @<a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/InjectService.html">InjectService</a>
annotation on component fields.</p>
-
-<style type="text/css">/*<![CDATA[*/
-table.ScrollbarTable {border: none;padding: 3px;width: 100%;padding:
3px;margin: 0px;background-color: #f0f0f0}
-table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width:
16px;border: none;}
-table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
-table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
-table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
-table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width:
16px;border: none;}
-
-/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td
colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect"
href="strategybuilder-service.html"><img align="middle" border="0"
src="https://cwiki.apache.org/confluence/images/icons/back_16.gif" width="16"
height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName"
width="33%"><a shape="rect" href="strategybuilder-service.html">StrategyBuilder
Service</a> </td><td colspan="1" rowspan="1" class="ScrollbarParent"
width="33%"><sup><a shape="rect" href="ioc.html"><img align="middle" border="0"
src="https://cwiki.apache.org/confluence/images/icons/up_16.gif" width="8"
height="8"></a></sup><a shape="rect" href="ioc.html">IoC</a></td><td
colspan="1" rowspan="1" class="ScrollbarNextName" width="33%"> <a
shape="rect" href="object-providers.html">Object Providers</a></td><td
colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect"
href="object-providers.html"><img align="middle"
border="0" src="https://cwiki.apache.org/confluence/images/icons/forwd_16.gif"
width="16" height="16"></a></td></tr></table></div></div>
+</div><h2 id="InjectioninDetail-AssetInjectionProvider">Asset
InjectionProvider</h2><p>Triggered by the @Path annotation: the Path value has
symbols expanded, and is then converted to an Asset.</p><h2
id="InjectioninDetail-ServiceInjectionProvider">Service
InjectionProvider</h2><p>Equivalent to the Service Lookup phase in an IoC layer
injection.</p><h1
id="InjectioninDetail-@InjectServiceinComponents">@InjectService in
Components</h1><p>You may use the @<a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/InjectService.html">InjectService</a>
annotation on component fields.</p><p> </p></div>
</div>
<div class="clearer"></div>