Shing, thanks for wonderful example!
Using it and James example I made everything as I wanted!
Shing Hing Man wrote:
I got an example of setting up a symbol source (a
property file) in HiveMind.
http://lombok.demon.co.uk/hiveMind/welcome?service=page/ListOfStringsSymbolSourceCP
It might be useful to you.
But I have not tried using
<long>${myLongValue}</long>
in <invoke-factory>.
Shing
--- Aleksej <[EMAIL PROTECTED]> wrote:
Hi!
I have lots of services and all of them ( almost )
require Long value
to be injected in it.
This value must be configured in one place (
properties file is ideal
variant, but configuration-point is good too ).
So far I have only 2 ideas how to make it:
1)
Create configuration point for Long and configure
all services with it
and after
injection read first of them. But I don't know how
to make configuration
of primitives
and I don't like that service will get List but not
Long.
2)
Create very simple service which reads Long value
from some properties
file ( on classpath or anywhere else ),
and has property which returns it. Then to configure
each service to
inject service object in it. Something
like
"service-property:ApplicationConfig:myLongValue".
But I probably want to have something like:
<implementation service-id="SomeService">
<invoke-factory model="singleton">
<construct class="ClassFullName">
<long>${myLongValue}</long>
</construct>
</invoke-factory>
</implementation>
and to provide ${myLongValue} in some external
properties file ( or
maybe some other way ).
I think that I need to dig for word "symbol" but I
don't know what is it
and is it really
the thing I searching for.
Home page :
http://uk.geocities.com/matmsh/index.html
___________________________________________________________
The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html
|