<?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>MyFunnyDev &#187; Java</title>
	<atom:link href="http://michalkuklis.com/blog/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://michalkuklis.com/blog</link>
	<description>web, coding and beyond</description>
	<lastBuildDate>Fri, 25 Jun 2010 05:51:49 +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>Google engine support for java</title>
		<link>http://michalkuklis.com/blog/2009/04/07/google-engine-support-for-java/</link>
		<comments>http://michalkuklis.com/blog/2009/04/07/google-engine-support-for-java/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 03:26:37 +0000</pubDate>
		<dc:creator>Michał Kuklis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[google engine]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://michalkuklis.com/blog/2009/04/07/google-engine-support-for-java/</guid>
		<description><![CDATA[Looks like google engine will support java. Pretty exciting  
]]></description>
			<content:encoded><![CDATA[<p>Looks like google engine <a href="http://code.google.com/appengine/">will support java</a>. Pretty exciting <img src='http://michalkuklis.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://michalkuklis.com/blog/2009/04/07/google-engine-support-for-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SCJA and SCJP</title>
		<link>http://michalkuklis.com/blog/2008/11/06/scja-and-scjp/</link>
		<comments>http://michalkuklis.com/blog/2008/11/06/scja-and-scjp/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 18:22:31 +0000</pubDate>
		<dc:creator>Michał Kuklis</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[certification]]></category>

		<guid isPermaLink="false">http://michalkuklis.com/blog/?p=75</guid>
		<description><![CDATA[I&#8217;m planning to pass SCJA and SCJP at the end of this year. I will post  all the mocks and materials which I find helpful. Here is the first list:
SCJA
Tutorials/Books

Certified-Associate-Study-Guide
http://www.amazon.com/gp/product/1598729039/ref=cm_cr_asin_lnk
j2ee 1.4 tutorial

Mocks:

http://www.scja.de/
http://www.ejavaguru.com/scjafreemockexam.php
http://www.cafe4java.com/mockexams/scja/mock1/q1.php
http://studyguides.scja.com/ExamScam/get.jsp?link=mockexams
sun sample questions

UML

http://www.scribd.com/doc/2584053/Pengenalan-UML


SCJP
Tutorials/Books

SCJP Sun Certified Programmer
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m planning to pass SCJA and SCJP at the end of this year. I will post  all the mocks and materials which I find helpful. Here is the first list:</p>
<h3>SCJA</h3>
<p><strong>Tutorials/Books</strong></p>
<ul>
<li><a href="http://www.amazon.com/Certified-Associate-Study-Guide-CX-310-019/dp/1598729020/ref=cm_cr_pr_product_top">Certified-Associate-Study-Guide</a></li>
<li><a href="http://www.amazon.com/gp/product/1598729039/ref=cm_cr_asin_lnk">http://www.amazon.com/gp/product/1598729039/ref=cm_cr_asin_lnk</a></li>
<li><a href="http://java.sun.com/j2ee/1.4/docs/tutorial/doc/">j2ee 1.4 tutorial</a></li>
</ul>
<p><strong>Mocks:</strong></p>
<ul>
<li><a href="http://www.scja.de/">http://www.scja.de/</a></li>
<li><a href="http://www.ejavaguru.com/scjafreemockexam.php">http://www.ejavaguru.com/scjafreemockexam.php</a></li>
<li><a href="http://www.cafe4java.com/mockexams/scja/mock1/q1.php">http://www.cafe4java.com/mockexams/scja/mock1/q1.php</a></li>
<li><a href="http://studyguides.scja.com/ExamScam/get.jsp?link=mockexams">http://studyguides.scja.com/ExamScam/get.jsp?link=mockexams</a></li>
<li><a href="http://uk.sun.com/training/catalog/courses/WGS-PREX-10-QUEST.xml">sun sample questions</a></li>
</ul>
<p><strong>UML</strong></p>
<ul>
<li><a href="http://www.scribd.com/doc/2584053/Pengenalan-UML">http://www.scribd.com/doc/2584053/Pengenalan-UML</a></li>
</ul>
<p></p>
<h3>SCJP</h3>
<p><strong>Tutorials/Books</strong></p>
<ul>
<li><a href="http://www.amazon.com/SCJP-Certified-Programmer-Java-310-065/dp/0071591060">SCJP Sun Certified Programmer</a></li>
]]></content:encoded>
			<wfw:commentRss>http://michalkuklis.com/blog/2008/11/06/scja-and-scjp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Define your own Annotation Type</title>
		<link>http://michalkuklis.com/blog/2008/10/24/java-annotation-types/</link>
		<comments>http://michalkuklis.com/blog/2008/10/24/java-annotation-types/#comments</comments>
		<pubDate>Sat, 25 Oct 2008 05:13:40 +0000</pubDate>
		<dc:creator>Michał Kuklis</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://michalkuklis.com/blog/?p=51</guid>
		<description><![CDATA[I&#8217;ve been using build-in Java annotation types (like @Overrides or @Deprecated) and those created by different vendors/services for a while now but I&#8217;ve never built my own. Here is an example of how you can define very simple annotation type and use it:

&#160;
import java.lang.annotation.Retention;
&#160;
public @interface SimpleMessageAnnotation &#123;
     public String message&#40;&#41;;
&#125;

As you [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using build-in Java annotation types (like @Overrides or @Deprecated) and those created by different vendors/services for a while now but I&#8217;ve never built my own. Here is an example of how you can define very simple annotation type and use it:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.lang.annotation.Retention</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> SimpleMessageAnnotation <span style="color: #009900;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> message<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>As you can see a declaration of the new annotation type is very similar to the Java interface declaration (add &#8216;@&#8217; symbol in front of the interface) There are some additional rules you have to follow:</p>
<ul>
<li>Method declarations should not have any parameters</li>
<li>Method declarations should not have any throws clauses</li>
<li>Return types of the method should be one of the following:<br />
primitives, String, Class, enum, array of the above types</li>
</ul>
<p>In order to annotate a class with the new type you can write:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">&nbsp;
@SimpleMessageAnnotation<span style="color: #009900;">&#40;</span>message <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;hello world!!!&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> TestAnnotation <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Now in order to access the message value during the runtime we can use reflection API. Before we can do that we need to change the RetentionPolicy of our new annotation type to RUNTIME. We can do it by adding Retention annotation to our SimpleMessageAnnotation:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.lang.annotation.Retention</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">static</span> java.<span style="color: #006633;">lang</span>.<span style="color: #006633;">annotation</span>.<span style="color: #006633;">RetentionPolicy</span>.<span style="color: #006633;">RUNTIME</span><span style="color: #339933;">;</span>
&nbsp;
@Retention<span style="color: #009900;">&#40;</span>RUNTIME<span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> @<span style="color: #000000; font-weight: bold;">interface</span> SimpleMessageAnnotation <span style="color: #009900;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> message<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>This will inform the compiler about the new policy. There are 3 policies which can be used by the compiler (default is CLASS):</p>
<ul>
<li>SOURCE—Annotations are to be discarded by the compiler.</li>
<li>CLASS—Annotations are to be recorded in the class file by the compiler but need not be retained by the VM at runtime. This is the default behavior.</li>
<li>RUNTIME—Annotations are to be recorded in the class file by the compiler and retained by the VM at runtime, so they may be read reflectively.</li>
</ul>
<p>Now by using reflection API we can access our message value like this:</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> Run <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: #009900;">&#123;</span>
&nbsp;
		Class<span style="color: #339933;">&lt;</span>TestAnnotation<span style="color: #339933;">&gt;</span> clazz <span style="color: #339933;">=</span> TestAnnotation.<span style="color: #000000; font-weight: bold;">class</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>clazz.<span style="color: #006633;">getAnnotation</span><span style="color: #009900;">&#40;</span>SimpleMessageAnnotation.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">message</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>What can be annotated?</strong></p>
<ul>
<li>package</li>
<li>class ( including interface, enum)</li>
<li>method</li>
<li>field</li>
<li>local variable, formal parameter (compile time only)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://michalkuklis.com/blog/2008/10/24/java-annotation-types/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to setup Sun&#8217;s Java JDK on Fedora 8</title>
		<link>http://michalkuklis.com/blog/2008/02/28/how-to-setup-suns-java-jdk-on-fedora-8/</link>
		<comments>http://michalkuklis.com/blog/2008/02/28/how-to-setup-suns-java-jdk-on-fedora-8/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 02:13:30 +0000</pubDate>
		<dc:creator>Michał Kuklis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://michalkuklis.com/blog/?p=32</guid>
		<description><![CDATA[How to setup Sun’s Java JDK on Fedora 8
]]></description>
			<content:encoded><![CDATA[<p><a href="http://rabbitbrush.frazmtn.com/sun-java-on-F8.html">How to setup Sun’s Java JDK on Fedora 8</a></p>
]]></content:encoded>
			<wfw:commentRss>http://michalkuklis.com/blog/2008/02/28/how-to-setup-suns-java-jdk-on-fedora-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FLEX + SPRING + IBATIS + CAIRNGORM</title>
		<link>http://michalkuklis.com/blog/2007/05/29/flex-spring-ibatis-cairngorm/</link>
		<comments>http://michalkuklis.com/blog/2007/05/29/flex-spring-ibatis-cairngorm/#comments</comments>
		<pubDate>Tue, 29 May 2007 20:31:28 +0000</pubDate>
		<dc:creator>Michał Kuklis</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://michalkuklis.com/archives/25</guid>
		<description><![CDATA[Chris Giametta wrote   about how to connect all of the above together.
update:
Christophe Coenraets shows how to use flex with  Spring here
Peter Martin describes how to deploy flex on WebSphere here
]]></description>
			<content:encoded><![CDATA[<p>Chris Giametta <a href="http://www.appfoundation.com/blogs/giametta/2007/05/09/flex-spring-ibatis-caringorm-bringing-it-all-together/">wrote </a>  about how to connect all of the above together.</p>
<p>update:<br />
Christophe Coenraets shows how to use flex with  Spring <a href="http://coenraets.org/flex-spring">here</a><br />
Peter Martin describes how to deploy flex on WebSphere <a href="http://weblogs.macromedia.com/pmartin/archives/2006/11/deploying_flex.cfm">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://michalkuklis.com/blog/2007/05/29/flex-spring-ibatis-cairngorm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
