Hello all,
I created simple Spring Resource Abstraction wrapper whose copy classpath
file to given destination. If file exists my CopyingResource will not copy
file but use existing version.
Sample configuration:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
    xmlns:http="http://servicemix.apache.org/http/1.0";
    xmlns:ocs="http://oncline.calculator.servicemix.pl/";>

    <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="location">
            <bean id="location"
class="org.code_house.spring.CopyingResource">
                <constructor-arg index="0"
value="file:${servicemix.home}/unitconf/proxy/ocs/lan.properties" />
                <property name="source" value="classpath:lan.properties" />
            </bean>
        </property>
    </bean>

    <http:endpoint service="ocs:CalculateService" soap="true"
        endpoint="provider" role="provider" 
        locationURI="${target.url}" timeout="${lan.timeout}" />

</beans>

Source code for class is available at: http://wklej.to/SlW. Fell free to
re-use. The placeholder ${servicemix.home} are resolved in runtime before
PropertyPlaceholderRuns because servicemix starting scripts use
-Dservicemix.home.


lhe77 wrote:
> 
> Good to know ;)
> 
> 
> Am Mittwoch 15 Oktober 2008 10:15:15 schrieb Steffen Rumpf:
>> Works fine.
>>
>> Steffen Rumpf schrieb:
>> > I don't have it in my SU I have my configuration inside SMX like
>> > "<SERVICEMIX_HOME>/application_conf" and added this directory to the
>> SMX
>> > classpath. But I think this must be the same configuration.
>> >
>> > Regards
>> > /Steffen
>> >
>> > Lars Heinemann schrieb:
>> >> I think if you have the file inside your SU it would be something
>> like:
>> >>
>> >> <property name="location">
>> >>   <value>classpath:pathes.properties</value>
>> >> </property>
>> >>
>> >> Regards
>> >> Lars
>> >>
>> >> Am Mittwoch 15 Oktober 2008 10:02:26 schrieb Steffen Rumpf:
>> >>> Ah,
>> >>> nice work xD Do you know if I can use something like:
>> >>>     <bean id="propertyConfigurer"
>> >>>
>> class="org.springframework.beans.factory.config.PropertyPlaceholderConf
>> >>>igur er"> <property name="location">
>> >>>          <value>file:pathes.properties</value>
>> >>>       </property>
>> >>>     </bean>
>> >>> When I have the properties file in classpath? I will try it and send
>> a
>> >>> response if it works.
>> >>>
>> >>> Regards
>> >>> /Steffen
>> >>>
>> >>> Lars Heinemann schrieb:
>> >>>> Steffen,
>> >>>>
>> >>>> I described this in my blog some time ago.
>> >>>> See:
>> >>>>
>> http://lhein.blogspot.com/2008/09/servicemix-and-flexible-endpoint.htm
>> >>>>l
>> >>>>
>> >>>> Regards
>> >>>> Lars
>> >>>>
>> >>>> Am Mittwoch 15 Oktober 2008 09:49:06 schrieb Steffen Rumpf:
>> >>>>> Hi,
>> >>>>> my question is: Is it possible to make something like a property
>> >>>>> based configuration of the file component? In example
>> >>>>>
>> >>>>> <file:poller service="whatever:Inbox"
>> >>>>>                    endpoint="endpoint"
>> >>>>>                    targetService="whatever:Outbox"
>> >>>>>                    file="${inboxpath}"/>
>> >>>>>
>> >>>>> Where inboxpath is defined in a property file which is stored in
>> >>>>> classpath?
>> >>>>>
>> >>>>> Regards
>> >>>>> /Steffen
> 
> 
> 


-----
Lukasz Dywicki,
Integration Developer
http://blog.dywicki.pl/
-- 
View this message in context: 
http://www.nabble.com/Property-based-configuration-of-servicemix-file-component-tp19988554p19990041.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to