hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aleksej <alek...@ivs.lt>
Subject How to inject into many services the same Long value?
Date Tue, 11 Jul 2006 12:53:47 GMT
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.

Mime
View raw message