You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chris Lewis <ch...@bellsouth.net> on 2008/01/22 16:59:40 UTC

T5: service access to ApplicatonDefaults

Dear list,

I'm working on a service that can be configured via string symbols. It 
seems to me like a good way to provide this is by allowing the developer 
contribute symbols to the ApplicationDefaults in the app module, like so:

public static void 
contributeApplicationDefaults(MappedConfiguration<String, String> 
configuration) {
    //...
}


I see that tapestry5-acegi does this very thing, so I'd like to follow 
suit. However I'm not sure how my service implementation can access 
ApplicationDefault configs - can anyone tell me how this is done?

chris

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


Re: T5: service access to ApplicatonDefaults

Posted by Chris Lewis <ch...@bellsouth.net>.
Thanks Robert, much appreciated!

Robert Zeigler wrote:
> You can either:
>   1) Inject the symbol directly, or
>   2) Inject the SymbolSource service, and grab your symbols from there.
>
> This is a much more suitable alternative than accessing 
> "ApplicationDefaults" directly, because you can:
>   1) contribute to "factory defaults" for a default configuration
>   2) ApplicationDefaults contributions will override your factory 
> default contributions
>   3) You can override symbols on the command-line
>   4) You can provide other mechanisms for loading symbols (database, 
> file, etc.)*
>
> Robert
>
> * SymbolSource caches its values, so you can't use it (the way it is 
> now), if you want a "live" configuration system which allows you to 
> change configuration w/out restarting the application.
>
>
> On Jan 22, 2008, at 1/229:59 AM , Chris Lewis wrote:
>
>> Dear list,
>>
>> I'm working on a service that can be configured via string symbols. 
>> It seems to me like a good way to provide this is by allowing the 
>> developer contribute symbols to the ApplicationDefaults in the app 
>> module, like so:
>>
>> public static void 
>> contributeApplicationDefaults(MappedConfiguration<String, String> 
>> configuration) {
>>   //...
>> }
>>
>>
>> I see that tapestry5-acegi does this very thing, so I'd like to 
>> follow suit. However I'm not sure how my service implementation can 
>> access ApplicationDefault configs - can anyone tell me how this is done?
>>
>> chris
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
      

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


Re: T5: service access to ApplicatonDefaults

Posted by Robert Zeigler <ro...@scazdl.org>.
You can either:
   1) Inject the symbol directly, or
   2) Inject the SymbolSource service, and grab your symbols from there.

This is a much more suitable alternative than accessing  
"ApplicationDefaults" directly, because you can:
   1) contribute to "factory defaults" for a default configuration
   2) ApplicationDefaults contributions will override your factory  
default contributions
   3) You can override symbols on the command-line
   4) You can provide other mechanisms for loading symbols (database,  
file, etc.)*

Robert

* SymbolSource caches its values, so you can't use it (the way it is  
now), if you want a "live" configuration system which allows you to  
change configuration w/out restarting the application.


On Jan 22, 2008, at 1/229:59 AM , Chris Lewis wrote:

> Dear list,
>
> I'm working on a service that can be configured via string symbols.  
> It seems to me like a good way to provide this is by allowing the  
> developer contribute symbols to the ApplicationDefaults in the app  
> module, like so:
>
> public static void  
> contributeApplicationDefaults(MappedConfiguration<String, String>  
> configuration) {
>   //...
> }
>
>
> I see that tapestry5-acegi does this very thing, so I'd like to  
> follow suit. However I'm not sure how my service implementation can  
> access ApplicationDefault configs - can anyone tell me how this is  
> done?
>
> chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


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