<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5192882573953138361</id><updated>2012-01-08T11:03:09.269-08:00</updated><category term='Java API'/><category term='JNI'/><category term='Design patterns'/><category term='Performance tests'/><category term='Hack'/><category term='Synchronization'/><category term='Networking'/><category term='enumeration'/><category term='JODA'/><category term='Tutorials'/><category term='Groovy'/><category term='Reflections'/><category term='Java 6'/><title type='text'>Mike's Java blog</title><subtitle type='html'>Information about my everyday life with java language and java technologies</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mike-java.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mike-java.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Mike</name><uri>http://www.blogger.com/profile/05448370454151696512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5192882573953138361.post-5840918848005341958</id><published>2008-08-03T09:05:00.000-07:00</published><updated>2008-08-03T09:27:16.514-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='enumeration'/><category scheme='http://www.blogger.com/atom/ns#' term='Java API'/><title type='text'>Java abstract enumeration and java.lang.Class.isEnum() problem</title><summary type='text'>One of new features in Java 1.5 is direct support of enumeration using enum keyword. According to this the new method isEnum() has been added to java.lang.Class class (which is part of Java Reflections API). The problem is that the isEnum method doesn’t always behave as you would expect.Let’s start with the following Java code:public class MainTest {  // Enum with custom constructor  enum </summary><link rel='replies' type='application/atom+xml' href='http://mike-java.blogspot.com/feeds/5840918848005341958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5192882573953138361&amp;postID=5840918848005341958' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/5840918848005341958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/5840918848005341958'/><link rel='alternate' type='text/html' href='http://mike-java.blogspot.com/2008/08/java-abstract-enumeration-and.html' title='Java abstract enumeration and java.lang.Class.isEnum() problem'/><author><name>Mike</name><uri>http://www.blogger.com/profile/05448370454151696512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5192882573953138361.post-7610432638682122885</id><published>2008-06-30T12:55:00.000-07:00</published><updated>2008-06-30T13:22:55.855-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design patterns'/><title type='text'>State design pattern in Java</title><summary type='text'>State design pattern is extremely useful when you need a state class. Typical example is a class making a connection to a server (check POP3 client tutorial for example). The class then has two states – connected and disconnected (which is the default state). In the class you would need to check for the state at many places. Let’s imagine that your class doesn’t have just two states but four or </summary><link rel='replies' type='application/atom+xml' href='http://mike-java.blogspot.com/feeds/7610432638682122885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5192882573953138361&amp;postID=7610432638682122885' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/7610432638682122885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/7610432638682122885'/><link rel='alternate' type='text/html' href='http://mike-java.blogspot.com/2008/06/state-design-pattern-in-java.html' title='State design pattern in Java'/><author><name>Mike</name><uri>http://www.blogger.com/profile/05448370454151696512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5192882573953138361.post-5745637956234061197</id><published>2008-06-08T06:11:00.000-07:00</published><updated>2008-06-08T06:20:04.863-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hack'/><category scheme='http://www.blogger.com/atom/ns#' term='Java API'/><category scheme='http://www.blogger.com/atom/ns#' term='Reflections'/><title type='text'>How to call private constructor/method from outside in Java</title><summary type='text'>As you certainly know, one of the OOP’s features is encapsulation. Java has private keyword to specify encapsulated constructors, methods or attributes. These methods and attributes should not be accessible from the rest of the world (they are not part of the API) and Java doesn’t allow you to do that ordinarily.You can however use Java reflections API to access any private method, field or </summary><link rel='replies' type='application/atom+xml' href='http://mike-java.blogspot.com/feeds/5745637956234061197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5192882573953138361&amp;postID=5745637956234061197' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/5745637956234061197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/5745637956234061197'/><link rel='alternate' type='text/html' href='http://mike-java.blogspot.com/2008/06/how-to-call-private-constructormethod.html' title='How to call private constructor/method from outside in Java'/><author><name>Mike</name><uri>http://www.blogger.com/profile/05448370454151696512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5192882573953138361.post-4351113420874442426</id><published>2008-05-19T05:45:00.000-07:00</published><updated>2008-05-19T12:08:12.022-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java API'/><category scheme='http://www.blogger.com/atom/ns#' term='JNI'/><title type='text'>Java enum in Java Native Interface (JNI)</title><summary type='text'>A few days ago I started to take interest in JNI (http://en.wikipedia.org/wiki/Java_Native_Interface). JNI is used to call java native methods that are written in other language than Java. Java native methods are usually system dependent and are used to provide functionality that has to be handled by an operating system. Example is creating and handling threads in Java. This functionality is </summary><link rel='replies' type='application/atom+xml' href='http://mike-java.blogspot.com/feeds/4351113420874442426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5192882573953138361&amp;postID=4351113420874442426' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/4351113420874442426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/4351113420874442426'/><link rel='alternate' type='text/html' href='http://mike-java.blogspot.com/2008/05/java-enum-in-java-native-interface-jni.html' title='Java enum in Java Native Interface (JNI)'/><author><name>Mike</name><uri>http://www.blogger.com/profile/05448370454151696512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5192882573953138361.post-707018796819284166</id><published>2008-04-26T05:13:00.000-07:00</published><updated>2008-07-04T09:54:46.651-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Design patterns'/><category scheme='http://www.blogger.com/atom/ns#' term='Synchronization'/><title type='text'>(Synchronized) Singleton design pattern in Java</title><summary type='text'>Singleton falls into the group of simple design patterns. Singleton is a class that has one and only instance in an application. As singletons are usually realized pools (connection, thread, …), cash memories or drivers.Implementing singleton is quite simple task. The following steps have to be done:declare constructor as private to ensure that no instance of the class can be createdimplement </summary><link rel='replies' type='application/atom+xml' href='http://mike-java.blogspot.com/feeds/707018796819284166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5192882573953138361&amp;postID=707018796819284166' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/707018796819284166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/707018796819284166'/><link rel='alternate' type='text/html' href='http://mike-java.blogspot.com/2008/04/singleton-design-pattern.html' title='(Synchronized) Singleton design pattern in Java'/><author><name>Mike</name><uri>http://www.blogger.com/profile/05448370454151696512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5192882573953138361.post-6557689153350234761</id><published>2008-03-24T11:09:00.000-07:00</published><updated>2008-05-11T09:30:28.709-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java API'/><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='Java 6'/><title type='text'>Java 6 compiler API tutorial</title><summary type='text'>One of the new features in Java 6 is compiler API. It let’s you compile any Java source code file on the fly and after compilation you can load compiled class using a class loader and start using it. Because Java compiler doesn’t know anything about classes compiled on the fly, so you can use them only using java reflections.In the first step we need to prepare a class that is going to be </summary><link rel='replies' type='application/atom+xml' href='http://mike-java.blogspot.com/feeds/6557689153350234761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5192882573953138361&amp;postID=6557689153350234761' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/6557689153350234761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/6557689153350234761'/><link rel='alternate' type='text/html' href='http://mike-java.blogspot.com/2008/03/java-6-compiler-api-tutorial.html' title='Java 6 compiler API tutorial'/><author><name>Mike</name><uri>http://www.blogger.com/profile/05448370454151696512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5192882573953138361.post-1915228366445958345</id><published>2008-03-11T13:34:00.000-07:00</published><updated>2008-05-11T09:31:16.628-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='Networking'/><title type='text'>Simple POP3 client in Java (tutorial)</title><summary type='text'>This article is intended for people who have no or very little experience with networking in Java.Today, my aim is to show you how to make your own simple POP3 client in Java. Some people are scared of creating a network application in Java because they think it have to be difficult to handle such topic, but opposite is true. It’s easier than you could think as you will see later. I chose the </summary><link rel='replies' type='application/atom+xml' href='http://mike-java.blogspot.com/feeds/1915228366445958345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5192882573953138361&amp;postID=1915228366445958345' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/1915228366445958345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/1915228366445958345'/><link rel='alternate' type='text/html' href='http://mike-java.blogspot.com/2008/03/simple-pop3-client-in-java-tutorial.html' title='Simple POP3 client in Java (tutorial)'/><author><name>Mike</name><uri>http://www.blogger.com/profile/05448370454151696512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5192882573953138361.post-6671088275573116473</id><published>2008-03-02T07:03:00.000-08:00</published><updated>2008-05-11T09:31:44.995-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Performance tests'/><category scheme='http://www.blogger.com/atom/ns#' term='Groovy'/><title type='text'>Groovy performance test</title><summary type='text'>A few days ago I came across an article about Groovy (http://groovy.codehaus.org). It took me so I decided to go through useful Groovy tutorial (you can find it here http://www.asert.com/pubs/Groovy/Groovy.pdf). Groovy is a scripting language based on Java. You can write your Java code in much simpler way using Groovy and you can whenever use legacy Java code in your Groovy code if you want to. </summary><link rel='replies' type='application/atom+xml' href='http://mike-java.blogspot.com/feeds/6671088275573116473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5192882573953138361&amp;postID=6671088275573116473' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/6671088275573116473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/6671088275573116473'/><link rel='alternate' type='text/html' href='http://mike-java.blogspot.com/2008/03/groovy-performance-test.html' title='Groovy performance test'/><author><name>Mike</name><uri>http://www.blogger.com/profile/05448370454151696512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_55WAIRGKU9g/R8rNknMRqfI/AAAAAAAAABA/pO03zDzR7VM/s72-c/2.+file.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5192882573953138361.post-1951608522469803677</id><published>2008-02-24T10:52:00.000-08:00</published><updated>2008-05-11T09:32:14.524-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JODA'/><category scheme='http://www.blogger.com/atom/ns#' term='Java API'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance tests'/><title type='text'>Java date &amp; time API vs. JODA</title><summary type='text'>Java has simple API for working with date and time. Many people find the API deficient and I’m one of them. Although I was using SimpleDateFormat and GregorianCalendar classes in Java API for long time, sometimes I found it very cumbersome and unsuitable for my task. Sometimes there were problems with parsing input text and the problems couldn’t be directly solved using Java API. Java community </summary><link rel='replies' type='application/atom+xml' href='http://mike-java.blogspot.com/feeds/1951608522469803677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5192882573953138361&amp;postID=1951608522469803677' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/1951608522469803677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5192882573953138361/posts/default/1951608522469803677'/><link rel='alternate' type='text/html' href='http://mike-java.blogspot.com/2008/02/java-date-time-api-vs-joda.html' title='Java date &amp; time API vs. JODA'/><author><name>Mike</name><uri>http://www.blogger.com/profile/05448370454151696512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_55WAIRGKU9g/R8MGRAgTLwI/AAAAAAAAAAs/BqxOQqE8wio/s72-c/parse.jpg' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
