
<?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>pgt &#187; java</title>
	<atom:link href="http://pgt.de/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://pgt.de</link>
	<description>t3chnology scouting GmbH</description>
	<lastBuildDate>Wed, 09 May 2012 11:54:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Java 5 &#8211; end of service</title>
		<link>http://pgt.de/2009/11/05/java-5-end-of-service/</link>
		<comments>http://pgt.de/2009/11/05/java-5-end-of-service/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 12:38:15 +0000</pubDate>
		<dc:creator>P.G.Taboada</dc:creator>
				<category><![CDATA[Java & Co.]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://pgt.de/?p=698</guid>
		<description><![CDATA[<p>Schon gelesen?</p> <p>End of Service Life für Java 5</p> <p>Die 2004 mit großen Sprachänderungen eingeführte fünfte Java-Version hat letztes Wochenende das sogenannte &#8220;End of Service Life&#8221; (EOSL) erreicht. Sun empfiehlt, um auch zukünftig kritische Fehlerbehebungen zu erhalten, die Anwendungen entweder auf das neueste Update der Java Standard Edition (Java SE) zu migrieren oder den [...]]]></description>
			<content:encoded><![CDATA[<p>Schon <a href="http://www.heise.de/developer/meldung/End-of-Service-Life-fuer-Java-5-847507.html" target="_blank">gelesen</a>?</p>
<blockquote><p>End of Service Life für Java 5</p>
<p>Die 2004 mit großen Sprachänderungen eingeführte fünfte Java-Version hat letztes Wochenende das sogenannte &#8220;End of Service Life&#8221; (EOSL) erreicht. Sun empfiehlt, um auch zukünftig kritische Fehlerbehebungen zu erhalten, die Anwendungen entweder auf das neueste Update der Java Standard Edition (Java SE) zu migrieren oder den &#8220;Java SE Support for Business&#8221; in Anspruch zu nehmen, der bis zu 15 Jahre Gewährleistung für ältere Java-Versionen</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://pgt.de/2009/11/05/java-5-end-of-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>W-JAX 2009 Vorträge</title>
		<link>http://pgt.de/2009/09/22/w-jax09-events/</link>
		<comments>http://pgt.de/2009/09/22/w-jax09-events/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 09:54:21 +0000</pubDate>
		<dc:creator>P.G.Taboada</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[GWT]]></category>
		<category><![CDATA[Java & Co.]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[cep]]></category>
		<category><![CDATA[esper]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[osgi]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://pgt.de/?p=613</guid>
		<description><![CDATA[<p> W-JAX 2009</p> <p>Die Konferenz für Java, Enterprise Architekturen &#38; SOA</p> <p>Die W-JAX ist die Konferenz für ganzheitliches technisches Know-how im Enterprise- und Webumfeld. Hier kommen die besten Experten Europas zusammen, um ihr Wissen und ihre Erfahrung an die Teilnehmer weiterzugeben. Durch ihren einzigartigen Mix an Themen verleiht die W-JAX alljährlich der Java Enterprise [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-662" style="margin: 10px;" title="wjax09_button_speaker_de" src="http://pgt.de/wp-content/uploads/2009/09/wjax09_button_speaker_de.jpg" alt="wjax09_button_speaker_de" width="128" height="128" /><br />
<strong><em>W-JAX 2009</em></strong></p>
<p><em>Die Konferenz für Java, Enterprise Architekturen &amp; SOA</em></p>
<blockquote><p>Die W-JAX ist die Konferenz für ganzheitliches technisches Know-how im Enterprise- und Webumfeld. Hier kommen die besten Experten Europas zusammen, um ihr Wissen und ihre Erfahrung an die Teilnehmer weiterzugeben. Durch ihren einzigartigen Mix an Themen verleiht die W-JAX alljährlich der Java Enterprise Community die entscheidenden Impulse.</p></blockquote>
<p><strong>Google Web Toolkit &#8211; Making a Better Web 2.0</strong><br />
Speaker: Papick G. Taboada</p>
<blockquote><p>Mit Adwords und Google Wave sind die ersten großen GWT basierten Anwendungen von Google erschienen. Mit einem optimierenden Kompiler und pfiffige Codegeneratoren werden mit GWT maßgeschneiderte JavaScript Anwendungen erstellt, die Entwicklung findet allerdings in Java statt. In dem Vortrag werden Konzepte, Neuigkeiten aus 2.0 und die aus Adwords gewonnenen Architektur &#8220;Best Practices&#8221; vorgestellt.</p></blockquote>
<p><strong>SpringSource dm Server: Fitness für die Webanwendungen</strong><br />
Speaker: Agim Emruli, Papick G. Taboada</p>
<blockquote><p>Java-EE-Webanwendungen tragen Deployment-bedingt eine große Menge an Bibliotheken mit sich. Mit OSGi werden dank einem standardisierten Modularisierungskonzept neue Wege gegangen. Lernen Sie in der Session die Möglichkeiten der Modularisierung in Java-EE-Webanwendungen auf dem OSS SpringSource dm Server kennen, damit schwergewichtige und monolithische Deployments der Vergangenheit angehören.</p></blockquote>
<p><strong>EDA in der Businessintegration</strong><br />
Speaker: Christian Dedek, Papick G. Taboada</p>
<blockquote><p>Integrationsszenarien mit ereignisgesteuerten Architekturansätzen in Java umsetzen? Dieser Vortrag bietet Ihnen eine Einführung in EDA und Complex Event Processing (CEP) und stellt den Zusammenhang zwischen EDA und SOA her. Darüber hinaus veranschaulicht er die Architektur und den Aufbau von Esper und zeigt CEP-Einsatzszenarien.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://pgt.de/2009/09/22/w-jax09-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use the SimpleHttpInvokerServiceExporter</title>
		<link>http://pgt.de/2009/02/26/how-to-use-the-simplehttpinvokerserviceexporter/</link>
		<comments>http://pgt.de/2009/02/26/how-to-use-the-simplehttpinvokerserviceexporter/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 12:15:04 +0000</pubDate>
		<dc:creator>P.G.Taboada</dc:creator>
				<category><![CDATA[Java & Co.]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://pgt.de/?p=275</guid>
		<description><![CDATA[How to use the SimpleHttpInvokerServiceExporter (JRE 1.6 HttpServer and spring remoting) [...]]]></description>
			<content:encoded><![CDATA[<p>The JRE 1.6 ships with small HTTP-Server implementation. <a title="HTTP Server Javadocs" href="http://java.sun.com/javase/6/docs/jre/api/net/httpserver/spec/overview-summary.html" target="_blank">The Javadocs can be found here</a>.</p>
<p>Spring has provides many different ways of configuring remote access to beans (aka spring remoting), but the <a href="http://static.springframework.org/spring/docs/2.5.x/reference/remoting.html" target="_blank">remoting documentation</a> fails when it comes to the usage of the HTTP Service exporter that works with the new JRE 1.6 HttpServer.</p>
<p>So here is a small example on how wire up the embedded JDK <a title="JDK 1.6 HttpServer Javadoc" href="http://java.sun.com/javase/6/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/HttpServer.html" target="_blank">HttpServer</a> and spring remoting.</p>
<p><span id="more-275"></span></p>
<p>First we need some service that we would like to expose as a remote service. For this short example I am using an very simple &#8220;EchoService&#8221; as follows:</p>
<p>The interface:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">x.y</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> EchoService <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">abstract</span> <span style="color: #003399;">String</span> echo<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> message<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>and some implementation:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">x.y</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.slf4j.Logger</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.slf4j.LoggerFactory</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.stereotype.Service</span><span style="color: #339933;">;</span>
&nbsp;
@Service<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;echoServiceLocalImpl&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> EchoServiceImpl <span style="color: #000000; font-weight: bold;">implements</span> EchoService <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> Logger log <span style="color: #339933;">=</span> LoggerFactory
			.<span style="color: #006633;">getLogger</span><span style="color: #009900;">&#40;</span>EchoServiceImpl.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> echo<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> message<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Echoing: &quot;</span> <span style="color: #339933;">+</span> message<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">return</span> message.<span style="color: #006633;">toUpperCase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>As you can see in the implementation, I am using annotation based configuration in this example.</p>
<p>That is pretty much all implementation I need to provide the services. Now I have to setup the HttpServer and configure the service exporting. The HttpServer implementation provided by the JRE uses factory methods for the setup. It is a pain to configure beans using factory-methods in the spring xml, and that&#8217;s why we usually create a <a title="FactoryBean interface javadoc" href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/beans/factory/FactoryBean.html" target="_blank">FactoryBean</a> to wrap up the ugly initialization of a bean. Fortunately we do not have to do this ourselves, the Springframework already provides (since version 2.5.1) <a href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/remoting/support/SimpleHttpServerFactoryBean.html" target="_blank">such a factory bean</a>.</p>
<p>So here is the context xml configuration file I am using to start the server and to export the services:</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
21
22
23
24
25
26
27
28
29
30
31
32
33
34
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;">&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;beans</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/beans&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000066;">xsi:schemaLocation</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd</span>
<span style="color: #009900;">		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd</span>
<span style="color: #009900;">		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000066;">xmlns:context</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/context&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000066;">xmlns:util</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/util&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;context:annotation-config</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;context:component-scan</span> <span style="color: #000066;">base-package</span>=<span style="color: #ff0000;">&quot;x.y&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	<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;httpServer&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.springframework.remoting.support.SimpleHttpServerFactoryBean&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;contexts&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;util:map<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;entry</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;/echoService&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.springframework.remoting.httpinvoker.SimpleHttpInvokerServiceExporter&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;serviceInterface&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;x.y.EchoService&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;service&quot;</span> <span style="color: #000066;">ref</span>=<span style="color: #ff0000;">&quot;echoServiceLocalImpl&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</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: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/util:map<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;port&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;2345&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</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>
&nbsp;
	<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;remotedEchoService&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>  
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;qualifier</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;remoted&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;serviceUrl&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;http://localhost:2345/echoService&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;serviceInterface&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;x.y.EchoService&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</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: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/beans<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>As you can see I also added the xml snippet required for the clients that will be using the remoted service. The qualifier will help me to get the remoted instance and not the local one, hence both instances are kept in my application context in this sample. A simple testcase would look this way:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">x.y</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">static</span> org.<span style="color: #006633;">junit</span>.<span style="color: #000000; font-weight: bold;">Assert</span>.<span style="color: #006633;">assertEquals</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">static</span> org.<span style="color: #006633;">junit</span>.<span style="color: #000000; font-weight: bold;">Assert</span>.<span style="color: #006633;">assertTrue</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.junit.Test</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.junit.runner.RunWith</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.beans.factory.annotation.Autowired</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.beans.factory.annotation.Qualifier</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.test.context.ContextConfiguration</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.springframework.test.context.junit4.SpringJUnit4ClassRunner</span><span style="color: #339933;">;</span>
&nbsp;
@RunWith<span style="color: #009900;">&#40;</span>SpringJUnit4ClassRunner.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span>
@ContextConfiguration<span style="color: #009900;">&#40;</span>inheritLocations <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">true</span>, locations <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;classpath:/META-INF/beans.xml&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TestRemoting <span style="color: #000000; font-weight: bold;">extends</span> AbstractJUnit4SpringContextTests <span style="color: #009900;">&#123;</span>
&nbsp;
	@Autowired<span style="color: #009900;">&#40;</span>required <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>
	@Qualifier<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;remoted&quot;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">private</span> EchoService echoService<span style="color: #339933;">;</span>
&nbsp;
	@Test
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> echoTestUsingConfiguredClient<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003399;">String</span> echo <span style="color: #339933;">=</span> echoService.<span style="color: #006633;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		assertEquals<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Echoed correctly&quot;</span>, <span style="color: #0000ff;">&quot;TEST&quot;</span>, echo<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		assertTrue<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Should not be the implementation&quot;</span>, <span style="color: #339933;">!</span>echoService.<span style="color: #006633;">getClass</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
				.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>EchoServiceImpl.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@Test
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> echoTestManually<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span> <span style="color: #009900;">&#123;</span>
		HttpInvokerProxyFactoryBean proxy <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HttpInvokerProxyFactoryBean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		proxy.<span style="color: #006633;">setServiceInterface</span><span style="color: #009900;">&#40;</span>EchoService.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		proxy.<span style="color: #006633;">setServiceUrl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://localhost:2345/echoService&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		proxy.<span style="color: #006633;">afterPropertiesSet</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		EchoService echoService <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>EchoService<span style="color: #009900;">&#41;</span> proxy.<span style="color: #006633;">getObject</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399;">String</span> echo <span style="color: #339933;">=</span> echoService.<span style="color: #006633;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;test&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		assertEquals<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Echoed correctly&quot;</span>, <span style="color: #0000ff;">&quot;TEST&quot;</span>, echo<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		assertTrue<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Should not be the implementation&quot;</span>, <span style="color: #339933;">!</span>echoService.<span style="color: #006633;">getClass</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
				.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>EchoServiceImpl.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The first test method <strong>echoTestUsingConfiguredClient</strong> does use the bean in the spring context (autowired, using the qualifier to get the right instance), the second method <strong>echoTestManually</strong> creates a proxy bean manually.</p>
<p>Both of them use the remoted proxy and not the local service implementation during the test.</p>
<p>I used maven to setup the eclipse project and to manage my project dependencies.<br />
The project can be downloaded <a href="http://pgt.de/wp-content/uploads/2009/02/simpleexporter.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://pgt.de/2009/02/26/how-to-use-the-simplehttpinvokerserviceexporter/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Analysing trends</title>
		<link>http://pgt.de/2008/04/22/analysing-trends/</link>
		<comments>http://pgt.de/2008/04/22/analysing-trends/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 10:22:31 +0000</pubDate>
		<dc:creator>P.G.Taboada</dc:creator>
				<category><![CDATA[conferences]]></category>
		<category><![CDATA[From nerds to nerds]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[oss]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://pgt.de/?p=193</guid>
		<description><![CDATA[<p>After Rod Johnson demonstrated “Job Trends” with indeed.com, here some nice tools…</p> <p>GWT and JSF….</p> <p>http://www.indeed.com/jobtrends?q=gwt%2C+jsf&#38;l=</p> <p>http://www.google.com/trends?q=GWT%2C+JSF&#38;ctab=0&#38;geo=all&#38;date=all&#38;sort=0</p> <p>http://markmail.org/</p> <p>Unfortunately markmail does not support comparison, you will have to do it by hand.</p> ]]></description>
			<content:encoded><![CDATA[<p>After Rod Johnson demonstrated “Job Trends” with indeed.com, here some nice tools…</p>
<p>GWT and JSF….</p>
<blockquote><p><a href="http://www.indeed.com/jobtrends?q=gwt%2C+jsf&amp;l=" target="_blank">http://www.indeed.com/jobtrends?q=gwt%2C+jsf&amp;l=</a></p>
<p><a href="http://www.google.com/trends?q=GWT%2C+JSF&amp;ctab=0&amp;geo=all&amp;date=all&amp;sort=0" target="_blank">http://www.google.com/trends?q=GWT%2C+JSF&amp;ctab=0&amp;geo=all&amp;date=all&amp;sort=0</a></p>
<p><a href="http://markmail.org/" target="_blank">http://markmail.org/</a></p>
<p>Unfortunately markmail does not support comparison, you will have to do it by hand.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://pgt.de/2008/04/22/analysing-trends/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Artikel zu Java und Concurrency</title>
		<link>http://pgt.de/2008/02/20/artikel-zu-java-und-concurrency/</link>
		<comments>http://pgt.de/2008/02/20/artikel-zu-java-und-concurrency/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 09:49:13 +0000</pubDate>
		<dc:creator>P.G.Taboada</dc:creator>
				<category><![CDATA[GWT]]></category>
		<category><![CDATA[Java & Co.]]></category>
		<category><![CDATA[articles]]></category>
		<category><![CDATA[concurrency]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://pgt.de/?p=164</guid>
		<description><![CDATA[ <p>Steffen Schluff hat einen Artikel zum Thema Java und Concurrency geschrieben:</p> <p>Der seit den 70er Jahren vorhandene Trend, dass jede neue Prozessor Generation eine deutliche Steigerung der Taktfrequenz mit sich bringt, beginnt langsam aber sicher abzuebben. Die Hardware Hersteller versuchen nun, ihr Glück in der Erhöhung der verfügbaren Anzahl Prozessoren je Chip zu [...]]]></description>
			<content:encoded><![CDATA[<div class="entry-content">
<p>Steffen Schluff hat einen Artikel zum Thema Java und Concurrency geschrieben:</p>
<blockquote><p>Der seit den 70er Jahren vorhandene Trend, dass jede neue Prozessor Generation eine deutliche Steigerung der Taktfrequenz mit sich bringt, beginnt langsam aber sicher abzuebben. Die Hardware Hersteller versuchen nun, ihr Glück in der Erhöhung der verfügbaren Anzahl Prozessoren je Chip zu finden. Dementsprechend wird sich auch die Softwareentwicklung über kurz oder lang an diese neuen Rahmenbedingungen anpassen müssen.</p>
<p>Die Programmiersprache Java hat mit Java 5 in Form der sogenannten Concurrency Utilities eine mächtige neue API dazugewonnen, die es Programmierern erlaubt, mit ganz neuen Voraussetzungen an die Entwicklung von Multithreaded Anwendungen heranzugehen. Der vorliegende Artikel zeigt auf, warum das Themenfeld in Zukunft an Bedeutung gewinnen wird und stellt die wichtigsten Inhalte dieser API vor.</p></blockquote>
<p>Mehr gibt es <a href="http://www.oio.de/public/java/concurrency/concurrency-utils.htm" target="_blank">hier zu lesen</a>…</div>
]]></content:encoded>
			<wfw:commentRss>http://pgt.de/2008/02/20/artikel-zu-java-und-concurrency/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

