<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog de sergio &#187; Spring</title>
	<atom:link href="http://www.serunix.com/category/spring/feed" rel="self" type="application/rss+xml" />
	<link>http://www.serunix.com</link>
	<description>"...si lo puedes soñar, lo puedes hacer"</description>
	<lastBuildDate>Sun, 24 Jan 2010 15:29:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Una forma de recargar/reload/refreshing un archivo properties con Spring</title>
		<link>http://www.serunix.com/2009/11/08/una-forma-de-recargarreloadrefreshing-un-archivo-properties-con-spring</link>
		<comments>http://www.serunix.com/2009/11/08/una-forma-de-recargarreloadrefreshing-un-archivo-properties-con-spring#comments</comments>
		<pubDate>Mon, 09 Nov 2009 02:54:36 +0000</pubDate>
		<dc:creator>sergio</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[Spring]]></category>

		<guid isPermaLink="false">http://www.serunix.com/?p=528</guid>
		<description><![CDATA[Hay muchisisisisimas formas de hacer esto, y una de ellas es hacerlo con spring y sólo hay que definir los siguientes beans en el spring-context de la aplicación y este se encargara de hacer el reload en el tiempo que se le defina. Aquí les dejo su API.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
&#60;bean id=&#34;baseMessageSource&#34;
       [...]]]></description>
			<content:encoded><![CDATA[<p>Hay muchisisisisimas formas de hacer esto, y una de ellas es hacerlo con <em>spring</em> y sólo hay que definir los siguientes <em>beans</em> en el <em>spring-context</em> de la aplicación y este se encargara de hacer el <em>reload</em> en el tiempo que se le defina. Aquí les dejo su <a href="http://static.springsource.org/spring/docs/2.0.8/api/org/springframework/context/support/ResourceBundleMessageSource.html">API</a>.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;baseMessageSource&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.springframework.context.support.ResourceBundleMessageSource&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;basename&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>classpath:Application<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #808080; font-style: italic;">&lt;!-- messageSource,  spring lo tiene definido para los archivos properties, así que no hay que cambiarlo --&gt;</span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;messageSource&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.springframework.context.support.ReloadableResourceBundleMessageSource&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;basenames&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>classpath:Application<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;parentMessageSource&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ref</span> <span style="color: #000066;">bean</span>=<span style="color: #ff0000;">&quot;baseMessageSource&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;cacheSeconds&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
       <span style="color: #808080; font-style: italic;">&lt;!-- En este caso cada 60 segundos --&gt;</span>
                  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>60<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.serunix.com/2009/11/08/una-forma-de-recargarreloadrefreshing-un-archivo-properties-con-spring/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
