On Mon, 17 Sep 2012 12:40:50 -0300, Muhammad Gelbana <m.gelb...@gmail.com>
wrote:
Why don't you just @Inject your SymbolProvider implementation in the
place
you need the mutable configurations and use it directly instead of using
SymbolSource?
You are talking about injecting a service and calling it's methods for
values, correct ? Anyway, I guess I don't have another option.
Yep. Don't forget that you can create your own Symbol-like annotation to
inject your mutable configuration symbols without using your service
directly. In Tapestry sources, take a look at SymbolObjectProvider and
TapestryIOCModule to know how to wire it into Tapestry-IoC.
One more thing, although I'll follow your advice, but I still want to
know how to do this the *@Symbol* way. I tried to contribute a symbol
object
provider with it's own symbol source and the symbol source it self has my
own symbol providers dealing with the database, but it isn't working. I'm
just trying to figure out my mistake.
@Contribute(MasterObjectProvider.class)
public static void
setupDBSYmbolObjectProviders(OrderedConfiguration<ObjectProvider>
configuration) {
configuration.addInstance("DBSymbol", DBSymbolObjectProvider.class,
OrderConstraintBuilder.before("AnnotationBasedContributions").build());
}
You need to contribute your ServiceProviders to the SymbolSource service,
not MasterObjectProvider. There's no need
*DBSymbolObjectProvider* implements *ObjectProvider* and actually get's
built with my own symbol source. My symbol source is built this way:
public SymbolSource buildDBSymbolSource(@Named("IpkConfig")
SymbolProvider
ipkConfig, @Named("IxProConfig") SymbolProvider ixProConfig) {
return new DBSymbolSource(Arrays.asList(ipkConfig, ixProConfig));
}
You're just creating a service named DBSymbolSource, while you should
contribute your service providers to the SymbolSource service instead.
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org