On 7/18/01 9:25 PM, "Diethelm Guallar, Gonzalo" <[EMAIL PROTECTED]>
wrote:

>> If a service property is defined as
>> 
>>   services.STFParserService.database=gandalf
>> 
>> then it must be retrieved
>> using the service Configuration, not TurbineResources. So
>> 
>> services.STFParserService.database=gandalf
>> 
>> should be retrieved in the services with
>> 
>> String database = getConfiguration().getString("database", "default");
>> 
>> Don't use TurbineResources, as the ServiceBroker processes the service
>> properties and makes them available via getConfiguration().
> 
> Ok, thanks for the hints. Now, how should I access the same
> property from a class that is not the service itself? For example
> from a class that is a utility for the service?

You have to get hold of the service from the service broker and
than get the configuration value. Use the code in the static helper
of any of the services to see how to do this. Once you have the
service than you use getConfiguration() again.

Either way you have to reference a service in your utility code:
TurbineResources, or the ServiceBroker to get hold of the singleton
instance of the service so that you can get the value from there.

> 
> Thanks again,
> 

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to