<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Team,<div><br></div><div>To provide simple to powerfull ways to use Seam Social, I have 2 solutions to inject the same Bean</div><div><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(119, 119, 119); "><span style="color: #000000"> </span>@Inject</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> Twitter <span style="color: #102bc3">twitter</span>;</div><div><br></div><div>and</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(119, 119, 119); "><span style="color: #000000"> </span>@Inject</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #777777">@RelatedTo</span>(Service.<span style="color: #102bc3">Twitter</span>)</div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "> OAuthService </span><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; "><span style="color: #102bc3">twitter</span></span><span class="Apple-style-span" style="font-family: Monaco; font-size: 11px; ">;</span> <br><div><br class="webkit-block-placeholder"></div><div>At the end "twitter" contains an instance of TwitterScribe bean in the 2 cases.</div><div><br class="webkit-block-placeholder"></div><div>To achieve that I have to create a producer like this :</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; color: rgb(119, 119, 119); "> @Produces</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #777777">@RelatedTo</span>(Service.<span style="color: #102bc3">Twitter</span>)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #941965">protected</span> OAuthService qualifiedTwitterProducer(<span style="color: #777777">@New</span> TwitterScribe service) {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> <span style="color: #941965">return</span> service;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "> }</div></div><div><br class="webkit-block-placeholder"></div><div>in addition of TwitterScribe bean which has the @Default qualifier.</div><div><br></div><div>As I'll have to do that for each service and people extending the API will also have to provide this straightforward producer for their own service bean, I was wondering if there wasn't a more elegant (generic ?) way to create a bean responding to @default and another qualifier the same way.</div><div><br></div><div>thanks for your feedback on that.</div><div><br class="webkit-block-placeholder"></div><div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><div><div><br class="Apple-interchange-newline">Antoine</div><br></div><br></div><br></div><br></div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br></div></body></html>