<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=thomasw" rel="nofollow">Thomas Whitmore</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-2009?redirect=false" rel="nofollow">SPR-2009</a></strong> and commented</p>
<p dir="auto">Custom  PropertyEditors registered in the context could be widely useful for Data Binding, but unfortunately are not used in a thread-safe manner by the Data Binder.</p>
<p dir="auto">The Bean Factory does use these in a thread-safe manner; by synchronizing; but it is not clear that this would be suitable for heavy load of request-processing. Synchronizing on each individual editor, or establishing a well-defined API to 'duplicate' editors treating the original only as a template, might be solutions.</p>
<p dir="auto">For the moment I'm keeping registration of these to the Controller. InitBinder() method - instantiating the editors there. This is safe, but if editors worked better I could quite widely genericize my code.</p>
<p dir="auto">Other people have noticed small versions of this problem (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398048617" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/4799" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/4799/hovercard" href="https://github.com/spring-projects/spring-framework/issues/4799">#4799</a>) but I think this may be a fairly major case. OTOH, maybe you've already got this addressed for the Spring-2 target.</p>
<hr>
<p dir="auto">What I was intending to do, that could be useful at the Framework level, is a ' Reference Editor ' converting between Hibernate object references &lt;-&gt; IDs in string form. Registering one of these with for your intended Target Class would then make all fields, combo boxes etc referencing this type automatically bound.  My code picks up Hibernate metadata &amp; types of simple identifiers to parse these automatically.</p>
<p dir="auto">FYI.</p>
<p dir="auto">Keep up the good work!</p>
<p dir="auto">Cheers,<br>
Thomas</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 1.2.8</p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=skaffman" rel="nofollow">Kenny MacLeod</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-4431?redirect=false" rel="nofollow">SPR-4431</a></strong> and commented</p>
<p dir="auto">It occurred to me that a neat application of autowiring would be the ability to autowire logger objects.</p>
<p dir="auto">Say a class declares something like:</p>
<p dir="auto">private <code class="notranslate">@Autowired</code> Log logger;</p>
<p dir="auto">where Log is from commons-logging.  Spring would then generate a Log object for the declaring class and then inject it.</p>
<p dir="auto">I don't think this can be done using the existing resolveResolvableDependency mechanism, since information about the dependent class isn't made available in order to create the Log.</p>
<p dir="auto">Thoughts?</p>
<hr>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/20489/IAutowireCandidateFactory.java" rel="nofollow">IAutowireCandidateFactory.java</a> (<em>241 bytes</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/20393/Log.java" rel="nofollow">Log.java</a> (<em>566 bytes</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/20490/LoggerAutowireFactory.java" rel="nofollow">LoggerAutowireFactory.java</a> (<em>1.14 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/20394/LogPostProcessor.java" rel="nofollow">LogPostProcessor.java</a> (<em>1.31 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/20491/PluggableAutowireCandidateResolver.java" rel="nofollow">PluggableAutowireCandidateResolver.java</a> (<em>2.10 kB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398085341" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/9110" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/9110/hovercard" href="https://github.com/spring-projects/spring-framework/issues/9110">#9110</a> Support <code class="notranslate">@autowiring</code> of Loggers (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto">11 votes, 14 watchers</p>