You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by bu...@apache.org on 2013/09/23 00:21:27 UTC

svn commit: r879492 [27/30] - in /websites/production/tapestry/content: ./ 2009/ 2009/09/ 2009/09/13/ 2009/10/ 2009/10/27/ 2009/11/ 2009/11/25/ 2010/ 2010/07/ 2010/07/18/ 2010/07/24/ 2010/10/ 2010/10/11/ 2010/10/31/ 2010/11/ 2010/11/18/ 2010/11/19/ 201...

Modified: websites/production/tapestry/content/tapestry-ioc-configuration.html
==============================================================================
--- websites/production/tapestry/content/tapestry-ioc-configuration.html (original)
+++ websites/production/tapestry/content/tapestry-ioc-configuration.html Sun Sep 22 22:21:21 2013
@@ -24,7 +24,18 @@
     Tapestry IoC Configuration -- Apache Tapestry
   </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css">
+
+    <link href='http://cxf.apache.org/resources/highlighter/styles/shCoreCXF.css' rel='stylesheet' type='text/css' />
+  <link href='http://cxf.apache.org/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
+
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
+
 </head>
 <body>
   <div class="wrapper bs">
@@ -34,9 +45,9 @@
 </div>
 
 <div id="top">
-<div id="smallbanner"><div class="searchbox" style="float:right;margin: .3em 1em .1em 1em">
+<div id="smallbanner"><div class="searchbox" style="float:right;margin: .3em 1em .1em 1em"><p>
 <span style="color: #999; font-size: 90%">Tapestry docs, issues, wikis &amp; blogs:</span>
-<form enctype="application/x-www-form-urlencoded" method="get" action="http://tapestry.apache.org/search.html">
+</p><form enctype="application/x-www-form-urlencoded" method="get" action="http://tapestry.apache.org/search.html">
   <input type="text" name="q">
   <input type="submit" value="Search">
 </form>
@@ -64,7 +75,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="tapestry-ioc-decorators.html"><img align="middle" border="0" src="/images/confluence/back_16.gif" width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%"><a shape="rect" href="tapestry-ioc-decorators.html">Tapestry IoC Decorators</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="ioc.html"><img align="middle" border="0" src="/images/confluence/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%">&#160;<a shape="rect" href="case-insensitivity.html">Case Insensitivity</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="case-insensitivity.html"><img align="middle" border="0" src="/images/confluence/forwd_16.gif" width
 ="16" height="16"></a></td></tr></table></div>
+/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="tapestry-ioc-decorators.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="tapestry-ioc-decorators.html">Tapestry IoC Decorators</a>&#160;</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%">&#160;<a shape="rect" href="case-insensitivity.html">Case Insensitivity</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="case-insensitivity.html"><img align="mi
 ddle" border="0" src="https://cwiki.apache.org/confluence/images/icons/forwd_16.gif" width="16" height="16"></a></td></tr></table></div>
 
 <h1><a shape="rect" name="TapestryIoCConfiguration-TapestryIoCConfiguration"></a>Tapestry IoC Configuration</h1>
 
@@ -74,15 +85,15 @@ table.ScrollbarTable td.ScrollbarNextIco
         
                                             </td></tr><tr><td colspan="1" rowspan="1">
                                  <span class="icon icon-page" title="Page">Page:</span>
-                         <a shape="rect" href="ioc-cookbook-service-configurations.html">IoC cookbook - Service Configurations</a>
+                         <a shape="rect" href="tapestry-ioc-configuration.html">Tapestry IoC Configuration</a>
         
                                             </td></tr><tr><td colspan="1" rowspan="1">
                                  <span class="icon icon-page" title="Page">Page:</span>
-                         <a shape="rect" href="tapestry-ioc-configuration.html">Tapestry IoC Configuration</a>
+                         <a shape="rect" href="symbols.html">Symbols</a>
         
                                             </td></tr><tr><td colspan="1" rowspan="1">
                                  <span class="icon icon-page" title="Page">Page:</span>
-                         <a shape="rect" href="symbols.html">Symbols</a>
+                         <a shape="rect" href="ioc-cookbook-service-configurations.html">IoC cookbook - Service Configurations</a>
         
                                             </td></tr><tr><td colspan="1" rowspan="1">
                                  <span class="icon icon-page" title="Page">Page:</span>
@@ -104,11 +115,11 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>Let's say you've written a bunch of different services, each of which does something specific for a particular type of file (identified by the file's extension), and each implements the same interface, which we'll call FileServicer. And now let's say you need a central service that selects the one of your FileServicer implementations based on a given file extension.  You start by providing a <a shape="rect" href="defining-tapestry-ioc-services.html#DefiningTapestryIOCServices-serviceBuilderMethod">service builder method</a>:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> FileServiceDispatcher buildFileServicerDispatcher(Map&lt;<span class="code-object">String</span>,FileServicer&gt; contributions)
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+  public static FileServiceDispatcher buildFileServicerDispatcher(Map&lt;String,FileServicer&gt; contributions)
   {
-    <span class="code-keyword">return</span> <span class="code-keyword">new</span> FileServiceDispatcherImpl(contributions);
-  } </pre>
+    return new FileServiceDispatcherImpl(contributions);
+  } ]]></script>
 </div></div>
 
 <p>In order to provide a value for the contribution parameter, Tapestry will <em>collect</em> contributions from service contribution methods. It will ensure that the keys and values match the generic types shown (String for the key, FileServicer for the value). The map will be assembled and passed into the service builder method, and from there, into the FileServiceDispatcherImpl constructor.</p>
@@ -116,37 +127,37 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>So where do the values come from? Your service contributor methods, methods whose names start with "contribute":</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> void contributeFileServicerDispatcher(MappedConfiguration&lt;<span class="code-object">String</span>,FileServicer&gt; configuration)
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+  public static void contributeFileServicerDispatcher(MappedConfiguration&lt;String,FileServicer&gt; configuration)
   {
-    configuration.add(<span class="code-quote">"txt"</span>, <span class="code-keyword">new</span> TextFileServicer());
-    configuration.add(<span class="code-quote">"pdf"</span>, <span class="code-keyword">new</span> PDFFileServicer());
-  }  </pre>
+    configuration.add("txt", new TextFileServicer());
+    configuration.add("pdf", new PDFFileServicer());
+  }  ]]></script>
 </div></div>
 
 <p>Or, instead of instantiating those services ourselves, we could <a shape="rect" href="injection-in-detail.html" title="Injection in Detail">inject</a> them:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> void contributeFileServicerDispatcher(MappedConfiguration&lt;<span class="code-object">String</span>,FileServicer&gt; configuration,
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+  public static void contributeFileServicerDispatcher(MappedConfiguration&lt;String,FileServicer&gt; configuration,
   
-    @InjectService(<span class="code-quote">"TextFileServicer"</span>) FileServicer textFileServicer,
-    @InjectService(<span class="code-quote">"PDFFileServicer"</span>) FileServicer pdfFileServicer)
+    @InjectService("TextFileServicer") FileServicer textFileServicer,
+    @InjectService("PDFFileServicer") FileServicer pdfFileServicer)
   {
-    configuration.add(<span class="code-quote">"txt"</span>, textFileServicer);
-    configuration.add(<span class="code-quote">"pdf"</span>, pdfFileServicer);
-  }  </pre>
+    configuration.add("txt", textFileServicer);
+    configuration.add("pdf", pdfFileServicer);
+  }  ]]></script>
 </div></div>
 
 <p>The <b>extensibility</b> comes from the fact that multiple modules may all contribute to the same service configuration:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> void contributeFileServicerDispatcher(MappedConfiguration&lt;<span class="code-object">String</span>,FileServicer&gt; configuration)
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+  public static void contributeFileServicerDispatcher(MappedConfiguration&lt;String,FileServicer&gt; configuration)
   {
-    configuration.add(<span class="code-quote">"doc"</span>, <span class="code-keyword">new</span> WordFileServicer());
-    configuration.add(<span class="code-quote">"ppt"</span>, <span class="code-keyword">new</span> PowerPointFileServicer());
-  }  </pre>
+    configuration.add("doc", new WordFileServicer());
+    configuration.add("ppt", new PowerPointFileServicer());
+  }  ]]></script>
 </div></div>
 
 <p>Now the FileServicerDispatcher builder method gets a Map with at least four entries in it.</p>
@@ -157,7 +168,7 @@ table.ScrollbarTable td.ScrollbarNextIco
 
 
 
-<div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="/images/confluence/information.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Added in 5.2</b><br clear="none"></td></tr></table></div>
+<div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/information.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Added in 5.2</b><br clear="none"></td></tr></table></div>
 <div style="border-right: 20px solid #D8E4F1;border-left: 20px solid #D8E4F1;"></div>
 
 <p>If you prefer annotations over naming conventions you can use the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Contribute.html">Contribute</a> annotation. As of version 5.2 this annotation that may be placed on a contributor method of a module instead of starting the methods name with "contribute". The value of the annotation is the type of the service to contribute into. </p>
@@ -173,28 +184,28 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>The following example is an annotation-based alternative for the contribution method above.</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 @Contribute(FileServiceDispatcher.class)
-<span class="code-keyword">public</span> <span class="code-keyword">static</span> void arbitraryMethodName(MappedConfiguration&lt;<span class="code-object">String</span>,FileServicer&gt; configuration)
+public static void arbitraryMethodName(MappedConfiguration&lt;String,FileServicer&gt; configuration)
 {
-    configuration.add(<span class="code-quote">"doc"</span>, <span class="code-keyword">new</span> WordFileServicer());
-    configuration.add(<span class="code-quote">"ppt"</span>, <span class="code-keyword">new</span> PowerPointFileServicer());
+    configuration.add("doc", new WordFileServicer());
+    configuration.add("ppt", new PowerPointFileServicer());
 }  
-</pre>
+]]></script>
 </div></div>
 
 <p>If you have several implementations of a service interface, you have to disambiguate the services. For this purpose the marker annotations should be placed on the contributor method.</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 @Contribute(FileServiceDispatcher.class)
 @Red @Blue
-<span class="code-keyword">public</span> <span class="code-keyword">static</span> void arbitraryMethodName(MappedConfiguration&lt;<span class="code-object">String</span>,FileServicer&gt; configuration)
+public static void arbitraryMethodName(MappedConfiguration&lt;String,FileServicer&gt; configuration)
 {
-    configuration.add(<span class="code-quote">"doc"</span>, <span class="code-keyword">new</span> WordFileServicer());
-    configuration.add(<span class="code-quote">"ppt"</span>, <span class="code-keyword">new</span> PowerPointFileServicer());
+    configuration.add("doc", new WordFileServicer());
+    configuration.add("ppt", new PowerPointFileServicer());
 }
-</pre>
+]]></script>
 </div></div>
 
 <p>In this example, the method will only be invoked when constructing a service configuration where the service itself has both the Red and Blue marker annotations.  Tapestry knows which annotations are marker annotations, and which marker annotations apply to the service, via the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Marker.html">Marker</a> annotation on the service implementation.</p>
@@ -204,15 +215,15 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>Note that it <em>is</em> possible for the same contribution method to be invoked to contribute to the configuration of multiple different services.</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
   @Contribute(FileServiceDispatcher.class)
   @Local
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> void arbitraryMethodName(MappedConfiguration&lt;<span class="code-object">String</span>,FileServicer&gt; configuration)
+  public static void arbitraryMethodName(MappedConfiguration&lt;String,FileServicer&gt; configuration)
   {
-    configuration.add(<span class="code-quote">"doc"</span>, <span class="code-keyword">new</span> WordFileServicer());
-    configuration.add(<span class="code-quote">"ppt"</span>, <span class="code-keyword">new</span> PowerPointFileServicer());
+    configuration.add("doc", new WordFileServicer());
+    configuration.add("ppt", new PowerPointFileServicer());
   }  
-</pre>
+]]></script>
 </div></div>
 
 <h1><a shape="rect" name="TapestryIoCConfiguration-ConfigurationTypes"></a>Configuration Types</h1>
@@ -231,18 +242,18 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>For example, here's a kind of Startup service that needs some Runnable objects. It doesn't care what order the Runnable objects are executed in.</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> <span class="code-object">Runnable</span> buildStartup(<span class="code-keyword">final</span> Collection&lt;<span class="code-object">Runnable</span>&gt; configuration)
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+  public static Runnable buildStartup(final Collection&lt;Runnable&gt; configuration)
   {
-    <span class="code-keyword">return</span> <span class="code-keyword">new</span> <span class="code-object">Runnable</span>()
+    return new Runnable()
     {
-      <span class="code-keyword">public</span> void run()
+      public void run()
       {
-        <span class="code-keyword">for</span> (<span class="code-object">Runnable</span> contribution : configuration)
+        for (Runnable contribution : configuration)
           contribution.run();
       }
     };
-  }  </pre>
+  }  ]]></script>
 </div></div>
 
 <p>Here we don't even need a separate class for the implementation, we use an inner class for the implementation. The point is, the configuration is provided to the builder method, which passes it along to the implementation of the service.</p>
@@ -250,12 +261,12 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>On the contribution side, a service contribution method sees a <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/Configuration.html">Configuration</a> object:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> void contributeStartup(Configuration&lt;<span class="code-object">Runnable</span>&gt; configuration)
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+  public static void contributeStartup(Configuration&lt;Runnable&gt; configuration)
   {
-    configuration.add(<span class="code-keyword">new</span> JMSStartup());
-    configuration.add(<span class="code-keyword">new</span> FileSystemStartup());
-  }    </pre>
+    configuration.add(new JMSStartup());
+    configuration.add(new FileSystemStartup());
+  }    ]]></script>
 </div></div>
 
 <p>The Configuration interface defines just a single method: <tt>add()</tt>. This is very intentional: the only thing you can do is add new items. If we passed in a Collection, you might be tempted to check it for values, or remove them ... but that flies in the face of the fact that the order of execution of these service contribution methods is entirely unknown.</p>
@@ -274,18 +285,18 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>So, if we changed our Startup service to require a specific order for startup:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> <span class="code-object">Runnable</span> buildStartup(<span class="code-keyword">final</span> List&lt;<span class="code-object">Runnable</span>&gt; configuration)
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+  public static Runnable buildStartup(final List&lt;Runnable&gt; configuration)
   {
-    <span class="code-keyword">return</span> <span class="code-keyword">new</span> <span class="code-object">Runnable</span>()
+    return new Runnable()
     {
-      <span class="code-keyword">public</span> void run()
+      public void run()
       {
-        <span class="code-keyword">for</span> (<span class="code-object">Runnable</span> contribution : configuration)
+        for (Runnable contribution : configuration)
           contribution.run();
       }
     };
-  }  </pre>
+  }  ]]></script>
 </div></div>
 
 <p>Notice that the service builder method is shielded from the details of how the items are ordered. It doesn't have to know about IDs and pre- and post-requisites. By using a parameter type of List, we've triggered Tapestry to collect all the ordering information.</p>
@@ -293,12 +304,12 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>For our service contribution methods, we must provide a parameter of type <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/OrderedConfiguration.html">OrderedConfiguration</a>:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> void contributeStartup(OrderedConfiguration&lt;<span class="code-object">Runnable</span>&gt; configuration)
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+  public static void contributeStartup(OrderedConfiguration&lt;Runnable&gt; configuration)
   {
-    configuration.add(<span class="code-quote">"JMS"</span>, <span class="code-keyword">new</span> JMSStartup());
-    configuration.add(<span class="code-quote">"FileSystem"</span>, <span class="code-keyword">new</span> FileSystemStartup(), <span class="code-quote">"after:CacheSetup"</span>);
-  }    </pre>
+    configuration.add("JMS", new JMSStartup());
+    configuration.add("FileSystem", new FileSystemStartup(), "after:CacheSetup");
+  }    ]]></script>
 </div></div>
 
 <p>Often, you don't care about ordering; the first form of the add method is used then. The ordering algorithm will find a spot for the object (here the JMSStartup instance) based on the constraints of other contributed objects.</p>
@@ -311,7 +322,7 @@ table.ScrollbarTable td.ScrollbarNextIco
 
 
 
-<div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="/images/confluence/information.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Added in 5.3</b><br clear="none"></td></tr></table></div>
+<div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/information.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Added in 5.3</b><br clear="none"></td></tr></table></div>
 <div style="border-right: 20px solid #D8E4F1;border-left: 20px solid #D8E4F1;">
 <p>When using <tt>add()</tt> without any specific constraints, a default constraint is added: after the previously added element. These default constraints are only within a single contribution method, but makes it much easier to set the order of several related contributions. Note that the contributions will be ordered relative to each other and it's possible that contributions by some other module or method may be interspersed between them.</p>
 </div>
@@ -342,7 +353,7 @@ table.ScrollbarTable td.ScrollbarNextIco
 
 
 
-<div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="/images/confluence/information.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Added in 5.1</b><br clear="none"></td></tr></table></div>
+<div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/information.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Added in 5.1</b><br clear="none"></td></tr></table></div>
 <div style="border-right: 20px solid #D8E4F1;border-left: 20px solid #D8E4F1;"></div>
 
 <p>The OrderedConfiguration and MappedConfiguration interfaces now support overrides. An override is a replacement for a normally contributed object. An override <em>must</em> match a contributed object, and each contributed object may be overridden at most once.</p>
@@ -361,12 +372,12 @@ 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="tapestry-ioc-decorators.html"><img align="middle" border="0" src="/images/confluence/back_16.gif" width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%"><a shape="rect" href="tapestry-ioc-decorators.html">Tapestry IoC Decorators</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="ioc.html"><img align="middle" border="0" src="/images/confluence/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%">&#160;<a shape="rect" href="case-insensitivity.html">Case Insensitivity</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="case-insensitivity.html"><img align="middle" border="0" src="/images/confluence/forwd_16.gif" width
 ="16" height="16"></a></td></tr></table></div></div>
+/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="tapestry-ioc-decorators.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="tapestry-ioc-decorators.html">Tapestry IoC Decorators</a>&#160;</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%">&#160;<a shape="rect" href="case-insensitivity.html">Case Insensitivity</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="case-insensitivity.html"><img align="mi
 ddle" border="0" src="https://cwiki.apache.org/confluence/images/icons/forwd_16.gif" width="16" height="16"></a></td></tr></table></div></div>
 </div>
 
 <div class="clearer"></div>
 <div id="footer">
-<div id="footer"><p>Apache Tapestry, Tapestry, Apache, the Apache feather logo, and the Apache Tapestry project logo are trademarks of The Apache Software Foundation.</p>
+<div id="footer"><p>Apache Tapestry, Tapestry, Apache, the Apache feather logo, and the Apache Tapestry project logo are trademarks of The Apache Software Foundation.<br clear="none">
 <script type="text/javascript">
   var _gaq = _gaq || [];
   _gaq.push(['_setAccount', 'UA-400821-1']);
@@ -377,7 +388,7 @@ table.ScrollbarTable td.ScrollbarNextIco
     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
   })();
-</script></div>
+</script></p></div>
 </div>
 		<div id="comments_thread"></div>
 		<script type="text/javascript" src="https://comments.apache.org/show_comments.lua?site=tapestry&amp;page=http://tapestry.apache.org/tapestry-ioc-configuration.html" async="true">

Modified: websites/production/tapestry/content/tapestry-ioc-decorators.html
==============================================================================
--- websites/production/tapestry/content/tapestry-ioc-decorators.html (original)
+++ websites/production/tapestry/content/tapestry-ioc-decorators.html Sun Sep 22 22:21:21 2013
@@ -24,7 +24,18 @@
     Tapestry IoC Decorators -- Apache Tapestry
   </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css">
+
+    <link href='http://cxf.apache.org/resources/highlighter/styles/shCoreCXF.css' rel='stylesheet' type='text/css' />
+  <link href='http://cxf.apache.org/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
+
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
+
 </head>
 <body>
   <div class="wrapper bs">
@@ -34,9 +45,9 @@
 </div>
 
 <div id="top">
-<div id="smallbanner"><div class="searchbox" style="float:right;margin: .3em 1em .1em 1em">
+<div id="smallbanner"><div class="searchbox" style="float:right;margin: .3em 1em .1em 1em"><p>
 <span style="color: #999; font-size: 90%">Tapestry docs, issues, wikis &amp; blogs:</span>
-<form enctype="application/x-www-form-urlencoded" method="get" action="http://tapestry.apache.org/search.html">
+</p><form enctype="application/x-www-form-urlencoded" method="get" action="http://tapestry.apache.org/search.html">
   <input type="text" name="q">
   <input type="submit" value="Search">
 </form>
@@ -64,11 +75,11 @@ 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="service-advisors.html"><img align="middle" border="0" src="/images/confluence/back_16.gif" width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%"><a shape="rect" href="service-advisors.html">Service Advisors</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="ioc.html"><img align="middle" border="0" src="/images/confluence/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%">&#160;<a shape="rect" href="tapestry-ioc-configuration.html">Tapestry IoC Configuration</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="tapestry-ioc-configuration.html"><img align="middle" border="0" src="/images/confluence/forwd_16.gif" wi
 dth="16" height="16"></a></td></tr></table></div>
+/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="service-advisors.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="service-advisors.html">Service Advisors</a>&#160;</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%">&#160;<a shape="rect" href="tapestry-ioc-configuration.html">Tapestry IoC Configuration</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="tapestry-ioc-configuration.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><a shape="rect" name="TapestryIoCDecorators-TapestryIoCDecorators"></a>Tapestry IoC Decorators</h1>
 
-<div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="/images/confluence/information.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1">Starting with Tapestry 5.1, Service Decoration is augmented with <a shape="rect" href="service-advisors.html" title="Service Advisors">Service Advice</a>. Advisors are  similar but more general, as they work on any service interface, which doesn't have to be known at build time. Decoration is used when the type of the service being decorated <em>is</em> known at build time, and involves supplying a new implementation of the service interface.</td></tr></table></div>
+<div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/information.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1">Starting with Tapestry 5.1, Service Decoration is augmented with <a shape="rect" href="service-advisors.html" title="Service Advisors">Service Advice</a>. Advisors are  similar but more general, as they work on any service interface, which doesn't have to be known at build time. Decoration is used when the type of the service being decorated <em>is</em> known at build time, and involves supplying a new implementation of the service interface.</td></tr></table></div>
 
 <p><em>Decoration</em> is the name of a popular design pattern. Using decoration, an existing object's behavior can be extended without changing the implementation of the object.</p>
 
@@ -93,27 +104,27 @@ table.ScrollbarTable td.ScrollbarNextIco
 <h1><a shape="rect" name="TapestryIoCDecorators-ServiceDecorationMethods"></a>Service Decoration Methods</h1>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">package</span> org.example.myapp.services;
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+package org.example.myapp.services;
 
-<span class="code-keyword">import</span> org.apache.tapestry5.ioc.services.LoggingDecorator;
-<span class="code-keyword">import</span> org.slf4j.Logger;
+import org.apache.tapestry5.ioc.services.LoggingDecorator;
+import org.slf4j.Logger;
 
-<span class="code-keyword">public</span> class MyAppModule
+public class MyAppModule
 {
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> Indexer build()
+  public static Indexer build()
   {
-    <span class="code-keyword">return</span> <span class="code-keyword">new</span> IndexerImpl();
+    return new IndexerImpl();
   }
 
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> &lt;T&gt; T decorateIndexer(<span class="code-object">Class</span>&lt;T&gt; serviceInterface, T delegate,
-    <span class="code-object">String</span> serviceId, Logger logger,
+  public static &lt;T&gt; T decorateIndexer(Class&lt;T&gt; serviceInterface, T delegate,
+    String serviceId, Logger logger,
 
     LoggingDecorator decorator)
   {
-    <span class="code-keyword">return</span> decorator.build(serviceInterface, delegate, serviceId, logger);
+    return decorator.build(serviceInterface, delegate, serviceId, logger);
   }
-}</pre>
+}]]></script>
 </div></div>
 
 <p>The method decorateIndexer() is a service decorator method because it starts with the word "decorate". In this simple case, only the myapp.Indexer service will be decorated, even if there are other services in this module or others ... this is because of the name match ("decorateIndexer" and "buildIndexer"), but we'll shortly see how annotations can be used to target many services for decoration.</p>
@@ -131,29 +142,29 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>Alternately, when targetting services whose type is known at compile time, you may provide a parameter whose type matches the service interface. For example, decorateIndexer() will always be applied to the Indexer service, whose type (Indexer) is known. We could therefore rewrite decorateIndexer() as:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> Indexer decorateIndexer(Indexer delegate, Logger logger, LoggingDecorator decorator)
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+  public static Indexer decorateIndexer(Indexer delegate, Logger logger, LoggingDecorator decorator)
   {
-    <span class="code-keyword">return</span> decorator.build(Indexer.class, delegate, <span class="code-quote">"Indexer"</span>, logger);
-  }</pre>
+    return decorator.build(Indexer.class, delegate, "Indexer", logger);
+  }]]></script>
 </div></div>
 
 <p>Of course, nothing stops you from combining building with decorating inside the service builder method:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">package</span> org.example.myapp.services;
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+package org.example.myapp.services;
 
-<span class="code-keyword">import</span> org.apache.tapestry5.ioc.services.LoggingDecorator;
-<span class="code-keyword">import</span> org.slf4j.Logger;
+import org.apache.tapestry5.ioc.services.LoggingDecorator;
+import org.slf4j.Logger;
 
-<span class="code-keyword">public</span> class MyAppModule
+public class MyAppModule
 {
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> Indexer build(Logger logger, LoggingDecorator decorator)
+  public static Indexer build(Logger logger, LoggingDecorator decorator)
   {
-    <span class="code-keyword">return</span> decorator.build(Indexer.class, logger, <span class="code-keyword">new</span> IndexerImpl());
+    return decorator.build(Indexer.class, logger, new IndexerImpl());
   }
-}</pre>
+}]]></script>
 </div></div>
 
 <p>But as we'll see next, it's possible to have a single decorator method work on many different services by using annotations.</p>
@@ -171,14 +182,14 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>For example, to target all the services in your module:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-  @Match(<span class="code-quote">"*"</span>)
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> &lt;T&gt; T decorateLogging(<span class="code-object">Class</span>&lt;T&gt; serviceInterface, T delegate,
-    <span class="code-object">String</span> serviceId, Logger logger,
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+  @Match("*")
+  public static &lt;T&gt; T decorateLogging(Class&lt;T&gt; serviceInterface, T delegate,
+    String serviceId, Logger logger,
     LoggingDecorator decorator)
   {
-    <span class="code-keyword">return</span> decorator.build(serviceInterface, delegate, serviceId, logger);
-  }   </pre>
+    return decorator.build(serviceInterface, delegate, serviceId, logger);
+  }   ]]></script>
 </div></div>
 
 <p>You can use multiple patterns with @Match, in which case, the decorator will be applied to a service that matches <em>any</em> of the patterns. For instance, if you only wanted logging for your data access and business logic services, you might end up with <tt>@Match("Data*", "*Logic")</tt> (based, of course, on how you name your services).</p>
@@ -200,15 +211,15 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>For example, you almost always want logging decorators to come first, so:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-  @Match(<span class="code-quote">"*"</span>)
-  @Order(<span class="code-quote">"before:*"</span>)
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> &lt;T&gt; T decorateLogging(<span class="code-object">Class</span>&lt;T&gt; serviceInterface, T delegate,
-    <span class="code-object">String</span> serviceId, Logger logger,
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+  @Match("*")
+  @Order("before:*")
+  public static &lt;T&gt; T decorateLogging(Class&lt;T&gt; serviceInterface, T delegate,
+    String serviceId, Logger logger,
     LoggingDecorator decorator)
   {
-    <span class="code-keyword">return</span> decorator.build(serviceInterface, delegate, serviceId, logger);
-  }   </pre>
+    return decorator.build(serviceInterface, delegate, serviceId, logger);
+  }   ]]></script>
 </div></div>
 
 <p>"before:*" indicates that this decorator should come before any decorator in <em>any</em> module.</p>
@@ -221,22 +232,22 @@ table.ScrollbarTable td.ScrollbarNextIco
 
 
 
-<div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="/images/confluence/information.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Added in 5.2</b><br clear="none"></td></tr></table></div>
+<div class="panelMacro"><table class="infoMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/information.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Added in 5.2</b><br clear="none"></td></tr></table></div>
 <div style="border-right: 20px solid #D8E4F1;border-left: 20px solid #D8E4F1;"></div>
 
 <p>Starting from version 5.2, Tapestry supports annotation-driven decorator methods. If the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Decorate.html">@Decorate</a> annotation is present, the decorator method can be arbitrary named, as shown in the following example.</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
   @Decorate
-  @Match(<span class="code-quote">"*DAO"</span>)
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> &lt;T&gt; T byServiceId(<span class="code-object">Class</span>&lt;T&gt; serviceInterface, T delegate,
-    <span class="code-object">String</span> serviceId, Logger logger,
+  @Match("*DAO")
+  public static &lt;T&gt; T byServiceId(Class&lt;T&gt; serviceInterface, T delegate,
+    String serviceId, Logger logger,
     LoggingDecorator decorator)
   {
-    <span class="code-keyword">return</span> decorator.build(serviceInterface, delegate, serviceId, logger);
+    return decorator.build(serviceInterface, delegate, serviceId, logger);
   }
-</pre>
+]]></script>
 </div></div>
 
 <p>The decorator above is applied to any service whose id matches the "*DAO" pattern.</p>
@@ -244,16 +255,16 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>Alternatively, marker annotations can be placed on the decorate method to match a specific service.</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
   @Decorate
   @Blue
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> &lt;T&gt; T byMarkerAnnotation(<span class="code-object">Class</span>&lt;T&gt; serviceInterface, T delegate,
-    <span class="code-object">String</span> serviceId, Logger logger,
+  public static &lt;T&gt; T byMarkerAnnotation(Class&lt;T&gt; serviceInterface, T delegate,
+    String serviceId, Logger logger,
     LoggingDecorator decorator)
   {
-    <span class="code-keyword">return</span> decorator.build(serviceInterface, delegate, serviceId, logger);
+    return decorator.build(serviceInterface, delegate, serviceId, logger);
   }
-</pre>
+]]></script>
 </div></div>
 
 <p>The decorator above is applied to any service that is marked by the @Blue annotation.</p>
@@ -261,30 +272,30 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>By default, <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Decorate.html">@Decorate</a> annotation applies the decorator to any service matched by the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Match.html">@Match</a> or marker annotations. You can limit the matching to a single service interface, as shown in the following example.</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
   @Decorate(serviceInterface=MyService.class)
-  @Match(<span class="code-quote">"*DAO"</span>)
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> &lt;T&gt; T byServiceId(<span class="code-object">Class</span>&lt;T&gt; serviceInterface, T delegate,
-    <span class="code-object">String</span> serviceId, Logger logger,
+  @Match("*DAO")
+  public static &lt;T&gt; T byServiceId(Class&lt;T&gt; serviceInterface, T delegate,
+    String serviceId, Logger logger,
     LoggingDecorator decorator)
   {
-    <span class="code-keyword">return</span> decorator.build(serviceInterface, delegate, serviceId, logger);
-  }</pre>
+    return decorator.build(serviceInterface, delegate, serviceId, logger);
+  }]]></script>
 </div></div>
 
 <p>In the example above, the decorator is applied to any implementation of MyService interfaces whose id matches the "*DAO" pattern.</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
   @Decorate(serviceInterface=MyService.class)
   @Blue
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> &lt;T&gt; T byMarkerAnnotation(<span class="code-object">Class</span>&lt;T&gt; serviceInterface, T delegate,
-    <span class="code-object">String</span> serviceId, Logger logger,
+  public static &lt;T&gt; T byMarkerAnnotation(Class&lt;T&gt; serviceInterface, T delegate,
+    String serviceId, Logger logger,
     LoggingDecorator decorator)
   {
-    <span class="code-keyword">return</span> decorator.build(serviceInterface, delegate, serviceId, logger);
+    return decorator.build(serviceInterface, delegate, serviceId, logger);
   }
-</pre>
+]]></script>
 </div></div>
 
 <p>The decorator above is applied to any implementation of the MyService interface that is marked by the @Blue annotation.</p>
@@ -312,62 +323,62 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>By way of an example, we'll show an implementation of the LoggingDecorator service:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">public</span> class LoggingDecoratorImpl <span class="code-keyword">implements</span> LoggingDecorator
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+public class LoggingDecoratorImpl implements LoggingDecorator
 {
-    <span class="code-keyword">private</span> <span class="code-keyword">final</span> AspectDecorator aspectDecorator;
+    private final AspectDecorator aspectDecorator;
 
-    <span class="code-keyword">private</span> <span class="code-keyword">final</span> ExceptionTracker exceptionTracker;
+    private final ExceptionTracker exceptionTracker;
 
-    <span class="code-keyword">public</span> LoggingDecoratorImpl(AspectDecorator aspectDecorator, ExceptionTracker exceptionTracker)
+    public LoggingDecoratorImpl(AspectDecorator aspectDecorator, ExceptionTracker exceptionTracker)
     {
-        <span class="code-keyword">this</span>.aspectDecorator = aspectDecorator;
-        <span class="code-keyword">this</span>.exceptionTracker = exceptionTracker;
+        this.aspectDecorator = aspectDecorator;
+        this.exceptionTracker = exceptionTracker;
     }
 
-    <span class="code-keyword">public</span> &lt;T&gt; T build(<span class="code-object">Class</span>&lt;T&gt; serviceInterface, T delegate, <span class="code-object">String</span> serviceId, <span class="code-keyword">final</span> Logger logger)
+    public &lt;T&gt; T build(Class&lt;T&gt; serviceInterface, T delegate, String serviceId, final Logger logger)
     {
-        <span class="code-keyword">final</span> ServiceLogger serviceLogger = <span class="code-keyword">new</span> ServiceLogger(logger, exceptionTracker);
+        final ServiceLogger serviceLogger = new ServiceLogger(logger, exceptionTracker);
 
-        MethodAdvice advice = <span class="code-keyword">new</span> MethodAdvice()
+        MethodAdvice advice = new MethodAdvice()
         {
-            <span class="code-keyword">public</span> void advise(Invocation invocation)
+            public void advise(Invocation invocation)
             {
-                <span class="code-object">boolean</span> debug = logger.isDebugEnabled();
+                boolean debug = logger.isDebugEnabled();
 
-                <span class="code-keyword">if</span> (debug) serviceLogger.entry(invocation);
+                if (debug) serviceLogger.entry(invocation);
 
-                <span class="code-keyword">try</span>
+                try
                 {
                     invocation.proceed();
                 }
-                <span class="code-keyword">catch</span> (RuntimeException ex)
+                catch (RuntimeException ex)
                 {
-                    <span class="code-keyword">if</span> (debug) serviceLogger.fail(invocation, ex);
+                    if (debug) serviceLogger.fail(invocation, ex);
 
-                    <span class="code-keyword">throw</span> ex;
+                    throw ex;
                 }
 
-                <span class="code-keyword">if</span> (!debug) <span class="code-keyword">return</span>;
+                if (!debug) return;
 
-                <span class="code-keyword">if</span> (invocation.isFail())
+                if (invocation.isFail())
                 {
                     Exception thrown = invocation.getThrown(Exception.class);
 
                     serviceLogger.fail(invocation, thrown);
 
-                    <span class="code-keyword">return</span>;
+                    return;
                 }
 
                 serviceLogger.exit(invocation);
             }
         };
 
-        <span class="code-keyword">return</span> aspectDecorator.build(serviceInterface, delegate, advice,
-                                      <span class="code-object">String</span>.format(<span class="code-quote">"&lt;Logging interceptor <span class="code-keyword">for</span> %s(%s)&gt;"</span>, serviceId,
+        return aspectDecorator.build(serviceInterface, delegate, advice,
+                                      String.format("&lt;Logging interceptor for %s(%s)&gt;", serviceId,
                                                     serviceInterface.getName()));
     }
-}</pre>
+}]]></script>
 </div></div>
 
 <p><em>The actual code has been refactored slightly since this documentation was written.</em></p>
@@ -388,12 +399,12 @@ 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="service-advisors.html"><img align="middle" border="0" src="/images/confluence/back_16.gif" width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%"><a shape="rect" href="service-advisors.html">Service Advisors</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="ioc.html"><img align="middle" border="0" src="/images/confluence/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%">&#160;<a shape="rect" href="tapestry-ioc-configuration.html">Tapestry IoC Configuration</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="tapestry-ioc-configuration.html"><img align="middle" border="0" src="/images/confluence/forwd_16.gif" wi
 dth="16" height="16"></a></td></tr></table></div></div>
+/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="service-advisors.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="service-advisors.html">Service Advisors</a>&#160;</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%">&#160;<a shape="rect" href="tapestry-ioc-configuration.html">Tapestry IoC Configuration</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="tapestry-ioc-configuration.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>
 
 <div class="clearer"></div>
 <div id="footer">
-<div id="footer"><p>Apache Tapestry, Tapestry, Apache, the Apache feather logo, and the Apache Tapestry project logo are trademarks of The Apache Software Foundation.</p>
+<div id="footer"><p>Apache Tapestry, Tapestry, Apache, the Apache feather logo, and the Apache Tapestry project logo are trademarks of The Apache Software Foundation.<br clear="none">
 <script type="text/javascript">
   var _gaq = _gaq || [];
   _gaq.push(['_setAccount', 'UA-400821-1']);
@@ -404,7 +415,7 @@ table.ScrollbarTable td.ScrollbarNextIco
     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
   })();
-</script></div>
+</script></p></div>
 </div>
 		<div id="comments_thread"></div>
 		<script type="text/javascript" src="https://comments.apache.org/show_comments.lua?site=tapestry&amp;page=http://tapestry.apache.org/tapestry-ioc-decorators.html" async="true">

Modified: websites/production/tapestry/content/tapestry-ioc-modules.html
==============================================================================
--- websites/production/tapestry/content/tapestry-ioc-modules.html (original)
+++ websites/production/tapestry/content/tapestry-ioc-modules.html Sun Sep 22 22:21:21 2013
@@ -24,7 +24,18 @@
     Tapestry IoC Modules -- Apache Tapestry
   </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css">
+
+    <link href='http://cxf.apache.org/resources/highlighter/styles/shCoreCXF.css' rel='stylesheet' type='text/css' />
+  <link href='http://cxf.apache.org/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
+
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
+
 </head>
 <body>
   <div class="wrapper bs">
@@ -34,9 +45,9 @@
 </div>
 
 <div id="top">
-<div id="smallbanner"><div class="searchbox" style="float:right;margin: .3em 1em .1em 1em">
+<div id="smallbanner"><div class="searchbox" style="float:right;margin: .3em 1em .1em 1em"><p>
 <span style="color: #999; font-size: 90%">Tapestry docs, issues, wikis &amp; blogs:</span>
-<form enctype="application/x-www-form-urlencoded" method="get" action="http://tapestry.apache.org/search.html">
+</p><form enctype="application/x-www-form-urlencoded" method="get" action="http://tapestry.apache.org/search.html">
   <input type="text" name="q">
   <input type="submit" value="Search">
 </form>
@@ -64,7 +75,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="tapestry-ioc-overview.html"><img align="middle" border="0" src="/images/confluence/back_16.gif" width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%"><a shape="rect" href="tapestry-ioc-overview.html">Tapestry IoC Overview</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="ioc.html"><img align="middle" border="0" src="/images/confluence/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%">&#160;<a shape="rect" href="defining-tapestry-ioc-services.html">Defining Tapestry IOC Services</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="defining-tapestry-ioc-services.html"><img align="middle" border="0" src="/images/
 confluence/forwd_16.gif" width="16" height="16"></a></td></tr></table></div>
+/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="tapestry-ioc-overview.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="tapestry-ioc-overview.html">Tapestry IoC Overview</a>&#160;</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%">&#160;<a shape="rect" href="defining-tapestry-ioc-services.html">Defining Tapestry IOC Services</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="defining-tapestry-ioc
 -services.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><a shape="rect" name="TapestryIoCModules-TapestryIoCModules"></a>Tapestry IoC Modules</h1>
 
@@ -86,16 +97,16 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>Service builder methods are public methods. They are often static. Here's a trivial example:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">package</span> org.example.myapp.services;
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+package org.example.myapp.services;
 
-<span class="code-keyword">public</span> class MyAppModule
+public class MyAppModule
 {
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> Indexer build()
+  public static Indexer build()
   {
-    <span class="code-keyword">return</span> <span class="code-keyword">new</span> IndexerImpl();
+    return new IndexerImpl();
   }
-}</pre>
+}]]></script>
 </div></div>
 
 <p>Any public method (static or instance) whose name starts with "build" is a service builder method, implicitly defining a service within the module.</p>
@@ -119,18 +130,18 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>An alternate, and usually preferred, way to define a service is via a module's bind() method. The previous example can be rewritten as:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">package</span> org.example.myapp.services;
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+package org.example.myapp.services;
 
-<span class="code-keyword">import</span> org.apache.tapestry5.ioc.ServiceBinder;
+import org.apache.tapestry5.ioc.ServiceBinder;
 
-<span class="code-keyword">public</span> class MyAppModule
+public class MyAppModule
 {
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> void bind(ServiceBinder binder)
+  public static void bind(ServiceBinder binder)
   {
      binder.bind(Indexer.class, IndexerImpl.class);
   }
-}</pre>
+}]]></script>
 </div></div>
 
 <p>For more details, see see <a shape="rect" href="defining-tapestry-ioc-services.html" title="Defining Tapestry IOC Services">Defining Tapestry IOC Services</a>. In most cases, autobuilding is the <em>preferred</em> approach.</p>
@@ -149,28 +160,28 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>This gives you a chance to store common services in instance variables for later use inside service builder methods.</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 
-<span class="code-keyword">public</span> class MyModule
+public class MyModule
 {   
-  <span class="code-keyword">private</span> <span class="code-keyword">final</span> JobScheduler scheduler;
-  <span class="code-keyword">private</span> <span class="code-keyword">final</span> FileSystem fileSystem;
+  private final JobScheduler scheduler;
+  private final FileSystem fileSystem;
   
-  <span class="code-keyword">public</span> MyModule(JobScheduler scheduler, FileSystem fileSystem)
+  public MyModule(JobScheduler scheduler, FileSystem fileSystem)
   {
-    <span class="code-keyword">this</span>.scheduler = scheduler;
-    <span class="code-keyword">this</span>.fileSystem = fileSystem;
+    this.scheduler = scheduler;
+    this.fileSystem = fileSystem;
   }
   
-  <span class="code-keyword">public</span> Indexer build()
+  public Indexer build()
   {
-    IndexerImpl indexer = <span class="code-keyword">new</span> IndexerImpl(fileSystem);
+    IndexerImpl indexer = new IndexerImpl(fileSystem);
       
     scheduler.scheduleDailyJob(indexer);
       
-    <span class="code-keyword">return</span> indexer;
+    return indexer;
   }
-}</pre>
+}]]></script>
 </div></div>
 
 <p>Notice that we've switched from <em>static</em> methods to <em>instance</em> methods. Since the builder methods are not static, the MyModule class will be instantiated so that the methods may be invoked. The constructor receives two common dependencies, which are stored into instance fields that may later be used inside service builder methods such as buildIndexer().</p>
@@ -208,25 +219,25 @@ Note that the fields are final: this is 
 <p>Often, all services in a module should share a marker, this can be specified with a @Marker annotation on the module class. For example, the TapestryIOCModule:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 @Marker(Builtin.class)
-<span class="code-keyword">public</span> <span class="code-keyword">final</span> class TapestryIOCModule
+public final class TapestryIOCModule
 {
-  . . .</pre>
+  . . .]]></script>
 </div></div>
 
 <p>This references a particular annotation class, Builtin:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
 @Target(
 { PARAMETER, FIELD })
 @Retention(RUNTIME)
 @Documented
-<span class="code-keyword">public</span> @<span class="code-keyword">interface</span> Builtin
+public @interface Builtin
 {
 
-}</pre>
+}]]></script>
 </div></div>
 
 <p>The annotation can be applied to method and constructor parameters, for use within the IoC container. It can also be applied to fields, though this is specific to the Tapestry web framework.</p>
@@ -240,24 +251,24 @@ Note that the fields are final: this is 
 <p>Using this style, the previous example of a module class may be rewritten:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">public</span> class MyModule
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+public class MyModule
 {
   @Inject
-  <span class="code-keyword">private</span> JobScheduler scheduler;
+  private JobScheduler scheduler;
 
   @Inject
-  <span class="code-keyword">private</span> FileSystem fileSystem;
+  private FileSystem fileSystem;
 
-  <span class="code-keyword">public</span> Indexer build()
+  public Indexer build()
   {
-    IndexerImpl indexer = <span class="code-keyword">new</span> IndexerImpl(fileSystem);
+    IndexerImpl indexer = new IndexerImpl(fileSystem);
       
     scheduler.scheduleDailyJob(indexer);
 
-    <span class="code-keyword">return</span> indexer;
+    return indexer;
   }
-}</pre>
+}]]></script>
 </div></div>
 
 <style type="text/css">/*<![CDATA[*/
@@ -268,12 +279,12 @@ 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="tapestry-ioc-overview.html"><img align="middle" border="0" src="/images/confluence/back_16.gif" width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%"><a shape="rect" href="tapestry-ioc-overview.html">Tapestry IoC Overview</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="ioc.html"><img align="middle" border="0" src="/images/confluence/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%">&#160;<a shape="rect" href="defining-tapestry-ioc-services.html">Defining Tapestry IOC Services</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="defining-tapestry-ioc-services.html"><img align="middle" border="0" src="/images/
 confluence/forwd_16.gif" width="16" height="16"></a></td></tr></table></div></div>
+/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="tapestry-ioc-overview.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="tapestry-ioc-overview.html">Tapestry IoC Overview</a>&#160;</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%">&#160;<a shape="rect" href="defining-tapestry-ioc-services.html">Defining Tapestry IOC Services</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="defining-tapestry-ioc
 -services.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>
 
 <div class="clearer"></div>
 <div id="footer">
-<div id="footer"><p>Apache Tapestry, Tapestry, Apache, the Apache feather logo, and the Apache Tapestry project logo are trademarks of The Apache Software Foundation.</p>
+<div id="footer"><p>Apache Tapestry, Tapestry, Apache, the Apache feather logo, and the Apache Tapestry project logo are trademarks of The Apache Software Foundation.<br clear="none">
 <script type="text/javascript">
   var _gaq = _gaq || [];
   _gaq.push(['_setAccount', 'UA-400821-1']);
@@ -284,7 +295,7 @@ table.ScrollbarTable td.ScrollbarNextIco
     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
   })();
-</script></div>
+</script></p></div>
 </div>
 		<div id="comments_thread"></div>
 		<script type="text/javascript" src="https://comments.apache.org/show_comments.lua?site=tapestry&amp;page=http://tapestry.apache.org/tapestry-ioc-modules.html" async="true">

Modified: websites/production/tapestry/content/tapestry-ioc-overview.html
==============================================================================
--- websites/production/tapestry/content/tapestry-ioc-overview.html (original)
+++ websites/production/tapestry/content/tapestry-ioc-overview.html Sun Sep 22 22:21:21 2013
@@ -24,7 +24,18 @@
     Tapestry IoC Overview -- Apache Tapestry
   </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css">
+
+    <link href='http://cxf.apache.org/resources/highlighter/styles/shCoreCXF.css' rel='stylesheet' type='text/css' />
+  <link href='http://cxf.apache.org/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' type='text/css' />
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
+  <script src='http://cxf.apache.org/resources/highlighter/scripts/shBrushJava.js' type='text/javascript'></script>
+  <script type="text/javascript">
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+  </script>
+
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
+
 </head>
 <body>
   <div class="wrapper bs">
@@ -34,9 +45,9 @@
 </div>
 
 <div id="top">
-<div id="smallbanner"><div class="searchbox" style="float:right;margin: .3em 1em .1em 1em">
+<div id="smallbanner"><div class="searchbox" style="float:right;margin: .3em 1em .1em 1em"><p>
 <span style="color: #999; font-size: 90%">Tapestry docs, issues, wikis &amp; blogs:</span>
-<form enctype="application/x-www-form-urlencoded" method="get" action="http://tapestry.apache.org/search.html">
+</p><form enctype="application/x-www-form-urlencoded" method="get" action="http://tapestry.apache.org/search.html">
   <input type="text" name="q">
   <input type="submit" value="Search">
 </form>
@@ -64,7 +75,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="ScrollbarPrevName" width="33%">&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="ioc.html"><img align="middle" border="0" src="/images/confluence/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%">&#160;<a shape="rect" href="tapestry-ioc-modules.html">Tapestry IoC Modules</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="tapestry-ioc-modules.html"><img align="middle" border="0" src="/images/confluence/forwd_16.gif" width="16" height="16"></a></td></tr></table></div>
+/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%">&#160;</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%">&#160;<a shape="rect" href="tapestry-ioc-modules.html">Tapestry IoC Modules</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="tapestry-ioc-modules.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><a shape="rect" name="TapestryIoCOverview-TapestryIoCOverview"></a>Tapestry IoC Overview</h1>
 
@@ -166,19 +177,19 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>This code is for a metric that periodically counts the number of rows in a key database table. Other implementations of MetricProducer will be responsible for measuring CPU utilization, available disk space, number of requests per second, and so forth.</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">public</span> class TableMetricProducer <span class="code-keyword">implements</span> MetricProducer
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+public class TableMetricProducer implements MetricProducer
 {
   . . . 
 
-  <span class="code-keyword">public</span> void execute() 
+  public void execute() 
   {
-    <span class="code-object">int</span> rowCount = . . .;
-    Metric metric = <span class="code-keyword">new</span> Metric(<span class="code-quote">"app/clients"</span>, <span class="code-object">System</span>.currentTimeMillis(), rowCount);
-    <span class="code-keyword">new</span> QueueWriter().sendMetric(metric);
+    int rowCount = . . .;
+    Metric metric = new Metric("app/clients", System.currentTimeMillis(), rowCount);
+    new QueueWriter().sendMetric(metric);
   }
 }
-</pre>
+]]></script>
 </div></div>
 
 <p>We've omitted some of the details (this code will need a database URL or a connection pool to operate), so as to focus on the one method and it's relationship to the QueueWriter class.</p>
@@ -186,19 +197,19 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>Obviously, this code has a problem ... we're creating a new QueueWriter for each metric we write into the queue, and the QueueWriter presumably is going to open the JMS queue fresh each time, an expensive operation. Thus:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">public</span> class TableMetricProducer <span class="code-keyword">implements</span> MetricProducer
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+public class TableMetricProducer implements MetricProducer
 {
   . . . 
 
-  <span class="code-keyword">private</span> <span class="code-keyword">final</span> QueueWriter queueWriter = <span class="code-keyword">new</span> QueueWriter();
+  private final QueueWriter queueWriter = new QueueWriter();
 
-  <span class="code-keyword">public</span> void execute() 
+  public void execute() 
   {
-    <span class="code-object">int</span> rowCount = . . .;
-    Metric metric = <span class="code-keyword">new</span> Metric(<span class="code-quote">"app/clients"</span>, <span class="code-object">System</span>.currentTimeMillis(), rowCount);
+    int rowCount = . . .;
+    Metric metric = new Metric("app/clients", System.currentTimeMillis(), rowCount);
     queueWriter.sendMetric(metric);
-  }</pre>
+  }]]></script>
 </div></div>
 
 <p>That's better. It's not perfect ... a proper system might know when the application was being shutdown and would shut down the JMS Connection inside the QueueWriter as well.</p>
@@ -206,48 +217,48 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>Here's a more immediate problem: JMS connections are really meant to be shared, and we'll have lots of little classes collecting different metrics. So we need to make the QueueWriter shareable:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-  <span class="code-keyword">private</span> <span class="code-keyword">final</span> QueueWriter queueWriter = QueueWriter.getInstance();</pre>
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+  private final QueueWriter queueWriter = QueueWriter.getInstance();]]></script>
 </div></div>
 
 <p>... and inside class QueueWriter:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">public</span> class QueueWriter
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+public class QueueWriter
 {
-  <span class="code-keyword">private</span> <span class="code-keyword">static</span> QueueWriter instance;
+  private static QueueWriter instance;
 
-  <span class="code-keyword">private</span> QueueWriter()
+  private QueueWriter()
   {
     ...
   }
 
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> getInstance()
+  public static getInstance()
   {
-    <span class="code-keyword">if</span> (instance == <span class="code-keyword">null</span>)
+    if (instance == null)
     {
-      instance = <span class="code-keyword">new</span> QueueWriter();
+      instance = new QueueWriter();
     }
-    <span class="code-keyword">return</span> instance;
+    return instance;
   }
 }
-</pre>
+]]></script>
 </div></div>
 
 <p>Much better! Now all the metric producers running inside all the threads can share a single QueueWriter. Oh wait ...</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-  <span class="code-keyword">public</span> <span class="code-keyword">synchronized</span> <span class="code-keyword">static</span> getInstance()
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+  public synchronized static getInstance()
   {
-    <span class="code-keyword">if</span> (instance == <span class="code-keyword">null</span>)
+    if (instance == null)
     {
-      instance = <span class="code-keyword">new</span> QueueWriter();
+      instance = new QueueWriter();
     }
-    <span class="code-keyword">return</span> instance;
+    return instance;
   }
-</pre>
+]]></script>
 </div></div>
 
 <p>Is that necessary? Yes. Will the code work without it? Yes &#8211; <b>99.9% of the time</b>. In fact, this is a very common error in systems that manually code a lot of these construction patterns: forgetting to properly synchronize access. These things often work in development and testing, but fail (with infuriating infrequency) in production, as it takes two or more threads running simultaneously to reveal the coding error.</p>
@@ -261,22 +272,22 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>We'll need to change TableMetricProducer to take the QueueWriter as a constructor parameter.</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">public</span> class TableMetricProducer <span class="code-keyword">implements</span> MetricProducer
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+public class TableMetricProducer implements MetricProducer
 {
-  <span class="code-keyword">private</span> <span class="code-keyword">final</span> QueueWriter queueWriter;
+  private final QueueWriter queueWriter;
 
   /**
    * The normal constructor.
    *
    */
-  <span class="code-keyword">public</span> TableMetricProducer(. . .)
+  public TableMetricProducer(. . .)
   {
-    <span class="code-keyword">this</span>(QueueWriterImpl.getInstance(), . . .);
+    this(QueueWriterImpl.getInstance(), . . .);
   }
 
   /**
-   * Constructor used <span class="code-keyword">for</span> testing.
+   * Constructor used for testing.
    *
    */
   TableMetricProducer(QueueWriter queueWriter, . . .)
@@ -285,15 +296,15 @@ table.ScrollbarTable td.ScrollbarNextIco
     . . . 
   }
 
-  <span class="code-keyword">public</span> void execute() 
+  public void execute() 
   {
-    <span class="code-object">int</span> rowCount = . . .;
-    Metric metric = <span class="code-keyword">new</span> Metric(<span class="code-quote">"app/clients"</span>, <span class="code-object">System</span>.currentTimeMillis(), rowCount);
+    int rowCount = . . .;
+    Metric metric = new Metric("app/clients", System.currentTimeMillis(), rowCount);
 
    queueWriter.sendMetric(metric);
   }
 }
-</pre>
+]]></script>
 </div></div>
 
 <p>This still isn't ideal, as we still have an explicit linkage between TableMetricProducer and QueueWriterImpl.</p>
@@ -305,21 +316,21 @@ table.ScrollbarTable td.ScrollbarNextIco
 <p>For comparison, lets see what the Tapestry IoC implementation would look like:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-<span class="code-keyword">public</span> class MonitorModule
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+public class MonitorModule
 {
-  <span class="code-keyword">public</span> <span class="code-keyword">static</span> void bind(ServiceBinder binder)
+  public static void bind(ServiceBinder binder)
   {
     binder.bind(QueueWriter.class, QueueWriterImpl.class);
     binder.bind(MetricScheduler.class, MetricSchedulerImpl.class);
   }
 
-  <span class="code-keyword">public</span> void contributeMetricScheduler(Configuration&lt;MetricProducer&gt; configuration, QueueWriter queueWriter, . . .)
+  public void contributeMetricScheduler(Configuration&lt;MetricProducer&gt; configuration, QueueWriter queueWriter, . . .)
   {
-    configuration.add(<span class="code-keyword">new</span> TableMetricProducer(queueWriter, . . .))
+    configuration.add(new TableMetricProducer(queueWriter, . . .))
   }
 }
-</pre>
+]]></script>
 </div></div>
 
 <p>Again, we've omitted a few details related to the database the TableMetricProducer will point at (in fact, Tapestry IoC provides a lot of support for configuration of this type as well, which is yet another concern).</p>
@@ -373,12 +384,12 @@ 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="ScrollbarPrevName" width="33%">&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="ioc.html"><img align="middle" border="0" src="/images/confluence/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%">&#160;<a shape="rect" href="tapestry-ioc-modules.html">Tapestry IoC Modules</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="tapestry-ioc-modules.html"><img align="middle" border="0" src="/images/confluence/forwd_16.gif" width="16" height="16"></a></td></tr></table></div></div>
+/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%">&#160;</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%">&#160;<a shape="rect" href="tapestry-ioc-modules.html">Tapestry IoC Modules</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="tapestry-ioc-modules.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>
 
 <div class="clearer"></div>
 <div id="footer">
-<div id="footer"><p>Apache Tapestry, Tapestry, Apache, the Apache feather logo, and the Apache Tapestry project logo are trademarks of The Apache Software Foundation.</p>
+<div id="footer"><p>Apache Tapestry, Tapestry, Apache, the Apache feather logo, and the Apache Tapestry project logo are trademarks of The Apache Software Foundation.<br clear="none">
 <script type="text/javascript">
   var _gaq = _gaq || [];
   _gaq.push(['_setAccount', 'UA-400821-1']);
@@ -389,7 +400,7 @@ table.ScrollbarTable td.ScrollbarNextIco
     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
   })();
-</script></div>
+</script></p></div>
 </div>
 		<div id="comments_thread"></div>
 		<script type="text/javascript" src="https://comments.apache.org/show_comments.lua?site=tapestry&amp;page=http://tapestry.apache.org/tapestry-ioc-overview.html" async="true">