hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Carman" <ja...@carmanconsulting.com>
Subject RE: How to inject into many services the same Long value?
Date Tue, 11 Jul 2006 13:33:37 GMT
I would use a symbol for this.  If you have to change a properties file (and
re-deploy of course), then you can just as easily change your hivemodule.xml
file.  Correct?

-----Original Message-----
From: Aleksej [mailto:aleksej@ivs.lt] 
Sent: Tuesday, July 11, 2006 8:54 AM
To: hivemind-user@jakarta.apache.org
Subject: How to inject into many services the same Long value?

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