<?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/tag/spring/feed" rel="self" type="application/rss+xml" />
	<link>http://www.serunix.com</link>
	<description>&#34;Un informático que sólo quiere ayudar... &#34;</description>
	<lastBuildDate>Sun, 04 Sep 2011 19:34:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<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 [...]]]></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>

<div class="thanks_button_div" style="float: left; margin-right: 10px;"><div style="float: left; display: inline;"><input type="button" onclick="thankYouButtonClick(528, 'You left &ldquo;Thanks&rdquo; already for this post')" value="Thank You: 0"
                class="thanks_button thanks_custom_button "
                style="background-image:url(http://b.static.ak.fbcdn.net/rsrc.php/yp/r/qDH1xoDhFBF.gif);width:15px; height:13px; font-family: Verdana, Arial, Sans-Serif; font-size: 14px; font-weight: normal;; color:#ffffff;"
                id="thanksButton_528_2" title="Click to left &ldquo;Thanks&rdquo; for this post"/></div><div id="ajax_loader_528_2" style="display:inline;visibility: hidden;"><img alt="ajax loader" src="http://www.serunix.com/wp-content/plugins/thanks-you-counter-button/images/ajax-loader.gif" /></div></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>

