<?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>teamzone.ch &#187; Java</title>
	<atom:link href="http://teamzone.ch/category/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://teamzone.ch</link>
	<description>Welcome to the Joint-Venture Blog from Fabio Cortesi and Stefan Jäger.</description>
	<lastBuildDate>Sat, 05 Jun 2010 13:23:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>German Article: Java EE Scheduler mit skalierender Verarbeitung</title>
		<link>http://teamzone.ch/2009/09/02/german-article-java-ee-scheduler-mit-skalierender-verarbeitung/</link>
		<comments>http://teamzone.ch/2009/09/02/german-article-java-ee-scheduler-mit-skalierender-verarbeitung/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 07:02:07 +0000</pubDate>
		<dc:creator>Stefan Jäger</dc:creator>
				<category><![CDATA[EJB]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://teamzone.ch/?p=486</guid>
		<description><![CDATA[With two co-workers from Zühlke, I wrote an article about an scalable Java EE scheduler. This article got published in the JavaSpektrum magazin 04/2009.
&#160;
It&#8217;s written in German and can be downloaded here.
]]></description>
			<content:encoded><![CDATA[<p>With two co-workers from Zühlke, I wrote an article about an scalable Java EE scheduler. This article got published in the <a href="http://www.sigs-datacom.de/fachzeitschriften/javaspektrum.html">JavaSpektrum magazin</a> 04/2009.<br />
&nbsp;<br />
It&#8217;s written in German and can be downloaded <a href="http://teamzone.ch/wp-content/uploads/2009/09/jaeger_kronenberg_JS_04_09.pdf">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://teamzone.ch/2009/09/02/german-article-java-ee-scheduler-mit-skalierender-verarbeitung/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Eclipse 3.5 &#8211; Galileo</title>
		<link>http://teamzone.ch/2009/07/08/eclipse-3-5-galileo/</link>
		<comments>http://teamzone.ch/2009/07/08/eclipse-3-5-galileo/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 06:26:28 +0000</pubDate>
		<dc:creator>Stefan Jäger</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://teamzone.ch/?p=422</guid>
		<description><![CDATA[On the Eclipse homepage you will find a very nice description about all new features in Galileo.
In a view of a Java developer, there are not a lot of new features. German readers will find at jaxenter a nice article with all new Java features.
The only one, which seems noteworthy, is the new toString() wizard:

]]></description>
			<content:encoded><![CDATA[<p>On the <a href="http://archive.eclipse.org/eclipse/downloads/drops/S-3.5M7-200904302300/eclipse-news-M7.html">Eclipse homepage</a> you will find a very nice description about all new features in Galileo.</p>
<p>In a view of a Java developer, there are not a lot of new features. German readers will find at <a href="http://it-republik.de/jaxenter/artikel/Entdeckertour-Was-gibt%92s-Neues-in-Eclipse-JDT-2407.html">jaxenter</a> a nice article with all new Java features.</p>
<p>The only one, which seems noteworthy, is the new toString() wizard:</p>
<p><a href="http://teamzone.ch/wp-content/uploads/2009/07/eclipse_galileo_tostring_generator.png"  rel="lightbox[roadtrip]"><img class="size-full wp-image-423 alignnone" title="eclipse_galileo_tostring_generator" src="http://teamzone.ch/wp-content/uploads/2009/07/eclipse_galileo_tostring_generator.png" alt="eclipse_galileo_tostring_generator" width="428" height="621" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://teamzone.ch/2009/07/08/eclipse-3-5-galileo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Luke &#8211; The Lucene Index Toolbox</title>
		<link>http://teamzone.ch/2009/06/13/luke-the-lucene-index-toolbox/</link>
		<comments>http://teamzone.ch/2009/06/13/luke-the-lucene-index-toolbox/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 09:13:32 +0000</pubDate>
		<dc:creator>Stefan Jäger</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Lucene]]></category>

		<guid isPermaLink="false">http://teamzone.ch/2009/06/13/luke-the-lucene-index-toolbox/</guid>
		<description><![CDATA[Lucene offers great full text search capabilities. It is based on an index, which is maintained by Lucene. With Luke, the Lucene Index Toolbox (http://www.getopt.org/luke/) you can analyze your index and let explain queries.
After startup, you have to select your index. For this example, I created a test index with one file. It’s content is [...]]]></description>
			<content:encoded><![CDATA[<p>Lucene offers great full text search capabilities. It is based on an index, which is maintained by Lucene. With Luke, the Lucene Index Toolbox (<a title="http://www.getopt.org/luke/" href="http://www.getopt.org/luke/">http://www.getopt.org/luke/</a>) you can analyze your index and let explain queries.</p>
<p>After startup, you have to select your index. For this example, I created a test index with one file. It’s content is “this is a lucene test”. I used the StandardAnalyzer, which uses the WhitespaceTokenizer and filters out all tokens less than 3 characters and stop words. This will result in an index of the terms “lucene” and “test”.</p>
<p><a href="http://teamzone.ch/wp-content/uploads/2009/06/image.png"  rel="lightbox" rel="lightbox[roadtrip]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://teamzone.ch/wp-content/uploads/2009/06/image-thumb.png" width="500" height="392" /></a>&#160;</p>
<p> <span id="more-400"></span>
<p>&#160;</p>
<p>In the register Documents, you can browse through all documents. Because we only have one file in our test index, we can directly jump to document 0. In the “Brows by term:” panel, we can browse through all terms, which are “lucene” and “test”. Very useful, to analyze the index for a specific document.</p>
<p><a href="http://teamzone.ch/wp-content/uploads/2009/06/image1.png"  rel="lightbox" rel="lightbox[roadtrip]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://teamzone.ch/wp-content/uploads/2009/06/image-thumb1.png" width="500" height="392" /></a> </p>
<p>&#160;</p>
<p>Also very interesting is the register Search. I typed in the phrase “this is a lucene test”. In the “Query Details” panel, we can see, that the query will be “lucene test”. The reason is simple. Every query get’s also analyzed by the same analyzer, which is used for building the index.</p>
<p><a href="http://teamzone.ch/wp-content/uploads/2009/06/image2.png"  rel="lightbox" rel="lightbox[roadtrip]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://teamzone.ch/wp-content/uploads/2009/06/image-thumb2.png" width="500" height="392" /></a> </p>
<p>&#160;</p>
<p>If you are using Lucene, just try Luke out. You can start it with Java Web Start from <a href="http://www.getopt.org/luke/luke.jnlp">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://teamzone.ch/2009/06/13/luke-the-lucene-index-toolbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perform XPath queries inside Ant</title>
		<link>http://teamzone.ch/2009/05/17/perform-xpath-queries-inside-ant/</link>
		<comments>http://teamzone.ch/2009/05/17/perform-xpath-queries-inside-ant/#comments</comments>
		<pubDate>Sun, 17 May 2009 18:19:00 +0000</pubDate>
		<dc:creator>Stefan Jäger</dc:creator>
				<category><![CDATA[ANT]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://teamzone.ch/2009/05/13/perform-xpath-queries-inside-ant/</guid>
		<description><![CDATA[Ant offers some XML features like the xslt task, which transforms XML files into other files. But unfortunately, with Ant you can&#8217;t make simple XPath Queries on a specific XML file. 
&#160;
Luckily, there is a nice open source solution called XmlTask, which offers many possibilities to work with XML files.
&#160;

Download the latest version of XmlTask [...]]]></description>
			<content:encoded><![CDATA[<p>Ant offers some XML features like the xslt task, which transforms XML files into other files. But unfortunately, with Ant you can&#8217;t make simple XPath Queries on a specific XML file. </p>
<p>&#160;</p>
<p>Luckily, there is a nice open source solution called XmlTask, which offers many possibilities to work with XML files.</p>
<p>&#160;</p>
<ol>
<li>Download the latest version of XmlTask from <a href="http://xmltask.sf.net">http://xmltask.sf.net</a></li>
<li>Create a task definition in Ant     

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> </span>
<span style="color: #009900;">  <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;xmltask&quot;</span> </span>
<span style="color: #009900;">  <span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;com.oopsconsultancy.xmltask.ant.XmlTask&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">classpath</span>=<span style="color: #ff0000;">&quot;./xmltask-v1.15.1.jar&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></td></tr></table></div>

</li>
<li>Use it with the &lt;xmltask&gt; definition<br />
    <br />For example, read out the number of a specific node in the XML file:</p>
<p></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xmltask</span> <span style="color: #000066;">source</span>=<span style="color: #ff0000;">&quot;someFile.xml&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;copy</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;count(//aNode)&quot;</span> <span style="color: #000066;">property</span>=<span style="color: #ff0000;">&quot;numberOfNodes&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xmltask<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Or change an attribute:</p>
<p></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;xmltask</span> <span style="color: #000066;">source</span>=<span style="color: #ff0000;">&quot;someFile.xml&quot;</span> <span style="color: #000066;">dest</span>=<span style="color: #ff0000;">&quot;toAnotherFile.xml&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;attr</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;//aNode[1]&quot;</span> <span style="color: #000066;">attr</span>=<span style="color: #ff0000;">&quot;enabled&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/xmltask<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

</li>
</ol>
<p>&#160;</p>
<p>There are many other possibilites to work with XML files inside Ant. Check out the documentation at <a href="http://xmltask.sf.net">http://xmltask.sf.net</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://teamzone.ch/2009/05/17/perform-xpath-queries-inside-ant/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GC Viewer</title>
		<link>http://teamzone.ch/2009/05/15/gc-viewer/</link>
		<comments>http://teamzone.ch/2009/05/15/gc-viewer/#comments</comments>
		<pubDate>Fri, 15 May 2009 16:46:45 +0000</pubDate>
		<dc:creator>Stefan Jäger</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[GC]]></category>

		<guid isPermaLink="false">http://teamzone.ch/2009/05/15/gc-viewer/</guid>
		<description><![CDATA[Wrong use of the memory options can cause serious performance problems. To optimize the right memory size of the JVM or to find some critical memory issues, the GC log of the JVM can be very useful. Simply start the Java application with the option -Xloggc:&#60;file&#62;. Every GC action gets logged into this file. 
&#160;
To [...]]]></description>
			<content:encoded><![CDATA[<p>Wrong use of the memory options can cause serious performance problems. To optimize the right memory size of the JVM or to find some critical memory issues, the GC log of the JVM can be very useful. Simply start the Java application with the option <strong>-Xloggc:&lt;file&gt;</strong>. Every GC action gets logged into this file. </p>
<p>&#160;</p>
<p>To analyse this log file, there is a nice tool called GCViewer, which can be downloaded from <a href="http://www.tagtraum.com/gcviewer-download.html">http://www.tagtraum.com/gcviewer-download.html</a>. GCViewer is able to display the memory usage of the application based on time and old/young generation heap space.</p>
<p><a href="http://teamzone.ch/wp-content/uploads/2009/05/clip-image002.jpg"  rel="lightbox" rel="lightbox[roadtrip]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://teamzone.ch/wp-content/uploads/2009/05/clip-image002-thumb.jpg" width="434" height="296" /></a></p>
<p> <span id="more-376"></span>
<p>First of all, the GCViewer displays the GC log from the time on where the JVM has started. This is mostly not very useful. Just right click on the top of the diagram and enable the start time of the log. </p>
<p><a href="http://teamzone.ch/wp-content/uploads/2009/05/clip-image004.jpg"  rel="lightbox" rel="lightbox[roadtrip]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://teamzone.ch/wp-content/uploads/2009/05/clip-image004-thumb.jpg" width="437" height="298" /></a></p>
<p>What kind of GC exists and how to optimize them, can be read from <a href="http://www.javaperformancetuning.com/tools/gcviewer/index.shtml">http://www.javaperformancetuning.com/tools/gcviewer/index.shtml</a>. In this post, I will just tell you something about the GCViewer itself.</p>
<p>&#160;</p>
<p>GCViewer creates two parts in the diagram. These parts are just logical and shows, how big the young and old generation heap space of your JVM are. </p>
<ul>
<li>The orange part is the young generation heap size. </li>
<li>The purple part is the old generation heap size. </li>
</ul>
<p><a href="http://teamzone.ch/wp-content/uploads/2009/05/clip-image006.jpg"  rel="lightbox" rel="lightbox[roadtrip]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image006" border="0" alt="clip_image006" src="http://teamzone.ch/wp-content/uploads/2009/05/clip-image006-thumb.jpg" width="457" height="312" /></a></p>
<p>Every time the old generation heap size reaches it&#8217;s maximum, a full GC gets performed. A full GC is a vertical, black line in the diagram. (Remember: a full GC stops for a short time all activities of the JVM and cleans the old generation heap space. It&#8217;s very important to know that the bigger the heap size the longer the duration of a full GC!)    <br />The duration of the GC is displayed as the green line at the bottom. You can see in the picture above, that the full GC consumes much more time than the young generation GCs.     </p>
<p>I can recommend to log in critical environments your GC activities. If you run into som performance issues or response problems you can easily search for the reasons. It is a completion to the usual log file.</p>
]]></content:encoded>
			<wfw:commentRss>http://teamzone.ch/2009/05/15/gc-viewer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use Groovy inside Ant</title>
		<link>http://teamzone.ch/2009/05/13/use-groovy-inside-ant/</link>
		<comments>http://teamzone.ch/2009/05/13/use-groovy-inside-ant/#comments</comments>
		<pubDate>Wed, 13 May 2009 17:59:27 +0000</pubDate>
		<dc:creator>Stefan Jäger</dc:creator>
				<category><![CDATA[ANT]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://teamzone.ch/2009/05/13/use-groovy-inside-ant/</guid>
		<description><![CDATA[There are some kind of tasks, which Ant won&#8217;t do. One of them is the loop. There is no simple way to implement a dynamic for or while loop in Ant. What do i mean with dynamic? Let me make an example. Ant reads out a number of iterations from a property file (we call [...]]]></description>
			<content:encoded><![CDATA[<p>There are some kind of tasks, which Ant won&#8217;t do. One of them is the loop. There is no simple way to implement a dynamic for or while loop in Ant. What do i mean with dynamic? Let me make an example. Ant reads out a number of iterations from a property file (we call it the number x) and should perform a loop x-times to call another Ant task. And this can only hardly be done with Ant.</p>
<p>&#160;</p>
<p>&#160;</p>
<p><a href="http://teamzone.ch/wp-content/uploads/2009/05/image.png"  rel="lightbox" rel="lightbox[roadtrip]"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="left" src="http://teamzone.ch/wp-content/uploads/2009/05/image-thumb.png" width="203" height="100" /></a> But fortunately, there is Groovy. Groovy is a scripting language, which runs in a Java Virtual Machine. And because of that, it can be easily integrated with Ant.</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p>&#160;</p>
<p> <span id="more-360"></span>
<ol>
<li>Download the latest release of Groovy at <a href="http://groovy.codehaus.org/Download">http://groovy.codehaus.org/Download</a> </li>
<li>Inside the Groovy binary, there is a folder called embeddable. In this folder, there is a file called groovy-all-X.X.X.jar. Take it and copy it near your build file. </li>
<li>Create a task definition in Ant      

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> </span>
<span style="color: #009900;"><span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;groovy&quot;</span> </span>
<span style="color: #009900;"><span style="color: #000066;">classpath</span>=<span style="color: #ff0000;">&quot;./groovy-all-X.X.X.jar&quot;</span> </span>
<span style="color: #009900;"><span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;org.codehaus.groovy.ant.Groovy&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></td></tr></table></div>

</li>
<li>Use Groovy somewhere inside an Ant task:<br />
    </p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;">  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groovy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
   int i = 1
   int numberOfIterations = properties[&quot;numberOfIterations&quot;].toInteger()
   while (i <span style="color: #ddbb00;">&amp;lt;</span>= numberOfIterations) {
    properties[&quot;currentIteration&quot;] = i
    ant.antcall(target:&quot;execute.a.task&quot;)
    i++
   }
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groovy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

</li>
</ol>
<p>Isn&#8217;t that groovy? </p>
<p>&#160;</p>
<p>Groovy integrated in Ant offers many possibilities, which can be read here <a href="http://groovy.codehaus.org/The+groovy+Ant+Task">http://groovy.codehaus.org/The+groovy+Ant+Task</a>. I used for my little script the variable <strong>ant</strong>, an instance of the current Ant project and the <strong>properties</strong> map, which holds all properties inside Ant.</p>
]]></content:encoded>
			<wfw:commentRss>http://teamzone.ch/2009/05/13/use-groovy-inside-ant/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Code City</title>
		<link>http://teamzone.ch/2009/03/11/code-city/</link>
		<comments>http://teamzone.ch/2009/03/11/code-city/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 20:56:30 +0000</pubDate>
		<dc:creator>Stefan Jäger</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Code City]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://teamzone.ch/2009/03/11/code-city/</guid>
		<description><![CDATA[Yesterday, I visited an interesting presentation from Tudor Girba. He showed us several ways for visualize code. One of the most interesting visualization was Code City.
&#160;
 
(ArgoUML from http://moose.unibe.ch/tools/codecity)
&#160;
 
I couldn’t wait to visualize our current software project. First of all, you have to create a MSE file of your code. The MSE file as [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I visited an interesting presentation from Tudor Girba. He showed us several ways for visualize code. One of the most interesting visualization was Code City.</p>
<p>&#160;</p>
<p><a href="http://teamzone.ch/wp-content/uploads/2009/03/image3.png"  rel="lightbox" rel="lightbox[roadtrip]"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://teamzone.ch/wp-content/uploads/2009/03/image-thumb3.png" width="558" height="351" /></a> </p>
<p>(ArgoUML from <a title="http://moose.unibe.ch/tools/codecity" href="http://moose.unibe.ch/tools/codecity">http://moose.unibe.ch/tools/codecity</a>)</p>
<p>&#160;</p>
<p> <span id="more-331"></span>
<p>I couldn’t wait to visualize our current software project. First of all, you have to create a MSE file of your code. The MSE file as a generic file of your source code. This is done with iPlasma, as described here <a title="http://moose.unibe.ch/news/iplasma-to-moose-screencast" href="http://moose.unibe.ch/news/iplasma-to-moose-screencast">http://moose.unibe.ch/news/iplasma-to-moose-screencast</a>.</p>
<p>&#160;</p>
<p>After you have created an MSE file, you can now visualize your code with Code City. Just download it from <a title="http://www.inf.unisi.ch/phd/wettel/codecity.html" href="http://www.inf.unisi.ch/phd/wettel/codecity.html">http://www.inf.unisi.ch/phd/wettel/codecity.html</a>, run it, import the MSE file and create your city. Enjoy!</p>
<p>&#160;</p>
<p>For better code analysis, I changed the configuration of the “buildings” in my city. I changed the width and length of class element …</p>
<p><a href="http://teamzone.ch/wp-content/uploads/2009/03/image1.png"  rel="lightbox" rel="lightbox[roadtrip]"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://teamzone.ch/wp-content/uploads/2009/03/image-thumb1.png" width="561" height="252" /></a> </p>
<p>… to a linear mapper based on the lines of code.</p>
<p><a href="http://teamzone.ch/wp-content/uploads/2009/03/image2.png"  rel="lightbox" rel="lightbox[roadtrip]"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://teamzone.ch/wp-content/uploads/2009/03/image-thumb2.png" width="244" height="204" /></a> </p>
<p>&#160;</p>
<p>Code City is very helpful to compare different parts of the application and to just visualize the software!</p>
]]></content:encoded>
			<wfw:commentRss>http://teamzone.ch/2009/03/11/code-city/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Expressions in Eclipse Debugger</title>
		<link>http://teamzone.ch/2008/12/12/expressions-in-eclipse-debugger/</link>
		<comments>http://teamzone.ch/2008/12/12/expressions-in-eclipse-debugger/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 21:28:38 +0000</pubDate>
		<dc:creator>Stefan Jäger</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.stefanjaeger.ch/2008/12/12/expressions-in-eclipse-debugger/</guid>
		<description><![CDATA[Today, I encountered a very helpful feature in Eclipse. When I am debugging code, I sometimes want to know, what’s the result of a method is. If the result it’s not assigned to a variable, it gets complicated. Take a look to this example: what is the result of add(17,19)? 

public class DemoApplication &#123;
&#160;
  [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I encountered a very helpful feature in Eclipse. When I am debugging code, I sometimes want to know, what’s the result of a method is. If the result it’s not assigned to a variable, it gets complicated. Take a look to this example: what is the result of add(17,19)? </p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> DemoApplication <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<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>
        DemoApplication calc <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DemoApplication<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span>calc.<span style="color: #006633;">divide</span><span style="color: #009900;">&#40;</span>calc.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">17</span>, <span style="color: #cc66cc;">19</span><span style="color: #009900;">&#41;</span>, <span style="color: #cc66cc;">2</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;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> add<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i, <span style="color: #000066; font-weight: bold;">int</span> j<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> i <span style="color: #339933;">+</span> j<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> divide<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i, <span style="color: #000066; font-weight: bold;">int</span> j<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> i <span style="color: #339933;">/</span> j<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>In earlier times, I stepped one step further to get into the method divide. Then I got the result of add(17,19) in my parameter. </p>
<p>&#160;</p>
<p><span id="more-263"></span></p>
<p>But Eclipse is offering a better solution. In the Debugging Perspective, there is a view called Expressions. Just add a new expression add(17,19) and the Debugger is printing out the result.</p>
<p><a href="http://teamzone.ch/wp-content/uploads/2008/12/image35.png"  rel="lightbox" rel="lightbox[roadtrip]"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="259" alt="image" src="http://teamzone.ch/wp-content/uploads/2008/12/image-thumb35.png" width="404" border="0" /></a> </p>
<p>The result is directly printed out:</p>
<p><a href="http://teamzone.ch/wp-content/uploads/2008/12/image36.png"  rel="lightbox" rel="lightbox[roadtrip]"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="214" alt="image" src="http://teamzone.ch/wp-content/uploads/2008/12/image-thumb36.png" width="489" border="0" /></a> </p>
<p>&#160;</p>
<p>A simple, but helpful feature in Eclipse!</p>
]]></content:encoded>
			<wfw:commentRss>http://teamzone.ch/2008/12/12/expressions-in-eclipse-debugger/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OSGi &#8211; a brief introduction</title>
		<link>http://teamzone.ch/2008/12/05/osgi-a-brief-introduction/</link>
		<comments>http://teamzone.ch/2008/12/05/osgi-a-brief-introduction/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 21:54:16 +0000</pubDate>
		<dc:creator>Stefan Jäger</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.stefanjaeger.ch/2008/12/05/osgi-a-brief-introduction/</guid>
		<description><![CDATA[There was a time, OSGi was for me just an “not understandable” abbreviation. Wiki told me, that OSGi is a framework for a dynamic component model. Huh? Is it just a specification or is it an implementation? Didn’t understand it all.
I started about two months with working a little bit with OSGi. I want to [...]]]></description>
			<content:encoded><![CDATA[<p>There was a time, OSGi was for me just an “not understandable” abbreviation. Wiki told me, that OSGi is a framework for a dynamic component model. Huh? Is it just a specification or is it an implementation? Didn’t understand it all.</p>
<p>I started about two months with working a little bit with OSGi. I want to write here these parts, which were unclear for me at the beginning. It should be an introduction for everyone, who has never heard about OSGi.</p>
<p>Okay, let’s start.    </p>
<p>The setup of OSGi is something like EJB. </p>
<ol>
<li>EJB has a specification from Sun. </li>
<li>OSGi has specification from the OSGi Alliance. </li>
<li>EJB need’s an application server as a platform (Weblogic, Glassfish, Websphere, JBoss, and so on) to run an “EJB” application. </li>
<li>OSGi need’s also a platform to run “OSGi” application. Like an application server, which is implementing the EJB contract, an OSGi platform implements the OSGi framework specification. Currently, there some OSGi implementation out there. The most known are Equinox, Apache Felix or Knopflerfish. </li>
</ol>
<p>Okay, now, we know, how OSGi is built. But what does it? In one sentence, it is something like a JVM with some extra features. OSGi extends the JVM and a Java program is running on that OSGi Platform instead of running directly on the JVM. OSGi offers some advantages, which I will mention shortly.</p>
<p><a href="http://teamzone.ch/wp-content/uploads/2008/12/image34.png"  rel="lightbox" rel="lightbox[roadtrip]"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="322" alt="image" src="http://teamzone.ch/wp-content/uploads/2008/12/image-thumb34.png" width="401" border="0" /></a>&#160; <br />(Source: <a title="http://de.wikipedia.org/wiki/OSGi" href="http://de.wikipedia.org/wiki/OSGi">http://de.wikipedia.org/wiki/OSGi</a>)</p>
<p>&#160;</p>
<p><span id="more-254"></span>
<p>The difference between a usual Java program (a JAR file) and an OSGi program (let us call that a bundle) are some information in the META-INF\MANIFEST.MF file. These information looks like:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">Manifest<span style="color: #339933;">-</span>Version<span style="color: #339933;">:</span> <span style="color: #cc66cc;">1.0</span>
Bundle<span style="color: #339933;">-</span>ManifestVersion<span style="color: #339933;">:</span> <span style="color: #cc66cc;">2</span>
Bundle<span style="color: #339933;">-</span><span style="color: #003399;">Name</span><span style="color: #339933;">:</span> Example OSGi bundle
Bundle<span style="color: #339933;">-</span>SymbolicName<span style="color: #339933;">:</span> ch.<span style="color: #006633;">stefanjaeger</span>.<span style="color: #006633;">osgi</span>.<span style="color: #006633;">example</span>
Bundle<span style="color: #339933;">-</span>Version<span style="color: #339933;">:</span> 1.0.0</pre></div></div>

<p>That’s it. An OSGi program (called a bundle) is nothing more than a JAR file with the MANIFEST.MF. Now, you can run this bundle in an OSGi environment like Equinox or Apache Felix.</p>
<p>Okay, know, we come to the advantages of OSGi. The biggest advantage is the ability to run a bundle in different versions at the same time. For example, bundle A has a dependency to bundle B in version 1.0.0 and bundle C has a dependency to bundle B in version 1.1.0. </p>
<p><a href="http://teamzone.ch/wp-content/uploads/2008/12/zeichnung211.png"  rel="lightbox" rel="lightbox[roadtrip]"><img title="Zeichnung2" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="107" alt="Zeichnung2" src="http://teamzone.ch/wp-content/uploads/2008/12/zeichnung2-thumb11.png" width="235" border="0" /></a></p>
<p>&#160;</p>
<p>With the usual JVM, you get a problem when running A and C in the same VM. The JVM will take the first “B” in the classpath it found. This means, it is possible, that for C gets the files from B in version 1.0.0 (instead of 1.1.0), which could result in “MethodNotFoundException” and such stuff.<br />
  <br />With OSGi, this problem doesn’t exists anymore. In the MANIFST.MF you can define all dependencies explicitly with the version. Following example means, that our bundle has a dependency to the Apache Commons Lang Package in version between 2.0.0 and 2.1.0.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">Require<span style="color: #339933;">-</span>Bundle<span style="color: #339933;">:</span> org.<span style="color: #006633;">apache</span>.<span style="color: #006633;">commons</span>.<span style="color: #006633;">lang</span><span style="color: #339933;">;</span>bundle<span style="color: #339933;">-</span>version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;[2.0.0,2.1.0]&quot;</span></pre></div></div>

<p>The OSGi platform checks at the beginning, that all required bundles are available and solves the classpath problem for us.</p>
<p>Okay, we’re almost finished. There is one important point I want to mention. Packages are not “open” as usual in JAR files. If we want to make some classes accessible for other bundles, we do have to export these packages:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">Export<span style="color: #339933;">-</span><span style="color: #000000; font-weight: bold;">Package</span><span style="color: #339933;">:</span> ch.<span style="color: #006633;">stefanjaeger</span>.<span style="color: #006633;">communiction</span>.<span style="color: #006633;">interfaces</span></pre></div></div>

<p>Of course, OSGi can do more than that. But for this introduction, I think, it’s enough<br />
  <br /> <img src='http://teamzone.ch/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://teamzone.ch/2008/12/05/osgi-a-brief-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sun Certified Business Component Developer Factsheets</title>
		<link>http://teamzone.ch/2008/11/14/sun-certified-business-component-developer/</link>
		<comments>http://teamzone.ch/2008/11/14/sun-certified-business-component-developer/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 17:24:22 +0000</pubDate>
		<dc:creator>Stefan Jäger</dc:creator>
				<category><![CDATA[EJB]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.stefanjaeger.ch/2008/11/14/sun-certified-business-component-developer/</guid>
		<description><![CDATA[Today, I passed the SCBCD exam! Here some information&#8217;s, which helped me to pass the exam:

Study Guide
http://java.boot.by/scbcd5-guide/
Free Training Test:
http://www.sun.com/training/certification/assessment/

I also wrote some “Factsheets”, which I used to sum up all topics. Besides Factsheet 0, they can also be used as an assistance on the daily EJB 3.0 work.

Factsheet 0 &#8211; some stuff, which is only [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I passed the SCBCD exam! Here some information&#8217;s, which helped me to pass the exam:</p>
<ul>
<li>Study Guide<br />
<a title="http://java.boot.by/scbcd5-guide/" href="http://java.boot.by/scbcd5-guide/">http://java.boot.by/scbcd5-guide/</a></li>
<li>Free Training Test:<br />
<a title="http://www.sun.com/training/certification/assessment/" href="http://www.sun.com/training/certification/assessment/">http://www.sun.com/training/certification/assessment/</a></li>
</ul>
<p>I also wrote some “Factsheets”, which I used to sum up all topics. Besides Factsheet 0, they can also be used as an assistance on the daily EJB 3.0 work.</p>
<ul>
<li><a title="http://teamzone.ch/wp-content/factsheet0_scbcd.pdf" href="http://teamzone.ch/wp-content/factsheet0_scbcd.pdf">Factsheet 0 &#8211; some stuff, which is only for the SCBCD relevant</a></li>
<li><a title="http://teamzone.ch/wp-content/factsheet1_statefulandstatelessbeans.pdf" href="http://teamzone.ch/wp-content/factsheet1_statefulandstatelessbeans.pdf">Factsheet 1 &#8211; Stateful and Stateless Session Beans</a></li>
<li><a title="http://teamzone.ch/wp-content/factsheet2_mdbsandjms.pdf" href="http://teamzone.ch/wp-content/factsheet2_mdbsandjms.pdf">Factsheet 2 &#8211; MDBs and JMS</a></li>
<li><a title="http://teamzone.ch/wp-content/factsheet3_transactionsandsecurity.pdf" href="http://teamzone.ch/wp-content/factsheet3_transactionsandsecurity.pdf">Factsheet 3 &#8211; Transactions and Security</a></li>
<li><a title="http://teamzone.ch/wp-content/factsheet4_jpa1.pdf" href="http://teamzone.ch/wp-content/factsheet4_jpa1.pdf">Factsheet 4 &#8211; JPA, part 1</a></li>
<li><a title="http://teamzone.ch/wp-content/factsheet5_jpa2.pdf" href="http://teamzone.ch/wp-content/factsheet5_jpa2.pdf">Factsheet 5 &#8211; JPA, part 2</a></li>
</ul>
<p>If you find any mistakes in the Factsheet, just let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://teamzone.ch/2008/11/14/sun-certified-business-component-developer/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
