The service id is the word that appears after the "build"? Like, if I do this:

«OfflineJob buildFoo(@InjectService("EjbContext") Context ejbContext) throws 
NamingException { ... }
OfflineJob buildBar(@InjectService("EjbContext") Context ejbContext) throws 
NamingException { ... }»

Will I be able to do

�...@inject
private OfflineJob foo;

@Inject
private OfflineJob bar;»

?

Thanks.



On 29-12-2010 15:42, Robert Zeigler wrote:
Both could be built, but you'll get an exception at runtime because Tapestry 
can't disambiguate which service you want injected.
You would need to either specify the service id of (foo or bar) of the service 
you want injected, or else mark the two services in some way and use said 
marker annotation to uniquely identify the service that you want injected.
See also: 
http://tapestry.apache.org/tapestry5.2-dev/apidocs/org/apache/tapestry5/ioc/annotations/Marker.html

Robert

On Dec 29, 2010, at 12/299:33 AM , Sergio Esteves wrote:

Hi all,

If I have a class with this:
�...@inject
@OfflineJob engine;»

and my project class:

«OfflineJob buildFoo(@InjectService("EjbContext") Context ejbContext) throws 
NamingException { ... }
OfflineJob buildBar(@InjectService("EjbContext") Context ejbContext) throws 
NamingException { ... }»

Which method will it use to build the engine object?

Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to