How can I define a service url in a property file?

View: New views
4 Messages — Rating Filter:   Alert me  

How can I define a service url in a property file?

by youhaodeyi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I defined a service url in xbean.xml which will be packaged into a SU. If the url is changed, I have to re-package the SU. How can I set the url in another place like a property file?

thanks.

Re: How can I define a service url in a property file?

by Jean-Baptiste Onofre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

the best way is to use a properties file to be able to change some xbean
properties "outside" the SU.

You should take a look on this wiki page:
http://servicemix.apache.org/4-beginner-outsource-su-configuration-in-a-properties-file.html

Regards
JB

youhaodeyi wrote:
> I defined a service url in xbean.xml which will be packaged into a SU. If the
> url is changed, I have to re-package the SU. How can I set the url in
> another place like a property file?
>
> thanks.

Re: How can I define a service url in a property file?

by youhaodeyi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

In this tutorial, it defines the property file by
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
      <property name="locations">
         <value>classpath:/myService.properties</value>
      </property>
   </bean>

I wander what the classpath:/myService.properties mean. Does the classpath mean the CLASSPATH environment variable?

Jean-Baptiste Onofré wrote:
Hi,

the best way is to use a properties file to be able to change some xbean
properties "outside" the SU.

You should take a look on this wiki page:
http://servicemix.apache.org/4-beginner-outsource-su-configuration-in-a-properties-file.html

Regards
JB

youhaodeyi wrote:
> I defined a service url in xbean.xml which will be packaged into a SU. If the
> url is changed, I have to re-package the SU. How can I set the url in
> another place like a property file?
>
> thanks.

Re: How can I define a service url in a property file?

by Jean-Baptiste Onofre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

it's a Spring resource location.
You have deeper explanation here:
http://static.springsource.org/spring/docs/2.5.x/reference/resources.html

Anyway, the classpath:/myService.properties means in the classloader, so
it will look for the file in the SMX container, after in the component
classloader and finally in your SU classloader. So you can put the file
where you want add add the directory in the main SMX classpath.

Regards
JB

youhaodeyi wrote:

> Hi,
>
> In this tutorial, it defines the property file by
> <bean
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>       <property name="locations">
>          <value>classpath:/myService.properties</value>
>       </property>
>    </bean>
>
> I wander what the classpath:/myService.properties mean. Does the classpath
> mean the CLASSPATH environment variable?
>
>
> Jean-Baptiste Onofré wrote:
>> Hi,
>>
>> the best way is to use a properties file to be able to change some xbean
>> properties "outside" the SU.
>>
>> You should take a look on this wiki page:
>> http://servicemix.apache.org/4-beginner-outsource-su-configuration-in-a-properties-file.html
>>
>> Regards
>> JB
>>
>> youhaodeyi wrote:
>>> I defined a service url in xbean.xml which will be packaged into a SU. If
>>> the
>>> url is changed, I have to re-package the SU. How can I set the url in
>>> another place like a property file?
>>>
>>> thanks.
>>
>