<?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-5488862533782141445</id><updated>2011-12-30T07:06:50.701-08:00</updated><category term='Hashtable'/><category term='JBoss'/><category term='MySQL'/><category term='java'/><category term='Collator'/><category term='ArrayList'/><category term='HashMap'/><category term='String'/><category term='Comparator'/><category term='conference'/><category term='IndexOutOfBoundsException'/><category term='Netbeans'/><category term='Tomcat'/><category term='Collections'/><category term='Greek'/><category term='javapolis java conference'/><category term='Devoxx'/><category term='Copy'/><category term='javapolis'/><category term='javapolis 2007'/><category term='Eclipse'/><category term='Web application'/><category term='List'/><category term='parleys'/><category term='Debug'/><category term='J2EE'/><category term='JEE'/><title type='text'>JNK Java</title><subtitle type='html'>My blog about Java.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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>35</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5488862533782141445.post-4227934600099998580</id><published>2011-10-27T13:48:00.000-07:00</published><updated>2011-10-27T13:48:29.720-07:00</updated><title type='text'>Concurrency in Java 6</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Threads are lightweight processes that share the same memory space. A scheduler can swap between threads. Java uses &lt;b&gt;&lt;i&gt;preemptive multithreading,&lt;/i&gt;&lt;/b&gt; where the OS is responsible for swapping threads.&lt;br /&gt;Java 5 has introduced a significant new paradigm to handle threads, compared to the primitive concurrent commands of pre version 5. It is recommended that you use the new &lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;java.util.concurrent.*&lt;/span&gt; package. In the following I show the thread commands for Java pre-version 5 and post-version 5.&lt;br /&gt;&lt;br /&gt;&lt;table border="1" cellpadding="2" cellspacing="2" style="text-align: left; width: 100%;"&gt;&lt;tbody&gt;&lt;tr style="font-family: Courier New,Courier,monospace;"&gt; &lt;td style="text-align: center; vertical-align: top; width: 50%;"&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Java 1-4&lt;/span&gt;&lt;/td&gt; &lt;td style="text-align: center; vertical-align: top; width: 50%;"&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Java 5-7&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr align="center" style="font-family: Courier New,Courier,monospace;"&gt; &lt;td colspan="2" rowspan="1" style="vertical-align: top; width: 797px;"&gt;&lt;span style="font-weight: bold;"&gt;Thread Creation&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr style="font-family: Courier New,Courier,monospace;"&gt; &lt;td style="vertical-align: top; width: 798px;"&gt;public class&lt;br /&gt;MyThread extends Thread { &lt;br /&gt;&amp;nbsp;&amp;nbsp; public void run() { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // your concurrent task here&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;MyThread thread = new MyThread();&lt;br /&gt;thread.start();&lt;br /&gt;&lt;br /&gt;or &lt;br /&gt;&lt;br /&gt;public class MyTask implements Runnable {&lt;br /&gt;&amp;nbsp;&amp;nbsp; public void run() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // your concurrent task here&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Thread thread = new Thread(new MyTask());&lt;br /&gt;&lt;br /&gt;thread.start();&lt;br /&gt;&lt;br /&gt;&lt;/td&gt; &lt;td style="vertical-align: top;"&gt;public class MyTask implements &lt;span style="font-weight: bold;"&gt;Runnable&lt;/span&gt; {&lt;br /&gt;&amp;nbsp;&amp;nbsp; public void &lt;span style="font-weight: bold;"&gt;run&lt;/span&gt;(){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // your concurrent task here&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;// Creates new threads as needed and destroys old threads&lt;br /&gt;ExecutorService exec = Executors.newCachedThreadPool();&lt;br /&gt;// Keeps a permanent total number of threads &lt;br /&gt;ExecutorService exec = Executors.newFixedThreadPool(5);&lt;br /&gt;// Like newFixedThreadPool but only for one thread &lt;br /&gt;ExecutorService exec = Executors.newSingleThreadExecutor();&lt;br /&gt;// To be scheduled, to replace java.util.Timer&lt;br /&gt;ExecutorService exec = Executors.newScheduledThreadPool();&lt;br /&gt;// Like before but for one thread only&lt;br /&gt;ExecutorService exec = Executors.newSingleThreadScheduledExecutor(); &lt;br /&gt;&lt;br /&gt;exec.execute(new MyTask());&lt;br /&gt;exec.shutdown();&lt;br /&gt;&lt;br /&gt;&lt;hr style="height: 2px; width: 100%;" /&gt;int processors =&lt;br /&gt;Runtime.getRuntime().availableProcessors();&lt;br /&gt;&lt;br /&gt;ExecutorService executor = Executors.newFixedThreadPool(processors);&lt;br /&gt;&lt;br /&gt;Future&amp;lt;Integer&amp;gt; futureResult = executor.&lt;span style="font-weight: bold;"&gt;submit&lt;/span&gt;(&lt;br /&gt;&amp;nbsp;&amp;nbsp; new &lt;span style="font-weight: bold;"&gt;Callable&lt;/span&gt;&amp;lt;Integer&amp;gt;() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Integer &lt;span style="font-weight: bold;"&gt;call&lt;/span&gt;() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // long running computation that&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // returns an integer&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;Integer result = futureResult.&lt;span style="font-weight: bold;"&gt;get&lt;/span&gt;();&lt;br /&gt;// block until result is ready&lt;br /&gt;exec.shutdown();&lt;/td&gt; &lt;/tr&gt;&lt;tr align="center" style="font-family: Courier New,Courier,monospace;"&gt; &lt;td colspan="2" rowspan="1" style="vertical-align: top; width: 797px;"&gt;&lt;span style="font-weight: bold;"&gt;Critical sections&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr style="font-family: Courier New,Courier,monospace;"&gt; &lt;td style="vertical-align: top; width: 798px;"&gt;public synchronized void method() {&lt;br /&gt;&amp;nbsp; // same as synchronising on "this"&lt;br /&gt;&amp;nbsp; // which is dangerous as another&amp;nbsp; &lt;br /&gt;&amp;nbsp; // thread could get hold of "this"&lt;br /&gt;&amp;nbsp; // and block your code.&lt;br /&gt;&amp;nbsp; // When the lock is acquired for&lt;br /&gt;&amp;nbsp; // the synchronized block, other&lt;br /&gt;&amp;nbsp; // synchronized methods and&lt;br /&gt;&amp;nbsp; // critical sections in the object&lt;br /&gt;&amp;nbsp; // cannot be called. &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// use this instead&lt;br /&gt;// In Java, every object contains a “monitor”&lt;br /&gt;// that can be used to provide&lt;br /&gt;// mutual exlusion access to critical sections of code.&lt;br /&gt;&lt;br /&gt;private final Object monitor = new Object();&lt;br /&gt;&lt;br /&gt;public void method() {&lt;br /&gt;&amp;nbsp; synchronized(monitor) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // your critical section here&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/td&gt; &lt;td style="vertical-align: top;"&gt;import java.util.concurrent.locks.*;&lt;br /&gt;&lt;br /&gt;private final Lock lock = new ReentrantLock();&lt;br /&gt;&lt;br /&gt;public void method() {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; // cannot be interrupted&lt;br /&gt;&amp;nbsp; lock.lock();&lt;br /&gt;&amp;nbsp; // can be interrupted&lt;br /&gt;&amp;nbsp; // lock.lockInterruptibly();&lt;br /&gt;&amp;nbsp; try{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // your critical section here&lt;br /&gt;&amp;nbsp; } finally {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lock.unlock();&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// can try lock&lt;br /&gt;public void method() {&lt;br /&gt;&amp;nbsp; boolean locked = lock.tryLock();&lt;br /&gt;&amp;nbsp; if (locked) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; try{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // your critical section here&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } finally {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lock.unlock();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // do something else&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;hr style="height: 2px; width: 100%;" /&gt;import java.util.concurrent.locks.*;&lt;br /&gt;&lt;br /&gt;private final ReadWriteLock lock = new ReentrantReadWriteLock();&lt;br /&gt;&lt;br /&gt;public void doWrite() {&lt;br /&gt;&amp;nbsp;&amp;nbsp; lock.writeLock().lock();&lt;br /&gt;&amp;nbsp;&amp;nbsp; try { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // your critical section here&lt;br /&gt;&amp;nbsp;&amp;nbsp; } finally { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lock.writeLock().unlock(); &lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void doRead() {&lt;br /&gt;&amp;nbsp;&amp;nbsp; lock.readLock().lock();&lt;br /&gt;&amp;nbsp;&amp;nbsp; try { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // your critical section here&lt;br /&gt;&amp;nbsp;&amp;nbsp; } finally { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lock.readLock().unlock(); &lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/td&gt; &lt;/tr&gt;&lt;tr align="center" style="font-family: Courier New,Courier,monospace;"&gt; &lt;td colspan="2" rowspan="1" style="vertical-align: top; width: 797px;"&gt;&lt;span style="font-weight: bold;"&gt;Thread interactions&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr style="font-family: Courier New,Courier,monospace;"&gt; &lt;td style="vertical-align: top; width: 798px;"&gt;&lt;br /&gt;&lt;br /&gt;private final Object lock = new Object();&amp;nbsp; // must lock on the&lt;br /&gt;same object&lt;br /&gt;&lt;br /&gt;private volatile boolean notified = false;&lt;br /&gt;&lt;br /&gt;public void doWait() {&lt;br /&gt;&amp;nbsp; synchronized(lock) {&lt;br /&gt;&amp;nbsp;&amp;nbsp; while(!notified) {&amp;nbsp; // avoid spurious wakeups&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // releases the object lock and waits&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // until it gets notified&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // otherwise the notifying thread could&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // never acquire the lock!&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lock.wait(); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch(InterruptedException e) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; //clear signal for next waiting thread and continue running&lt;br /&gt;&amp;nbsp;&amp;nbsp; notified = false;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void doNotify() {&lt;br /&gt;&amp;nbsp; synchronized(lock) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; notified = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // sends a message to a thread waiting on the object lock&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lock.notify();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // sends a message to all the threads waiting on the object lock&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // lock.notifyAll();&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/td&gt; &lt;td style="vertical-align: top;"&gt;import java.util.concurrent.locks.*;&lt;br /&gt;&lt;br /&gt;private final Lock lock = new ReentrantLock();&lt;br /&gt;&lt;br /&gt;private final Condition condition = lock.newCondition();&lt;br /&gt;&lt;br /&gt;private volatile boolean notified = false;&lt;br /&gt;&lt;br /&gt;public void doWait() {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; lock.lock();&lt;br /&gt;&amp;nbsp; try{&lt;br /&gt;&amp;nbsp;&amp;nbsp; while(!notified) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; condition.await(); // like wait(), releases&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;// the lock and suspends current thread &lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; } finally {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lock.unlock();&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; notified = false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void doNotify() {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp; lock.lock();&lt;br /&gt;&amp;nbsp; try{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; notified = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; condition.signal();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // like notify()&lt;br /&gt;&amp;nbsp; &amp;nbsp; // condition.signalAll(); // like notifyAll()&lt;br /&gt;&amp;nbsp; } finally {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lock.unlock();&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;hr /&gt;final CountDownLatch latch = new CountDownLatch(3);&lt;br /&gt;ExecutorService exec = Executors.newSingleThreadExecutor();&lt;br /&gt;exec.execute(new Runnable() {&lt;br /&gt;&amp;nbsp; public void run() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; try { // puts it into WAITING state&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; latch.await();&amp;nbsp; // until latch == 0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (InterruptedException e) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Thread.currentThread.interrupt(); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; } &lt;br /&gt;});&lt;br /&gt;for (int i=0; i&amp;lt;3; i++) {&lt;br /&gt;&amp;nbsp; Thread.sleep(1000); &lt;br /&gt;&amp;nbsp; latch.countDown(); // --latch;&lt;br /&gt;}&lt;br /&gt;&lt;hr /&gt;final Semaphore semaphore = new Semaphore(3);&lt;br /&gt;ExecutorService exec = Executors.newSingleThreadExecutor();&lt;br /&gt;exec.execute(new Runnable() {&lt;br /&gt;&amp;nbsp; public void run() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; semaphore.acquire(); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread.sleep(1000);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } finally {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; semaphore.release();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (InterruptedException e) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Thread.currentThread.interrupt(); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;&amp;nbsp; } &lt;br /&gt;});&lt;br /&gt;Also check: CyclicBarrier, Semaphore, Exchanger&lt;br /&gt;&lt;br /&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr align="center" style="font-family: Courier New,Courier,monospace;"&gt; &lt;td colspan="2" rowspan="1" style="vertical-align: top;"&gt;&lt;span style="font-weight: bold;"&gt;Atomicity/Visibility&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td style="vertical-align: top;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;/* The volatile&amp;nbsp;modifier can be used to mark a field and indicate that changes to that field must be seen by all subsequent reads by other threads, regardless of synchronization.*/&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;public class MyClass implements Runnable {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;private volatile boolean finished = false;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp;&amp;nbsp; public void finish() {&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; finished = true;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp;&amp;nbsp; public void run() {&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(!finished) {&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // .. do processing&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;}&lt;/span&gt;&lt;/td&gt; &lt;td style="vertical-align: top;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;import java.util.concurrent.atomic.*;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;public class Counter {&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp; private AtomicInteger value = new AtomicInteger();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp; public int next() {&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp;&amp;nbsp; return value.incrementAndGet();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;java.util.concurrent.atomic package:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;/span&gt;&lt;li&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;AtomicBoolean&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;/span&gt;&lt;li&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;AtomicLong&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;/span&gt;&lt;li&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;AtomicInteger&lt;/span&gt;&lt;/li&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;/span&gt;&lt;li&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;AtomicReference&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;/span&gt;&lt;/ul&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr align="center" style="font-family: Courier New,Courier,monospace;"&gt; &lt;td colspan="2" rowspan="1" style="vertical-align: top;"&gt;&lt;span style="font-weight: bold;"&gt;Periodic Tasks&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td style="vertical-align: top;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;try {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp; Thread.sleep(1000);&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;// or TimeUnit.SECONDS.sleep(1);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;} catch(InterruptedException ex) {&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp;&amp;nbsp; Thread.currentThread().interrupt();&amp;nbsp;&amp;nbsp; // set interrupted status to true&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&amp;nbsp; break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt; &lt;td style="vertical-align: top;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;TimerTask task = new TimerTask() {&lt;br /&gt;&amp;nbsp; public void run() {&lt;br /&gt;&amp;nbsp;&amp;nbsp; // your concurrent task here&lt;br /&gt;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;};&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;Timer timer = new Timer();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;timer.schedule(task, 1000, 1000);&amp;nbsp;&amp;nbsp; // (TimerTask, long delay, long period)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;// Better use this instead of java.util.Timer&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ExecutorService exec = Executors.newScheduledThreadPool();&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;// or this&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;ExecutorService exec = Executors.newSingleThreadScheduledExecutor(); &lt;/div&gt;&lt;hr style="height: 2px; width: 100%;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;new javax.swing.Timer(1000, new ActionListener() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void actionPerformed( ActionEvent evt) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //...Perform a task...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}).start();&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr align="center"&gt; &lt;td colspan="2" rowspan="1" style="vertical-align: top;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;"&gt; Concurrent Collections&lt;/span&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td style="font-family: Courier New,Courier,monospace; vertical-align: top;"&gt;Sets&lt;br /&gt;&lt;br /&gt;&lt;/td&gt; &lt;td style="font-family: Courier New,Courier,monospace; vertical-align: top;"&gt;CopyOnWriteArraySet,&lt;br /&gt;CopyOnWriteArrayList, ConcurrentSkipListSet&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td style="font-family: Courier New,Courier,monospace; vertical-align: top;"&gt;Maps&lt;br /&gt;&lt;br /&gt;&lt;/td&gt; &lt;td style="font-family: Courier New,Courier,monospace; vertical-align: top;"&gt;ConcurrentHashMap,&lt;br /&gt;ConcurrentSkipListMap&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td style="font-family: Courier New,Courier,monospace; vertical-align: top;"&gt;Queues&lt;br /&gt;&lt;br /&gt;&lt;/td&gt; &lt;td style="font-family: Courier New,Courier,monospace; vertical-align: top;"&gt;&lt;span style="font-style: italic;"&gt;BlockingQueue&lt;/span&gt;, ConcurrentLinkedQueue, ArrayBlockingQueue, LinkedBlockingQueue,&lt;br /&gt;PriorityBlockingQueue, DelayQueue, SynchronousQueue, &lt;span style="font-style: italic;"&gt;BlockingDeque&lt;/span&gt;, LinkedBlockingDeque&lt;/td&gt; &lt;/tr&gt;&lt;/tbody&gt; &lt;/table&gt;&lt;br /&gt;Here's an example of how to use the new API:&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;pre style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;code&gt;import java.util.concurrent.ExecutorService;&lt;br /&gt;import java.util.concurrent.Executors;&lt;br /&gt;import java.util.concurrent.TimeUnit;&lt;br /&gt;import java.util.concurrent.locks.Condition;&lt;br /&gt;import java.util.concurrent.locks.Lock;&lt;br /&gt;import java.util.concurrent.locks.ReentrantLock;&lt;br /&gt;&lt;br /&gt;public class ThreadInteractions implements Runnable {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private final Lock lock = new ReentrantLock();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private final Condition condition = lock.newCondition();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private volatile boolean notified = false;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void doWait() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println("Awaiting ...");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; lock.lock();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; while (!notified) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // like wait(), releases the lock&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // and suspends current thread&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; condition.await();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (InterruptedException e) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; e.printStackTrace();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } finally {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; lock.unlock();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; notified = false;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println("Resuming ...");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void doNotify() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; lock.lock();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; TimeUnit.SECONDS.sleep(1);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println("Notifying ...");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; notified = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; condition.signal(); // like notify()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // condition.signalAll(); // like notifyAll()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (InterruptedException e) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; e.printStackTrace();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; } finally {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; lock.unlock();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void run() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; this.doWait();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;* @param args&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;*/&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String[] args) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ThreadInteractions obj = new ThreadInteractions();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // a thread executes doWait()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ExecutorService exec = Executors.newSingleThreadExecutor();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; exec.execute(obj);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; exec.shutdown();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // the main thread executes doNotify()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; obj.doNotify();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;A thread, created by ExecutorService, calls the doWait() method, while the main method calls doNotify(). Here's the output.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Awaiting ...&lt;br /&gt;Notifying ...&lt;br /&gt;Resuming ...&lt;/pre&gt;&lt;br /&gt;It is more secure to use &lt;code&gt;condition.signalAll()&lt;/code&gt; instead of &lt;code&gt;condition.signal()&lt;/code&gt;. For that reason, the &lt;code&gt;notified&lt;/code&gt; flag is set back to false in order for the next thread (not in this example however) to set it back to true and the next thread to be notified. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;References&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Jenkov, J., &lt;i&gt;Introduction to Java Concurrency / Multithreading, &lt;/i&gt;&lt;a href="http://tutorials.jenkov.com/java-concurrency/index.html"&gt;http://tutorials.jenkov.com/java-concurrency/index.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Eckel, B. (2007), &lt;i&gt;Thinking in Java, &lt;/i&gt;4th Edition, Prentice Hall.&lt;/li&gt;&lt;li&gt;Kabutz, H. (1999-2011), Newsletters &lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-4227934600099998580?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/4227934600099998580/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=4227934600099998580' title='1 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/4227934600099998580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/4227934600099998580'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2011/10/concurrency-in-java-6.html' title='Concurrency in Java 6'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-7663432667886409707</id><published>2011-09-02T10:24:00.000-07:00</published><updated>2011-09-02T10:27:40.801-07:00</updated><title type='text'>Java Open Spaces Conference 2011 in Chania/Crete</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Unfortunately, it's over. A conference different than others, an un-conference! The&lt;a href="http://www.javaspecialists.eu/wiki/index.php/JavaSpecialistsSymposium2011"&gt; Java Open Spaces Conference&lt;/a&gt;, or Java Specialists Symposium took place from 29th of August till 1st of September 2011 in &lt;a href="http://www.perle-spa.com/"&gt;Perle Resort Spa Hotel&lt;/a&gt; at &lt;a href="http://maps.google.com/maps?q=%CE%A3%CF%84%CE%B1%CF%85%CF%81%CF%8C%CF%82,+%CE%91%CE%BA%CF%81%CF%89%CF%84%CE%B7%CF%81%CE%AF%CE%BF%CF%85,+%CE%95%CE%BB%CE%BB%CE%AC%CF%82&amp;amp;hl=en&amp;amp;ie=UTF8&amp;amp;ll=35.584456,24.075809&amp;amp;spn=0.029387,0.066047&amp;amp;sll=37.0625,-95.677068&amp;amp;sspn=57.772232,135.263672&amp;amp;vpsrc=6&amp;amp;t=h&amp;amp;z=15"&gt;Chania/Greece&lt;/a&gt;. A conference different than others. The theme for our 2011 Java Specialists Symposium was: &lt;b&gt;Making Java Fun Again.&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;An Open Spaces Conference&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The conference was based on the principle of &lt;a href="http://www.javaspecialists.eu/wiki/index.php/Open_Spaces_Conferences"&gt;Open Spaces&lt;/a&gt; (thanks to Kim and Kate Tucker).&lt;b&gt; &lt;/b&gt;In short, this means that we didn't invite key speakers, but the participants organised themselves to suggest topics of interest. This was the reason that no &lt;a href="http://www.javaspecialists.eu/wiki/index.php/JavaSpecialistsSymposium2011#Schedule"&gt;schedule &lt;/a&gt;was published even till the last day before the event. However, as you can&lt;a href="http://www.javaspecialists.eu/wiki/index.php/JavaSpecialistsSymposium2011:Schedule"&gt; here&lt;/a&gt;&lt;b&gt;, &lt;/b&gt;the magic of open spaces conferences worked and the participants organised themselves to present very interesting and advanced topics. Heinz Kabutz, Kirk Pepperdine, Ben Evans, Michael Hunger, Dimitris Andreadis, Sven Reimers, just to mention a few, led some very interesting discussions on various topics. The outcome of the un-conference will be published under the Creative Commons license.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Excursions&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A number of &lt;a href="http://www.javaspecialists.eu/wiki/index.php/JavaSpecialistsSymposium2011:excursions"&gt;excursions &lt;/a&gt;in the afternoon followed the morning sessions. This added substantially to the coherence of the group. The participants enjoyed them and attached to each other. We went to some secret beaches, we swam, we ate traditional Cretan food, just amazing, and for those who preferred something else than sight-seeing there have been programming sessions (puzzlers!) in the evenings. Heinz Kabutz offered his house for a BBQ on Wednesday evening which contributed to a great atmosphere!&lt;br /&gt;&lt;br /&gt;The participants loved the whole event. It was a combination of everything: conference, fun, sun, sea, great food, great company. What else can one ask? Ideal for you and your family. See you again next year!&lt;br /&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-7663432667886409707?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/7663432667886409707/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=7663432667886409707' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/7663432667886409707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/7663432667886409707'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2011/09/java-open-spaces-conference-2011-in.html' title='Java Open Spaces Conference 2011 in Chania/Crete'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-8949390843366690152</id><published>2011-02-13T13:38:00.001-08:00</published><updated>2011-02-13T13:51:33.424-08:00</updated><title type='text'>FOSDEM 2011</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Another &lt;a href="http://www.fosdem.org/2011/"&gt;FOSDEM&lt;/a&gt; (&lt;b&gt;F&lt;/b&gt;ree &lt;b&gt;O&lt;/b&gt;pen &lt;b&gt;S&lt;/b&gt;ource &lt;b&gt;D&lt;/b&gt;evelopers &lt;b&gt;E&lt;/b&gt;uropean &lt;b&gt;M&lt;/b&gt;eeting) conference took place in the same location, the Universite Libre de Bruxelles (ULB) in 5-6 February 2011. A lot of participants, really, most of the rooms were full and you had to queue a lot of time in advance in order to find a chair to sit.&lt;br /&gt;As a result I missed some interesting talks. A lot of stands of companies too, of OSS but also of OSH (Open Source Hardware) this year.&lt;br /&gt;Some interesting talks:&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;a href="http://www.fosdem.org/2011/schedule/event/firefox_html5"&gt;HTML 5 &lt;/a&gt;by &lt;a href="http://robertnyman.com/"&gt;Robert Nyman&lt;/a&gt; and &lt;a href="http://www.wait-till-i.com/"&gt;Christian Heilmann&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.fosdem.org/2011/schedule/event/practical_go"&gt;Practical Go Programming&lt;/a&gt;, a new language by Google&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.fosdem.org/2011/schedule/event/firefox4_new_features"&gt;Firefox 4: new features for users and developers&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.fosdem.org/2011/schedule/event/scala"&gt;Scala expressiveness&amp;nbsp;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.fosdem.org/2011/schedule/event/openjdk"&gt;State of OpenJDK&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div&gt;A number of insteresting stands, as already mentioned:&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;a href="http://www.manpremo.org/"&gt;Manpremo&lt;/a&gt; a remote management system designed to allow you to control dozens of computers with ease and power&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.cacert.org/"&gt;CACert&lt;/a&gt; - provides free certificates issued to you&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.openstreetmap.org/"&gt;OpenStreetMap&lt;/a&gt;&lt;/li&gt;&lt;li&gt; &lt;a href="http://www.obm.org/"&gt;OBM&lt;/a&gt; is an enterprise-class messaging and collaboration platform for workgroup and enterprises which includes Groupware, messaging server, CRM, LDAP, Windows Domain, smartphone and PDA synchronisation...&lt;/li&gt;&lt;li&gt;&lt;a href="http://yate.null.ro/"&gt;Yate&lt;/a&gt; - Yet Another Telephone Engine &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.haiku-os.org/"&gt;Haiku-OS&lt;/a&gt;&lt;/li&gt;&lt;li&gt; &lt;a href="http://beagleboard.org/"&gt;BeagleBoard&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&amp;nbsp;A summary of the HTML 5 presentation follows.&lt;br /&gt;&lt;br /&gt;HTML 5 introduces a lot of goodies like: autocomplete box, email text field, color and date picker, range controls , search bar, input validation, placeholders, autofocus etc. Its main advantage is that for the first time it standardises Javascript, that means you don't need to write different javascript code for the different browsers.&lt;br /&gt;It introduces a Canvas to draw images, play videos etc.&lt;br /&gt;&lt;code&gt;&lt;span style="background-color: black; color: white;"&gt;canvas.getContext("2d");&lt;/span&gt;&lt;br style="background-color: black; color: white;" /&gt;&lt;span style="background-color: black; color: white;"&gt; img = document.createElement("path/to/img");&lt;/span&gt;&lt;br style="background-color: black; color: white;" /&gt;&lt;span style="background-color: black; color: white;"&gt; img.addEventListener() ...&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Since SVG is also a very powerful library for vector graphics, what does Canvas bring more? Well, use Canvas for speed and SVG for interaction.&lt;br /&gt;&lt;code&gt; &lt;span style="background-color: black; color: white;"&gt;&amp;lt;video controls&amp;gt;&amp;lt;&lt;br /&gt;&amp;lt;source src="..."&amp;nbsp; type="video/mp4" media="..."&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;&lt;br /&gt;&amp;lt;video&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;It provides a lot of methods for interacting with the video, e.g. &lt;br /&gt;&lt;pre style="background-color: black; color: white;"&gt;load(), canPlayType(type), play(), pause(), stop(), addTrack() // for subtitles &lt;/pre&gt;etc.&lt;br /&gt;Using these methods you can interact with e.g. a Flash video which was a black box up to HTML 4. CSS3 allows you to interact with the video.&lt;br /&gt;While HTML 4 is stateless, HTML 5 is statefull, i.e. it allows you to store session variables to the &lt;i&gt;web storage&lt;/i&gt;. &lt;br /&gt;&lt;pre style="background-color: black; color: white;"&gt;sessionStorage.setItem(key, value);&lt;/pre&gt;&lt;pre style="background-color: black; color: white;"&gt;localStorage.setItem(key, value);&lt;/pre&gt;There is also support for webSQL and indexedDBs but also many TODOs:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;WebWorkers for multi-threaded Javascript&lt;/li&gt;&lt;li&gt;WebSockets for realtime multi-user interaction&lt;/li&gt;&lt;li&gt;Audio analysis&lt;/li&gt;&lt;li&gt;Face detection&lt;/li&gt;&lt;li&gt;Image generation&lt;/li&gt;&lt;li&gt;Server side rendering&lt;/li&gt;&lt;li&gt;Multi-touch interfaces&lt;/li&gt;&lt;li&gt;Device input support (e.g. cameras)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Check the speakers' blogs (found on top of this topic) for more information about these amazing features. And as they finished their presentation:&lt;br /&gt;&lt;blockquote&gt;&lt;div align="center"&gt;"We can't change history but we can change the future".&lt;/div&gt;&lt;/blockquote&gt;&lt;div class="zemanta-pixie"&gt;&lt;img alt="" class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=07123bd4-07b3-86c2-b715-7bf23c225ca4" /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-8949390843366690152?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/8949390843366690152/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=8949390843366690152' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/8949390843366690152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/8949390843366690152'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2011/02/fosdem-2011.html' title='FOSDEM 2011'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-6498726272964237708</id><published>2011-02-12T17:26:00.003-08:00</published><updated>2011-02-12T17:34:51.073-08:00</updated><title type='text'>Java IDEs</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;Most popular:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.netbeans.org/" target="_blank"&gt;NetBeans&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.eclipse.org/" target="_blank"&gt;Eclipse&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.myeclipseide.com/" target="_blank"&gt;MyEclipse&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.jetbrains.com/idea/" target="_blank"&gt;JetBrains IDEA&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;Less popular:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.navicoder.com/" target="_blank"&gt;NaviCoder&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.jetbrains.com/mps/" target="_blank"&gt;JetBrains Meta Programming System&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.openxava.org/"&gt;OpenXava&lt;/a&gt; for rapid web development&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.cloudgarden.com/jigloo/"&gt;Jigloo&lt;/a&gt; GUI builder, a nice plugin for eclipse&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.visualwebgui.com/"&gt;Visual WebGui&lt;/a&gt; is an IDE used to write code by drag &amp;amp; drop. Download a free version from &lt;a href="http://www.visualwebgui.com/tabid/570/Default.aspx"&gt;here&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;a href="http://jprovocateur.org/"&gt;JProvocateur&lt;/a&gt; for web application development &lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-6498726272964237708?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/6498726272964237708/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=6498726272964237708' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/6498726272964237708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/6498726272964237708'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2011/02/java-ides.html' title='Java IDEs'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-1964873354630069948</id><published>2011-02-12T17:26:00.001-08:00</published><updated>2011-02-12T17:28:20.763-08:00</updated><title type='text'>Useful tools/links</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://java-source.net/open-source/forum-software" target="_blank"&gt;Forums/BBs in Java&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.datanucleus.org/products/accessplatform/index.html" target="_blank"&gt;JPOX -&amp;gt; DataNucleus&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.nwiresoftware.com/" target="_blank"&gt;New innovative Eclipse plugin for code exploration&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://logdigger.com/" target="_blank"&gt;Track Java web application logs in Firefox&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.stripesframework.org/"&gt;Stripes 1.5&lt;/a&gt; a presentation framework for building web applications using the latest Java technologies&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://loom.extrema-sistemas.org/"&gt;Loom 1.0&lt;/a&gt; an open source Java web framework that handles user input validation and HTML generation for enterprise applications of any size&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.jhlabs.com/" target="_blank"&gt;Jerry Huxtable labs&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://exjali.sourceforge.net/" target="_blank"&gt;Exjali&lt;/a&gt; : EXpressiveness JAva LIbrary - Inspired by the buzz around Java 7 and "new" JVM language (Groovy, JRuby, Scala, ...), Exjali is a small Java library, allowing more expressive statements without altering the language. Exjali includes some attempts for ranges of integers, SQL-like functions, IO facilities, functors and named parameters.&lt;/li&gt;&lt;li&gt;&lt;a href="http://blogs.ilog.com/" target="_blank"&gt;Ilog's blog&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.jetbrains.com/teamcity/whatsnew/?tc40jl=&amp;amp;" target="_blank"&gt;Jetbrains Teamcity&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.alphaworks.ibm.com/tech/mtrat?open&amp;amp;S_TACT=105AGX59&amp;amp;S_CMP=GRsite-jw30&amp;amp;ca=dgr-jw30awmtrat" target="_blank"&gt;Multi-Thread Run-time Analysis Tool for Java&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://udig.refractions.net/" target="_blank"&gt;uDig&lt;/a&gt;, a GIS framework for eclipse&lt;/li&gt;&lt;li&gt;&lt;a href="http://tapestry.apache.org/" target="_blank"&gt;Tapestry&lt;/a&gt;, a framework for developing java web applications&lt;/li&gt;&lt;li&gt;&lt;a href="http://soasocial.com/" target="_blank"&gt;SOAsocial&lt;/a&gt;&amp;nbsp;is a social networking site where you can track socially relevant activities in the SOA community and also participate in polls and other applications.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.infoq.com/articles/Mail-Servers-Rademakers-Dirksen;jsessionid=47A2650D7EA2283A225C27F91C75B58F"&gt;Application Integration Through Mail Servers&lt;/a&gt; from the book&lt;a href="http://www.amazon.com/gp/product/1933988215/ref=s9subs_c1_14_img1-rfc_p_si1?pf_rd_m=ATVPDKIKX0DER&amp;amp;pf_rd_s=center-1&amp;amp;pf_rd_r=1MWAJ2SMXQSMW62ER5XF&amp;amp;pf_rd_t=101&amp;amp;pf_rd_p=463383351&amp;amp;pf_rd_i=507846"&gt; Open Source ESBs&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.jboss.org/resteasy" target="_blank"&gt;JBoss RestEasy&lt;/a&gt; helps you to build REST WS applications&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.web4j.com/"&gt;Web4J&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://tiles.apache.org/"&gt;Apache Tiles a templating framework to simplify web application user interfaces development&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.springsource.org/webflow"&gt;Spring WebFlow&lt;/a&gt; and &lt;a href="http://www.springsource.org/extensions/se-workflow"&gt;Spring Workflow&lt;/a&gt;. Some other &lt;a href="http://java-source.net/open-source/workflow-engines"&gt;workflow engines&lt;/a&gt; in Java.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://seleniumhq.org/"&gt;Selenium&lt;/a&gt; is a testing framework for your web application independent of the programming language you are using.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.igniterealtime.org/projects/openfire/"&gt;Openfire&lt;/a&gt; an XMPP Real Time Collaboration (RTC) server.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;a href="http://doc.java.sun.com/DocWeb/"&gt;DocWeb&lt;/a&gt; a community Javadoc.&lt;/li&gt;&lt;li&gt;&lt;a href="http://alice.org/"&gt;Alice&lt;/a&gt; an education software that teaches students computer programming in a 3D environment&lt;/li&gt;&lt;li&gt;Java API for KML (JAK) - can be found &lt;a href="http://code.google.com/p/javaapiforkml/"&gt;here&lt;/a&gt; or &lt;a href="http://labs.micromata.de/display/jak/Home/"&gt;here&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.playframework.org/"&gt;Play&lt;/a&gt; Web Application Framework&lt;/li&gt;&lt;li&gt;&lt;a href="http://vaadin.com/"&gt;Vaadin&lt;/a&gt; Java Framework for building web applications&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.webtoolkit.eu/jwt"&gt;JWt&lt;/a&gt; a Java web toolkit for web applications that can be deployed within standard Servlet containers&lt;/li&gt;&lt;li&gt;&lt;a href="http://javolution.org/"&gt;Javolution&lt;/a&gt; a library for real time applications&lt;/li&gt;&lt;li&gt;&lt;a href="http://jfcunit.sourceforge.net/"&gt;JfcUnit&lt;/a&gt; a swing unit test framework. A list of unit test frameworks can be found &lt;a href="http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks"&gt;here&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.openfaces.org/"&gt;OpenFaces&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.freebase.com/"&gt;FreeBase&lt;/a&gt; an entity-based database for the MetaWeb or Semantic Web. Watch the &lt;a href="http://wiki.freebase.com/wiki/What_is_Freebase%3F"&gt;video&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;For those who work on SOA, there are two new standars, Service Component Architecture (SCA) and Service Data Objects (SDO). Project &lt;a href="http://tuscany.apache.org/sca-overview.html"&gt;Apache Tuscany&lt;/a&gt; is an open source implementation of these standards from &lt;a href="http://osoa.org/"&gt;Open Service Oriented Architecture&lt;/a&gt; (OSOA).&lt;/li&gt;&lt;li&gt;&lt;a href="http://code.google.com/intl/el-GR/apis/o3d/"&gt;Google O3D&lt;/a&gt; a (deprecated) API for creating rich interactive applications for the browser.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="zemanta-pixie"&gt;&lt;img alt="" class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=44d6815c-f623-8e94-b1c4-5c67e9fbcba7" /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-1964873354630069948?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/1964873354630069948/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=1964873354630069948' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/1964873354630069948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/1964873354630069948'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2011/02/useful-toolslinks.html' title='Useful tools/links'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-7155606687007909609</id><published>2011-02-12T17:25:00.001-08:00</published><updated>2011-02-12T17:25:08.161-08:00</updated><title type='text'>ACMQueue programming challenge</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Like last year, ACM has already published its &lt;a href='http://queue.acm.org/icpc/'&gt;challenge&lt;/a&gt; (ICPC) for this year and there remain only 1 day for the deadline to submit your player. Good luck! &lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=05215d05-1d73-883f-bf68-643743b7b257' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-7155606687007909609?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/7155606687007909609/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=7155606687007909609' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/7155606687007909609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/7155606687007909609'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2011/02/acmqueue-programming-challenge.html' title='ACMQueue programming challenge'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-8195814873580251904</id><published>2011-02-12T17:21:00.001-08:00</published><updated>2011-02-12T17:21:17.041-08:00</updated><title type='text'>Java is pass by value</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;for both primitives and types. More information &lt;a href='http://www.theserverside.com/news/thread.tss?thread_id=61622'&gt;here&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=3162e7ab-1183-8d1a-8201-1371912c3cef' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-8195814873580251904?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/8195814873580251904/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=8195814873580251904' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/8195814873580251904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/8195814873580251904'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2011/02/java-is-pass-by-value.html' title='Java is pass by value'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-3319817276870493079</id><published>2011-02-12T17:18:00.001-08:00</published><updated>2011-02-12T17:18:38.282-08:00</updated><title type='text'>Java Tutorial Examples</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;span style='border-collapse: separate; color: rgb(0, 0, 0); font-family: Times; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;' class='Apple-style-span'&gt;&lt;div style='background-color: rgb(255, 255, 255); font: 13px/19px Georgia,&amp;apos;Times New Roman&amp;apos;,&amp;apos;Bitstream Charter&amp;apos;,Times,serif; padding: 0.6em; margin: 0px;'&gt;&lt;p&gt;&lt;a mce_href='http://www.java2s.com/Tutorial/Java/CatalogJava.htm' href='http://www.java2s.com/Tutorial/Java/CatalogJava.htm'&gt;http://www.java2s.com/Tutorial/Java/CatalogJava.htm&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a mce_href='http://www.javapractices.com/' href='http://www.javapractices.com/'&gt;http://www.javapractices.com/&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=bc7fd36c-b920-83ce-84d2-2e9253a6418c' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-3319817276870493079?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/3319817276870493079/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=3319817276870493079' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/3319817276870493079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/3319817276870493079'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2011/02/java-tutorial-examples.html' title='Java Tutorial Examples'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-308451270714532687</id><published>2011-02-12T17:17:00.001-08:00</published><updated>2011-02-12T17:17:59.023-08:00</updated><title type='text'>Java Design Patterns</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;a href='http://www.jpatterns.org/'&gt;Java Design Patterns&lt;/a&gt; are annotations in order to declare the DPs in Java. From the author of &lt;a href='http://www.javaspecialists.eu'&gt;Java Specialist's Newsletter&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=73860d35-2986-82ae-b982-a37e09226947' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-308451270714532687?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/308451270714532687/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=308451270714532687' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/308451270714532687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/308451270714532687'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2011/02/java-design-patterns.html' title='Java Design Patterns'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-8097499481373659469</id><published>2011-02-12T17:15:00.001-08:00</published><updated>2011-02-12T17:15:57.126-08:00</updated><title type='text'>XSS vulnerability in Tomcat Manager</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;More information &lt;a href='http://www.theserverside.com/news/thread.tss?thread_id=61354'&gt;here&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=d939b9d5-6ef7-8228-9ff2-3b6c733c961d' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-8097499481373659469?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/8097499481373659469/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=8097499481373659469' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/8097499481373659469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/8097499481373659469'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2011/02/xss-vulnerability-in-tomcat-manager.html' title='XSS vulnerability in Tomcat Manager'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-1254042549204456942</id><published>2011-02-12T17:08:00.001-08:00</published><updated>2011-02-12T17:08:01.842-08:00</updated><title type='text'>Conferences</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;ul&gt;&lt;li&gt;&lt;a href='http://javasymposium.techtarget.com/?Offer=JSEemjspa813h&amp;amp;asrc=EM_UTC_13182350&amp;amp;uid=5273198'&gt;TheServerSide Java Symposium 2011 - please note James Gosling speech on the first day&lt;br/&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href='http://patras.fosscomm.gr/'&gt;FOSSCOMM 2011 Patras May 7th-8th, Computer Engineering and Informatics Department&lt;/a&gt;&lt;br/&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=e66af93f-c632-85c3-9265-56a3dde97006' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-1254042549204456942?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/1254042549204456942/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=1254042549204456942' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/1254042549204456942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/1254042549204456942'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2011/02/conferences.html' title='Conferences'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-420981916725871258</id><published>2011-02-12T17:04:00.001-08:00</published><updated>2011-02-12T17:04:08.117-08:00</updated><title type='text'>LibreOffice</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;ul&gt;&lt;li&gt;&lt;a href='http://www.libreoffice.org/'&gt;LibreOffice 3.3&lt;/a&gt; is out and is very fast. LibreOffice is the continuation of &lt;a href='http://www.openoffice.org/'&gt;OpenOffice&lt;/a&gt; since Oracle plans to stop it.&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;a href='http://www.thinkfree.com/' target='_blank'&gt;ThinkFree Office&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=6b89a103-1913-80f7-9563-ca4277fe2e0d' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-420981916725871258?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/420981916725871258/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=420981916725871258' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/420981916725871258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/420981916725871258'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2011/02/libreoffice.html' title='LibreOffice'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-582382586408085695</id><published>2011-02-12T17:01:00.001-08:00</published><updated>2011-02-12T17:01:46.251-08:00</updated><title type='text'>How to write unmaintainable code</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;What an &lt;a href='http://freeworld.thc.org/root/phun/unmaintain.html'&gt;article&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=30bd5163-3c21-8a53-9e31-5548542de358' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-582382586408085695?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/582382586408085695/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=582382586408085695' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/582382586408085695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/582382586408085695'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2011/02/how-to-write-unmaintainable-code.html' title='How to write unmaintainable code'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-4918602402577295387</id><published>2011-02-12T16:30:00.001-08:00</published><updated>2011-02-12T16:30:08.093-08:00</updated><title type='text'>The ultimate Java puzzler</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Find it &lt;a href='http://dow.ngra.de/2009/02/16/the-ultimate-java-puzzler/'&gt;here&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=b1b07211-ca76-8273-ba90-3db2b8c13ae8' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-4918602402577295387?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/4918602402577295387/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=4918602402577295387' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/4918602402577295387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/4918602402577295387'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2011/02/ultimate-java-puzzler.html' title='The ultimate Java puzzler'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-3338678929254122788</id><published>2011-02-12T16:20:00.001-08:00</published><updated>2011-02-12T16:22:12.432-08:00</updated><title type='text'>Rich Internet Applications</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;div style="background-color: white; font: 13px/19px Georgia,'Times New Roman','Bitstream Charter',Times,serif; margin: 0px; padding: 0.6em;"&gt;When we talk about Rich Internet Applications (RIA), our mind goes to Ajax. Here are some useful links with Ajax libraries:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://extjs.com/" mce_href="http://extjs.com/" title="ExtJS"&gt;ExtJS&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://developer.yahoo.com/yui/" mce_href="http://developer.yahoo.com/yui/" title="YUI"&gt;Yahoo Interface Library (YUI)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://dojotoolkit.org/" mce_href="http://dojotoolkit.org/" title="Dojo"&gt;Dojo&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.jhug.gr/wp-admin/jquery.com/" mce_href="jquery.com/ " title="JQuery"&gt;jQuery&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.prototypejs.org/" mce_href="http://www.prototypejs.org/" title="Prototype"&gt;Prototype&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://script.aculo.us/" mce_href="http://script.aculo.us/" title="Script.aculo.us"&gt;Scripta.culo.us&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.zkoss.org/" mce_href="http://www.zkoss.org/" title="ZK"&gt;ZK&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://openrico.org/" mce_href="http://openrico.org" title="Rico"&gt;Rico&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://mochikit.com/" mce_href="http://mochikit.com/" title="MochiKit"&gt;MochiKit&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://mootools.net/" mce_href="http://mootools.net/" title="Mootools"&gt;Moo tools&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://code.google.com/webtoolkit/" mce_href="http://code.google.com/webtoolkit/" title="GWT"&gt;GWT&lt;/a&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;(Google Web Toolkit)&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.adobe.com/products/air/" mce_href="http://www.adobe.com/products/air/" title="Adobe AIR"&gt;Adobe AIR&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.aflax.org/" mce_href="http://www.aflax.org/" title="Aflax"&gt;Aflax&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.adobe.com/devnet/spry/" mce_href="http://www.adobe.com/devnet/spry/" title="Adobe Spry"&gt;Adobe Spry&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://javafx.com/" mce_href="http://javafx.com/" title="JavaFX"&gt;JavaFX&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: Times; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;a href="http://www.jboss.org/richfaces" target="_blank"&gt;JBoss RichFaces&lt;/a&gt;&lt;/span&gt; &lt;/li&gt;&lt;/ul&gt;and IDEs:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.aptana.com/" mce_href="http://www.aptana.com" title="Aptana"&gt;Aptana&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://code.google.com/p/js-builder/" mce_href="http://code.google.com/p/js-builder/" title="JS Builder"&gt;JS Builder&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.adobe.com/products/flex" mce_href="http://www.adobe.com/products/flex" title="Adobe Flex"&gt;Adobe Flex&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="zemanta-pixie"&gt;&lt;img alt="" class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=fcef828d-a343-8c53-b49a-f73f57ff1d55" /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-3338678929254122788?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/3338678929254122788/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=3338678929254122788' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/3338678929254122788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/3338678929254122788'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2011/02/rich-internet-applications.html' title='Rich Internet Applications'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-2901615065107613654</id><published>2011-02-12T16:02:00.001-08:00</published><updated>2011-02-12T16:40:16.013-08:00</updated><title type='text'>Open Source Observatory and Repository (OSOR) Technical platform</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;a href="http://osor.eu/"&gt;Open Source Observatory and Repository (OSOR) &lt;/a&gt;Technical platform is EU's equivalent to &lt;a href="http://sourceforge.net/" target="_blank"&gt;Sourceforge&lt;/a&gt;. License is EUPL.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.osor.eu/news/eu-open-source-initiative-approves-european-union-public-licence"&gt;EU: Open Source Initiative approves European Union Public licence &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="zemanta-pixie"&gt;&lt;img alt="" class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=eb455b00-1f88-83a3-a4cb-21b5f7f35b0d" /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-2901615065107613654?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/2901615065107613654/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=2901615065107613654' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/2901615065107613654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/2901615065107613654'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2011/02/open-source-observatory-and-repository.html' title='Open Source Observatory and Repository (OSOR) Technical platform'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-8672027183273978817</id><published>2011-02-12T15:57:00.001-08:00</published><updated>2011-02-12T15:57:20.936-08:00</updated><title type='text'>ΕΕΛ/ΛΑΚ - Εταιρεία Ελεύθερου Λογισμικού /Λογισμικού Ανοικτού Κώδικα</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;span style='border-collapse: separate; color: rgb(0, 0, 0); font-family: Times; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;' class='Apple-style-span'&gt;&lt;div style='background-color: rgb(255, 255, 255); font: 13px/19px Georgia,&amp;apos;Times New Roman&amp;apos;,&amp;apos;Bitstream Charter&amp;apos;,Times,serif; padding: 0.6em; margin: 0px;'&gt;&lt;p&gt;ΕΕΛ/ΛΑΚ - Εταιρεία Ελεύθερου Λογισμικού /Λογισμικού Ανοικτού Κώδικα&lt;/p&gt;&lt;p&gt;ΔΕΛΤΙΟ ΤΥΠΟΥ&lt;br/&gt;Εταιρεία Ελεύθερου Λογισμικού /Λογισμικού Ανοικτού Κώδικα: Δυναμική Προώθηση και Ανάπτυξη του ΕΛ/ΛΑΚ στο χώρο της Εκπαίδευσης, του Δημόσιου Τομέα και των Επιχειρήσεων&lt;/p&gt;&lt;p&gt;Σημαντικοί φορείς και Ανώτατα Εκπαιδευτικά και Τεχνολογικά Ιδρύματα ενώνουν τις δυνάμεις τους και δραστηριοποιούνται για την επέκταση της χρήσης των εφαρμογών του ΕΛ/ΛΑΚ στη χώρα μας: ιδρύουν την «Εταιρεία Ελεύθερου Λογισμικού /Λογισμικού Ανοικτού Κώδικα» (ΕΕΛ/ΛΑΚ). Η ΕΕΛ/ΛΑΚ, εταιρεία με μη κερδοσκοπικό χαρακτήρα, έχει ως κύριο στόχο να συμβάλλει στην προώθηση και ανάπτυξη του ΕΛ/ΛΑΚ στο χώρο της εκπαίδευσης, του δημόσιου τομέα και των Επιχειρήσεων στην Ελλάδα.&lt;/p&gt;&lt;p&gt;Η εταιρία ΕΕΛ/ΛΑΚ ανταποκρινόμενη στο αυξανόμενο ενδιαφέρον για τα οφέλη της χρήσης του Ελεύθερου Λογισμικού, θα αποτελέσει κέντρο γνώσης και πλατφόρμα διαλόγου για το Ελεύθερο Λογισμικό/Λογισμικό Ανοικτού Κώδικα, και θα αναλάβει πρωτοβουλίες που θα διευκολύνουν και θα επιταχύνουν την διείσδυση του στους παραπάνω τομείς:&lt;br/&gt;• θα ευαισθητοποιήσει το κοινό σχετικά με τα οφέλη που προκύπτουν από την υιοθέτηση και ανάπτυξη του ΕΛ/ΛΑΚ.&lt;br/&gt;• θα φροντίσει για την έγκυρη και έγκαιρη πληροφόρηση σε θέματα που αφορούν το ΕΛ/ΛΑΚ στην Ελλάδα και το διεθνή χώρο (πχ. κωδικοποίηση βέλτιστων πρακτικών, συγκέντρωση και επεξεργασία στοιχείων για την εξέλιξη ποσοτικών και στατιστικών δεικτών, του θεσμικού και νομικού πλαισίου, του διαθέσιμου λογισμικού και εφαρμογών)&lt;br/&gt;• θα εργαστεί ώστε να υπάρξει συνεργασία για την ισότιμη συμμετοχή όλων των άλλων φορέων που έχουν άμεσο ή έμμεσο ρόλο στη διάδοση και ανάπτυξη του ΕΛ/ΛΑΚ στην Ελλάδα, όπως μεταξύ άλλων της κοινότητας προγραμματιστών ΕΛ/ΛΑΚ στην Ελλάδα καθώς και όσων ενδιαφέρονται να αναπτύξουν επιχειρηματική δραστηριότητα που σχετίζεται με το ΕΛ/ΛΑΚ&lt;br/&gt;• θα δημιουργήσει κέντρο παρακολούθησης (monitoring) για το ΕΛ/ΛΑΚ στην Ελλάδα (καταγραφή δράσεων και έργων, καταγραφή διαθέσιμου λογισμικού και εφαρμογών, καταγραφή αναγκών για την εισαγωγή και χρήση του σε διαφορετικούς τομείς, αναγνώριση προβλημάτων στην εισαγωγή/χρήση,&lt;br/&gt;στατιστικά στοιχεία και δείκτες, εξέλιξη θεσμικού και κανονιστικού πλαισίου, βιβλιογραφία, φορείς και οργανώσεις που αφορούν το ΕΛ/ΛΑΚ στην Ελλάδα)&lt;br/&gt;• θα συμβάλει στο συντονισμό των ομάδων εθελοντών προγραμματιστών ΕΛ/ΛΑΚ στην Ελλάδα, ώστε να αποτελέσουν τον βασικό κορμό για την ανάπτυξη και υλοποίηση λογισμικού και εφαρμογών&lt;br/&gt;• θα υποστηρίξει την ανάπτυξη και προώθηση επιχειρηματικών μοντέλων που βασίζονται στο ΕΛ/ΛΑΚ, καθώς και την ενημέρωση των επιχειρήσεων για τηνυιοθέτηση τους ή για τη μετάβαση τους σε αυτά&lt;br/&gt;• θα προσφέρει τεχνική υποστήριξη εφαρμογών ΕΛ/ΛΑΚ και συγκεκριμένα:&lt;br/&gt;δημιουργία υπηρεσίας υποστήριξης (help-desk) για χρήστες και ομάδες ΕΛ/ΛΑΚ, μέριμνα για εξελληνισμό (εντοπιοποίηση) λογισμικού, ανάπτυξη γλωσσάριου, επικουρική ανάπτυξη εφαρμογών για τις οποίες υπάρχει ζήτηση&lt;br/&gt;στην Ελλάδα.Η υλοποίηση όλων των παραπάνω στόχων βασίζεται στην ενεργή συνεργασία&lt;br/&gt;• της ελληνικής κοινότητας χρηστών και δημιουργών εφαρμογών (developers) ΕΛ/ΛΑΚ,&lt;br/&gt;• των εργαστηρίων ΑΕΙ, ΑΤΕΙ και Ερευνητικών Κέντρων της Χώρας που χρησιμοποιούν και αναπτύσσουν ελεύθερο λογισμικό,&lt;br/&gt;• των ενδιαφερόμενων φορέων-χρηστών (δημόσιοι φορείς, εκπαιδευτικοί φορείς και επιχειρήσεις),&lt;br/&gt;• των εταιρειών που δραστηριοποιούνται στους τομείς των τεχνολογιών πληροφορικής και επικοινωνιών που θα οδηγήσουν στη δημιουργία ικανής βάσης επιχειρησιακών μοντέλων υπηρεσιών ανάπτυξης και υποστήριξης ΕΛ/ΛΑΚ.&lt;br/&gt;Φορείς που συμμετέχουν:&lt;br/&gt;Το Εθνικό Δίκτυο Έρευνας και Τεχνολογίας (ΕΔΕΤ Α.Ε), το Εθνικό και Καποδιστριακό Πανεπιστήμιο Αθηνών(ΕΚΠΑ), το Ερευνητικό Κέντρο «Αθηνά», το Εθνικό Κέντρο Τεκμηρίωσης (Ε.Κ.Τ.), το Εθνικό Μετσόβιο Πολυτεχνείο (Ε.Μ.Π.), το Ερευνητικό Πανεπιστημιακό Ινστιτούτο Συστημάτων Επικοινωνιών και&lt;br/&gt;Υπολογιστών (Ε.Π.Ι.Σ.Ε.Υ.), το Ακαδημαϊκό Δίκτυο «GUNET», το Οικονομικό Πανεπιστήμιο Αθηνών (Ο.Π.Α.), η Ελληνική Εταιρεία Επιστημόνων &amp;amp; Επαγγελματιών Πληροφορικής &amp;amp; Επικοινωνιών (Ε.Π.Υ.), το ΕΚΕΦΕ «Δημόκριτος», το Τεχνολογικό Εκπαιδευτικό Ίδρυμα Αθήνας (Α.Τ.Ε.Ι. ΑΘΗΝΑΣ), τo Πανεπιστήμιο&lt;br/&gt;Αιγαίου, το Πανεπιστήμιο Μακεδονίας (Π.Μ.), το Αριστοτέλειο Πανεπιστήμιο Θεσσαλονίκης (Α.Π.Θ.), το Ανώτατο Τεχνολογικό Εκπαιδευτικό Ίδρυμα Καβάλας (Α.Τ.Ε.Ι. ΚΑΒΑΛΑΣ), το Τεχνολογικό Εκπαιδευτικό Ίδρυμα Λάρισας (Α.Τ.Ε.Ι. ΛΑΡΙΣΑΣ), το Πανεπιστήμιο Πατρών (Π.Π.), το Ερευνητικό Ακαδημαϊκό Ινστιτούτο Τεχνολογίας Υπολογιστών (Ε.Α.I.T.Y.), το Πανεπιστήμιο Πελοποννήσου, το Ανώτατο Τεχνολογικό Εκπαιδευτικό Ίδρυμα Καλαμάτας (Α.Τ.Ε.Ι. ΚΑΛΑΜΑΤΑΣ), το Πανεπιστήμιο Κρήτης (Π.Κ) και το Πολυτεχνείο Κρήτης.&lt;/p&gt;&lt;p&gt;Το Διοικητικό Συμβούλιο της ΕΕΛ/ΛΑΚ&lt;br/&gt;κ. Θεόδωρος Καρούνος, Εκπρόσωπος ΕΜΠ, Πρόεδρος&lt;br/&gt;κ. Νεκτάριος Κοζύρης, Εκπρόσωπος ΕΔΕΤ ΑΕ, Αντιπρόεδρος&lt;br/&gt;κ. Αλέξιος Ζάβρας, Στέλεχος της κοινότητας ΕΛ/ΛΑΚ&lt;br/&gt;κ. Κωνσταντίνος Μαργαρίτης, Εκπρόσωπος Πανεπιστημίου Μακεδονίας&lt;br/&gt;κ. Χρήστος Μπούρας, Εκπρόσωπος Πανεπιστημίου Πατρών&lt;br/&gt;κ. Διομήδης Σπινέλλης, Εκπρόσωπος Οικονομικού Πανεπιστημίου Αθηνών&lt;br/&gt;κ. Αύγουστος Τσινάκος, Εκπρόσωπος ΑΤΕΙ Καβάλας&lt;br/&gt;Επικοινωνία: info@ellak.gr, www.ellak.gr ,&lt;br/&gt;Τηλέφωνο: 210-7474-279&lt;/p&gt;&lt;/div&gt;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=59b2fe05-40fe-8943-bb79-a3d8ea3c89d2' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-8672027183273978817?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/8672027183273978817/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=8672027183273978817' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/8672027183273978817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/8672027183273978817'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2011/02/blog-post.html' title='ΕΕΛ/ΛΑΚ - Εταιρεία Ελεύθερου Λογισμικού /Λογισμικού Ανοικτού Κώδικα'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-5965865968697486925</id><published>2009-11-17T11:11:00.000-08:00</published><updated>2010-03-15T15:59:12.429-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='conference'/><category scheme='http://www.blogger.com/atom/ns#' term='parleys'/><category scheme='http://www.blogger.com/atom/ns#' term='javapolis'/><category scheme='http://www.blogger.com/atom/ns#' term='Devoxx'/><title type='text'>DEVOXX 09</title><content type='html'>Two whole years have passed, since Javapolis 2007. I decided to attend Javapolis, now called Devoxx, again, with the same excitement as before. And since a (female) Java developer friend complained that I didn't update my blog about it, I decided to do so.&lt;br /&gt;&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;Even in the middle of the financial crisis, something like 2500 people attended this year's event, which took place from 16th-20th of November. The kiosks where less and less rich than from what I remember two years ago. However, the excitement was still the same, maybe higher!&lt;br /&gt;Only one other Greek guy came for the whole event, &lt;a target="_blank" href="http://javapapo.blogspot.com/"&gt;Paris Apostolopoulos&lt;/a&gt;, the founder of &lt;a target="_blank" href="http://www.jhug.gr/"&gt;JHUG&lt;/a&gt;. &lt;a target="_blank" href="http://dandreadis.blogspot.com/"&gt;Dimitris Andreadis&lt;/a&gt;, now project manager or something at &lt;a target="_blank" href="http://jboss.org/"&gt;jboss&lt;/a&gt;, joined in the 3rd day. So, only 3 Greek guys this time, very few compared to the around 7 that were back in 2007.&lt;br /&gt;&lt;br /&gt;Well, let's get started. I focus mainly on technology in this blog, putting down what I managed to note during the presentations. You may find the conference schedule in &lt;a href="http://devoxx.be/schedule"&gt;http://devoxx.be/display/DV09/Schedule.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;big&gt;&lt;big&gt;&lt;b&gt;Day 1 - University Day 1&lt;/b&gt;&lt;/big&gt;&lt;/big&gt;&lt;br /&gt;&lt;br /&gt;Unfortunately, I didn't keep many notes the first day. I started with &lt;a href="http://devoxx.be/display/DV09/Introduction+to+Java+Generics" title="Introduction to Java Generics"&gt;Introduction to Java Generics&lt;/a&gt; by &lt;a href="http://devoxx.be/display/DV09/Eric+Steegmans" title="Eric Steegmans"&gt;Prof. Eric Steegmans&lt;/a&gt; of university of Leuven. Well, I had some questions about generics, which I hoped this session would help to clarify, which it did. Even though it was introductory in nature, it turned out to be quite fruitful. I put down few notes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Since, due to backwards compatibility, every generic type is translated to an &lt;span style="font-family:Courier New;"&gt;Object&lt;/span&gt;, and since we cannot instantiate a generic type, it makes sense to write something like: &lt;span style="font-family:Courier New;"&gt;this.elements = (E[]) new Object[Math.abs(capacity)];&lt;/span&gt;&lt;/li&gt;&lt;li&gt;We can always attempt to return a wrong type&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:Courier New;"&gt;T t = (T) new Date();&lt;br /&gt;T f() {return (T) new Date(); }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:sans-serif;"&gt;     &lt;/span&gt;Eric also demonstrated how we can use Generics to create whole frameworks, and he demonstrated an implementation of the Composite pattern using Generics.&lt;br /&gt;&lt;br /&gt;After lunch, I attended &lt;a href="http://devoxx.be/display/DV09/JSF+2+and+beyond" title="JSF 2 and beyond"&gt;JSF 2: Keep the progress coming&lt;/a&gt; by &lt;a href="http://devoxx.be/display/DV09/Dan+Allen" title="Dan Allen"&gt;Dan Allen&lt;/a&gt;, &lt;a href="http://devoxx.be/display/DV09/Peter+Muir" title="Peter Muir"&gt;Peter Muir&lt;/a&gt; and &lt;a href="http://devoxx.be/display/DV09/Andy+Schwartz" title="Andy Schwartz"&gt;Andy Schwartz&lt;/a&gt; . A lot of new features where presented, but unfortunately I didn't keep many notes. I remember however one useful feature:&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;javax.faces.VALIDATE_EMPTY_FIELDS = true&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;in the &lt;span style="font-family:Courier New;"&gt;web.xml&lt;/span&gt; which checks for empty fields. You may start a jcp.org account and of course check javaserverfaces.org for JSF2.next.&lt;br /&gt;&lt;br /&gt;I then attended &lt;a href="http://devoxx.be/display/DV09/Easing+JPA+data+access+with+Hades" title="Easing JPA data access with Hades"&gt;Easing JPA data access with Hades&lt;/a&gt; by &lt;a href="http://devoxx.be/display/DV09/Easing+JPA+data+access+with+Hades" title="Easing JPA data access with Hades"&gt;Oliver Gierke&lt;/a&gt; , which has some useful additions. Please check the &lt;a href="http://devoxx.be/display/DV09/Uni+Day+1" target="_blank"&gt;http://hades.synyx.org&lt;/a&gt; web site.&lt;br /&gt;&lt;br /&gt;Finally, &lt;a href="http://devoxx.be/display/DV09/Spock+-+the+smarter+testing+and+specification+framework" title="Spock - the smarter testing and specification framework"&gt;Spock - the smarter testing and specification framework&lt;/a&gt; by &lt;a href="http://devoxx.be/display/DV09/Spock+-+the+smarter+testing+and+specification+framework" title="Spock - the smarter testing and specification framework"&gt;Peter Niederwieser&lt;/a&gt; is a testing framework based on Groovy, that has a common syntax to run both junits and mock objects. &lt;a href="http://devoxx.be/display/DV09/The+Next+Generation+Profiling+and+Diagnostics+Tools" title="The Next Generation Profiling and Diagnostics Tools"&gt;The Next Generation Profiling and Diagnostics Tools&lt;/a&gt; by &lt;a href="http://devoxx.be/display/DV09/The+Next+Generation+Profiling+and+Diagnostics+Tools" title="The Next Generation Profiling and Diagnostics Tools"&gt;Noora Peura&lt;/a&gt; and &lt;a href="http://devoxx.be/display/DV09/The+Next+Generation+Profiling+and+Diagnostics+Tools" title="The Next Generation Profiling and Diagnostics Tools"&gt;Anders Astrand&lt;/a&gt; has been &lt;a href="http://www.oracle.com/technology/products/jrockit/index.html" target="_blank"&gt;JRockit&lt;/a&gt;. This is actually a JVM which allows you to profile your application.&lt;br /&gt;&lt;br /&gt;&lt;big&gt;&lt;big&gt;&lt;b&gt;Day 2 - University Day 2&lt;/b&gt;&lt;/big&gt;&lt;/big&gt;&lt;br /&gt;&lt;br /&gt;The kiosks and stands were in place. Around for collecting any goodies like pens, T-shirts etc. Less participants than other times. A good collection of books at Amazon prices.&lt;br /&gt;The second day started with the presentation of &lt;a href="http://devoxx.be/display/DV09/The+Java+EE+6++Platform" title="The Java EE 6  Platform"&gt;The Java EE 6  Platform&lt;/a&gt; by &lt;a href="http://devoxx.be/display/DV09/Antonio+Goncalves" title="Antonio Goncalves"&gt;Antonio Goncalves&lt;/a&gt; and &lt;a href="http://devoxx.be/display/DV09/Alexis+Moussine-Pouchkine" title="Alexis Moussine-Pouchkine"&gt;Alexis Moussine-Pouchkine&lt;/a&gt;. These two amazing guys presented all the new specification that will be part of JEE 6:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;JPA 2.0&lt;/b&gt;: pessimistic locking, caching, Criteria API as an alternative to SQL queries and JPQL and type safety&lt;/li&gt;&lt;li&gt;&lt;b&gt;Servlet 3.0&lt;/b&gt;: plugability, asynchronous support, FileUpload (finally!!!), no need for web.xml (@WebServlet annotation); it will be supported by Glassfish 3, Tomcat 7, JBoss 6, Jetty 8&lt;/li&gt;&lt;li&gt;&lt;b&gt;Managed Beans 1.0, EJB 3.1 &amp;amp; 3.1 lite&lt;/b&gt;: Everything is managed beans. E.g. EJB is a managed bean with transactional support, security and multithreading; RESTful service is a managed bean with HTTP support. EJB lite allows EJBs to be deployed to &lt;span style="font-family:Courier New;"&gt;.war&lt;/span&gt; files (no need for &lt;span style="font-family:Courier New;"&gt;.ear&lt;/span&gt; files). EJB 3.1 lite spec contains local session beans, security, interceptors, CMT/BMT and injection; but not CMP, MDBs, JMS, RMI/IIOP etc. It also adds an embeddable EJB container (e.g. for testing), Singleton components with concurrency management per application per JVM, optional remote interfaces, asynchronous calls (no threads allowed) etc.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;JAX-RS 1.1 &lt;/b&gt;adds support for RESTful web services and integrates with EJBs. Simply annotate a stateless EJB with (some of) the following annotations to make it a service (everything is transactional): &lt;span style="font-family:Courier New;"&gt;@Path("/path") @GET @Produces("text/html") @POST @Consumes("text/xml")&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;JSF 2.0&lt;/b&gt; does not require Servlet 3.0. Facelets has become the alternative to JSPs View Description Language or VDL. &lt;span style="font-family:Courier New;"&gt;faces-config.xml&lt;/span&gt; is also optional (like &lt;span style="font-family:Courier New;"&gt;web.xml&lt;/span&gt;); navigation now belongs to the page, e.g. &lt;span style="font-family:Courier New;"&gt;return "targetPage.xhtml";&lt;/span&gt; Component creation is easy; single .xhtml files with JSF tags and no Java code. Error reporting and stack trace has been improved and looks like ASPX .NET's. For the first time there is official Javascript support via &lt;span style="font-family:Courier New;"&gt;jsf.js&lt;/span&gt;; e.g.&lt;span style="font-family:Courier New;"&gt; jsf.ajax.request &lt;/span&gt;and &lt;span style="font-family:Courier New;"&gt;f:ajax&lt;/span&gt; tags. Other features introduced are new scopes, templates (layouts), project stages (e.g. dev, test, production) etc.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Bean Validation 1.0 &lt;/b&gt;introduces the rule constraint once, validate anywhere. Declarative validation is done with the annotations &lt;span style="font-family:Courier New;"&gt;@NotNull @Valid @Size&lt;/span&gt; etc.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Profiles&lt;/b&gt; to simplify the spec; currently, only one profile, &lt;i&gt;Web Profile&lt;/i&gt; is supported (no EJBs, no JMS etc.)&lt;/li&gt;&lt;li&gt;Standard (portable) JNDI names across application servers&lt;/li&gt;&lt;li&gt;&lt;b&gt;Interceptors 1.1 &lt;/b&gt;now separated from EJB spec&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;@Inject&lt;/b&gt; tag for dependency injection &lt;/li&gt;&lt;li&gt;&lt;b&gt;JCDI 1.0&lt;/b&gt; which allows developers to bind Java EE components to lifecycle contexts, to inject these components, and to enable them to support loosely coupled communication&lt;/li&gt;&lt;/ul&gt;&lt;i&gt;Recommended book&lt;/i&gt;: "&lt;a target="_blank" href="http://www.apress.com/book/view/1430219548"&gt;Beginning Java™ EE 6 Platform with GlassFish™ 3: From Novice to Professional&lt;/a&gt;" of Antonio Goncalves.&lt;br /&gt;&lt;br /&gt;From the server side to the client side, &lt;a href="http://devoxx.be/display/DV09/The+JavaFX+Platform+-+A+Java+Developer%27s+Guide" title="The JavaFX Platform - A Java Developer's Guide"&gt;The JavaFX Platform - A Java Developer's Guide&lt;/a&gt; by &lt;a href="http://devoxx.be/display/DV09/Stephen+Chin" title="Stephen Chin"&gt;Stephen Chin&lt;/a&gt;. JavaFX is the new way for building rich clients, or GUIs. It is a replacement (?) of Swing. It is the future, as Sun claims.&lt;br /&gt;Example code:&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;Stage {&lt;br /&gt;scene: Scene {&lt;br /&gt;content: []&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;Stage&lt;/span&gt; is the equivalent to Swing's &lt;span style="font-family:Courier New;"&gt;Window/JFrame&lt;/span&gt;. Inspired from 3D graphics I suppose, you then define a &lt;span style="font-family:Courier New;"&gt;scene&lt;/span&gt;, which represents the scene graph of the components to be added, and then the content where you add the components. &lt;span style="font-family:Courier New;"&gt;scene:Scene&lt;/span&gt; &amp;lt;=&amp;gt; &lt;span style="font-family:Courier New;"&gt;Scene scene = new Scene();&lt;/span&gt;&lt;br /&gt;JavaFX has support for closures, new layouts (HBox, VBox, Tile, MigLayout etc.), binds (the equivalent to Swing events), sequences, animations (e.g transitions) and type inferencing. It doesn't support annotations, generics and multi threads. It is a strongly typed language like Java. Examples of:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;binds (regular/lazy): &lt;span style="font-family:Courier New;"&gt;var x = bind a + b;&lt;/span&gt; whenever a or b change, x changes as well&lt;/li&gt;&lt;li&gt;sequences: &lt;span style="font-family:Courier New;"&gt;[1 .. 3]   means 1 2 3&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;[1 .. &amp;lt;4] means 1 2 3&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;[1..3 step 2] means 1 3&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;var ints = [1 4 4 6 5]&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;ints [k | k&amp;gt;4] returns 6 5&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;insert -1 into ints[2]&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;delete 4 from ints returns [1 6 5] &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;&lt;span style="font-family:sans-serif;"&gt;Support for stylesheets (.css)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; Try &lt;a target="_blank" href="http://www.reportmill.com/jfx/"&gt;JfxBuilder&lt;/a&gt; and &lt;a target="_blank" href="http://www.ohloh.net/p/fxbuilder"&gt;FxBuilder&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;JavaFX for Mobile applications currently supports only the common profile and runs on Windows ME platforms.&lt;br /&gt;&lt;i&gt;&lt;br /&gt;Recommended book&lt;/i&gt;: "&lt;a target="_blank" href="http://www.apress.com/book/view/1430218754"&gt;Pro JavaFX Platform&lt;/a&gt;" by James Weaver et al.&lt;br /&gt;&lt;i&gt;Recommended sites:&lt;/i&gt; &lt;a target="_blank" href="http://javafx.com/"&gt;http://javafx.com&lt;/a&gt;, &lt;a target="_blank" href="http://jfxtras.org/"&gt;http://jfxtras.org&lt;/a&gt;, &lt;a target="_blank" href="http://learnjavafx.typepad.com/"&gt;http://learnjavafx.typepad.com&lt;/a&gt;, &lt;a target="_blank" href="http://steveonjava.com/"&gt;http://steveonjava.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a title="A Year of Monitoring with Java-monitor" href="http://devoxx.be/display/DV09/A+Year+of+Monitoring+with+Java-monitor"&gt;A Year of Monitoring with Java-monitor&lt;/a&gt; by &lt;a title="A Year of Monitoring with Java-monitor" href="http://devoxx.be/display/DV09/A+Year+of+Monitoring+with+Java-monitor"&gt;Kees Jan Koster&lt;/a&gt; got us into the workings of the garbage collector, or garbage collectors. In case you didn't know, there are two garbage collectors in Java: the Scavenger who is faster but doesn't do such a good job, and the MarkSweeper who is slower, but cleans everything! He gave examples of memory leaks, like e.g. how file descriptors in Linux (1024) can easily been allocated (FreeBSD has some 10000 fds, Solaris?), so man &lt;span style="font-family:Courier New;"&gt;ulimit&lt;/span&gt; and &lt;span style="font-family:Courier New;"&gt;limits&lt;/span&gt; commands to see how to increase the number of file descriptors in your system.&lt;br /&gt;-Xss limits thread stacks. Don't use System.gc() inside an application server e.g. Tomcat; it affects &lt;i&gt;all&lt;/i&gt; deployed applications. Use the server version of jdk, i.e. &lt;span style="font-family:Courier New;"&gt;java -server&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Recommended sites:&lt;/i&gt; &lt;a target="_blank" href="http://www.java-monitor.com/"&gt;http://www.java-monitor.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In &lt;a href="http://devoxx.be/display/DV09/Scala+Actors" title="Scala Actors"&gt;Scala Actors: A Tool to Harness the Power of Multicore CPUs on the JVM&lt;/a&gt;, &lt;a href="http://devoxx.be/display/DV09/Scala+Actors" title="Scala Actors"&gt;Frank Sommers&lt;/a&gt; presented Scala actors who communicate via immutable messages. Actors are executed in threads in a thread pool. You can write your own actor by extending &lt;span style="font-family:Courier New;"&gt;scala.actors.Actor&lt;/span&gt;. Messages are defined with case classes. The framework allows pattern matching and remote actors.&lt;br /&gt;&lt;i&gt;&lt;br /&gt;Recommended book&lt;/i&gt;: "&lt;a target="_blank" href="http://www.artima.com/shop/programming_in_scala"&gt;Programming in Scala&lt;/a&gt;" &lt;span class="as"&gt;by Martin Odersky, Lex Spoon, and Bill Venners&lt;/span&gt;&lt;br /&gt;&lt;i&gt;Recommended site:&lt;/i&gt; &lt;a target="_blank" href="http://www.artima.com/"&gt;http://www.artima.com&lt;/a&gt;&lt;br /&gt;&lt;big&gt;&lt;big&gt;&lt;b&gt;&lt;br /&gt;Day 3 - Conference Day 1&lt;/b&gt;&lt;/big&gt;&lt;/big&gt;&lt;br /&gt;&lt;br /&gt;Devoxx's first conference day started with lots and lots of people, joining just for the conference. And with the traditional key note of the guy who started all this, Stephan Janssen. He was happy that participants reached once again 2500. The presentations will be available for free in &lt;a href="http://parleys.com/"&gt;parleys.com&lt;/a&gt; from January 2010.&lt;br /&gt;&lt;br /&gt;&lt;a title="Steven Harris" href="http://devoxx.be/display/DV09/Steven+Harris"&gt;Steven Harris&lt;/a&gt; from Oracle talked about &lt;a title="Java, the Platform for the Future" href="http://devoxx.be/display/DV09/Java%2C+the+Platform+for+the+Future"&gt;Java, the Platform for the Future.&lt;/a&gt; He spoke about WebLogic's Dynamic module which uses profiles to capture collections of OSGi bundles and about virtualisation. He created a VMWare instance, by using Oracle Assembly Builder Studio, that ran just a java application.&lt;br /&gt;&lt;br /&gt;The next key speakers  &lt;a title="Roberto Chinnici" href="http://devoxx.be/display/DV09/Roberto+Chinnici"&gt;Roberto Chinnici&lt;/a&gt; and &lt;a title="Ludovic Champenois" href="http://devoxx.be/display/DV09/Ludovic+Champenois"&gt;Ludovic Champenois&lt;/a&gt; presented &lt;a title="Java EE 6 and GlassFish V3" href="http://devoxx.be/display/DV09/Java+EE+6+and+GlassFish+V3"&gt;Java EE 6 and GlassFish V3: Evolution of a Platform.&lt;/a&gt; The good news are that Java EE 6 together with Glassfish v3 and Netbeans 6.8 will all be released on 10th December 2009! I already spoke about the new features of the new JEE 6 platforms above, but here some additional things:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:Courier New;"&gt;@Email String email; &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:sans-serif;"&gt;Modular web applications&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:sans-serif;"&gt;EJB Container now works in Java SE too&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:sans-serif;"&gt;&lt;span style="font-family:Courier New;"&gt;@Singleton&lt;/span&gt;, &lt;span style="font-family:Courier New;"&gt;@Startup &lt;/span&gt;beans, &lt;span style="font-family:Courier New;"&gt;@asynchronous&lt;/span&gt; invocations&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:sans-serif;"&gt;JSF 2.0 features: standardized facelets, composite components, autodiscovery of components, javascript API (jsf.js) for AJAX support&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:sans-serif;"&gt;A POJO is turned into an EJB 3.1 by adding the &lt;span style="font-family:Courier New;"&gt;@Stateless&lt;/span&gt; annotation to it.&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;Then &lt;a href="http://devoxx.be/display/DV09/Christophe+Coenraets" title="Christophe Coenraets"&gt;Christophe Coenraets&lt;/a&gt; from Adobe took over with his impressive &lt;a href="http://devoxx.be/display/DV09/Integrating+designers+into+your+application+development" title="Integrating designers into your application development"&gt;Integrating designers into your application development&lt;/a&gt; presentation. Adobe Flash 10.1 targets smartphones and flash applications now run exactly the same in the smartphone as in the desktop. AIR 2.0 now allows accessing native applications. Finally, he gave an impressive presentation of Adobe Flash Catalyst, a tool which allows a developer to transform a .psp image created by the web designer to the GUI of a web application!&lt;br /&gt;&lt;br /&gt;After the lunch break, I chose to attend &lt;a href="http://devoxx.be/display/DV09/JDK7+Update" title="JDK7 Update"&gt;JDK7 Update&lt;/a&gt; by &lt;a href="http://devoxx.be/display/DV09/Mark+Reinhold" title="Mark Reinhold"&gt;Mark Reinhold&lt;/a&gt;. Mark showed what we should expect from JDK 7. JDK 7 will be modular, multi-lingual (Java, JRuby, Jython etc.), productive and performant. As the size of the JRE is around 13 Mb, Java is currently refactored into modules; there will be a base module and other modules which will depend on this base module, like awt module, swing, sound, tools, corba etc. modules. Modules may eventually replace jar files. The user will download just the modules s/he needs.&lt;br /&gt;JDK 7 introduces the diamond (&amp;lt;&amp;gt;) operator: &lt;span style="font-family:Courier New;"&gt;Map&amp;lt;String, String&amp;gt; map = new HashMap&lt;b&gt;&amp;lt;&amp;gt;&lt;/b&gt;();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:sans-serif;"&gt;Some other new syntax has been inspired from Ruby, e.g.: &lt;span style="font-family:Courier New;"&gt;long l = 322_123_888L;&lt;/span&gt;&lt;/span&gt; New binary representation: &lt;span style="font-family:Courier New;"&gt;0b1001&lt;/span&gt;. The &lt;span style="font-family:Courier New;"&gt;[]&lt;/span&gt; operator is not privileged by arrays only:&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;List&amp;lt;String&amp;gt; list = ["1","4","5"];&lt;br /&gt;list[2] = "6";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;JDK 7 will have limited closure support and additional multi-threading goodies (&lt;span style="font-family:Courier New;"&gt;invokeAll&lt;/span&gt;). Static methods can be declared in interfaces. An example of a closure:&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;#int (int, int) multiplier = #(int x, int y) { x*y }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Recommended site:&lt;/i&gt; &lt;a target="_blank" href="http://www.artima.com/"&gt;http://openjdk.java.net/project/jdk7.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_rfX28kGqbFM/Swhe2Vz8IaI/AAAAAAAAAGI/2vtanrOCEzM/s1600/IMAGE_014.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_rfX28kGqbFM/Swhe2Vz8IaI/AAAAAAAAAGI/2vtanrOCEzM/s320/IMAGE_014.jpg" alt="" id="BLOGGER_PHOTO_ID_5406675640319222178" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;After the lunch break, I decided not to attend James Gosling's talk, but &lt;a href="http://devoxx.be/display/DV09/HTML+5+Communications+-+The+New+Network+Framework+for+the+Web" title="HTML 5 Communications - The New Network Framework for the Web"&gt;HTML 5 Communications - The New Network Framework for the Web&lt;/a&gt; by &lt;a href="http://devoxx.be/display/DV09/Frank+Greco" title="Frank Greco"&gt;Frank Greco&lt;/a&gt; instead and it proved to be a rewarding choice! HTML 5 will bring Web 3.0 in our lives. Web 1.0 served only static pages; Web 2.0 is dynamic, with the advances of Ajax and RIA applications; Web 3.0, however, will be a Read/Write Web, event-driven, secure, reliable and will support real-time communications with no latency.&lt;br /&gt;&lt;br /&gt;W3C and IETF, who work together on HTML 5, have decided to get rid of HTTP altogether; HTTP is half-duplex protocol. A new protocol WS (and its equivalent WSS, i.e. secure) will be introduced in Web 3.0, where WS stands for Web Sockets, i.e. we will be able to write ws://www.foo.com!&lt;br /&gt;&lt;br /&gt;The new spec will contain the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;TCP bi-directional Web Sockets&lt;/li&gt;&lt;li&gt;Standardised HTTP Streaming which means that browsers will support mashups (this is a standardisation of Comet for server sent events)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Secure cross-site remote connectivity&lt;/li&gt;&lt;li&gt;Secure browser cross-document messaging&lt;/li&gt;&lt;/ul&gt;The Web Sockets API is already available for &lt;a href="http://www.w3.org/TR/2009/WD-websockets-20091029/"&gt;download&lt;/a&gt; and Frank presented a demo of real-time stock option available by &lt;a href="http://www.kaazing.com/"&gt;Kaazing&lt;/a&gt;. In short, Web 3.0 will be:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;highly scalable&lt;/li&gt;&lt;li&gt;backwards compliant&lt;/li&gt;&lt;li&gt;extensible with new protocols, security etc.&lt;/li&gt;&lt;li&gt;performant, and&lt;br /&gt;&lt;/li&gt;&lt;li&gt;compliant with open standards&lt;/li&gt;&lt;/ul&gt;jBPM is a framework I always wanted to use, but never had a chance. So, whenever I find the opportunity, I try to go and listen to what &lt;a href="http://devoxx.be/display/DV09/Tom+Baeyens" title="Tom Baeyens"&gt;Tom Baeyens&lt;/a&gt; has to say about it. &lt;a href="http://devoxx.be/display/DV09/jBPM4+in+Action" title="jBPM4 in Action"&gt;jBPM4 in Action&lt;/a&gt; is a total refactoring of the previous version.&lt;br /&gt;&lt;br /&gt;Business Process is defined as a way of doing things with a certain goal. jBPM has a transactional state machine, a generic graph execution engine and a process VM. In version 4 there is:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;new API with new query mechanism&lt;/li&gt;&lt;li&gt;native spring integration&lt;/li&gt;&lt;li&gt;compact DB schema&lt;/li&gt;&lt;li&gt;GWT web console&lt;/li&gt;&lt;li&gt;Signavio web modelling&lt;/li&gt;&lt;li&gt;BPMN2 jPDL (process language) that supports concurrency and asynchronous continuations&lt;/li&gt;&lt;li&gt;task forms for rapid prototyping&lt;/li&gt;&lt;li&gt;eclipse plugin (eclipse process designer)&lt;/li&gt;&lt;/ul&gt;&lt;i&gt;Recommended sites:&lt;/i&gt; &lt;a target="_blank" href="http://www.jbpm.org/"&gt;http://www.jbpm.org,&lt;/a&gt; &lt;a target="_blank" href="http://www.jorambarrez.be/"&gt;http://www.jorambarrez.be&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Being curious of Comet, I decided to go for &lt;a href="http://devoxx.be/display/DV09/Writing+Asynchronous+Web+application+%28Comet%29+using+the+Atmosphere+Framework" title="Writing Asynchronous Web application (Comet) using the Atmosphere Framework"&gt;Writing Asynchronous Web application (Comet) using the Atmosphere Framework &lt;/a&gt;by &lt;a href="http://devoxx.be/display/DV09/Jean-Francois+Arcand" title="Jean-Francois Arcand"&gt;Jean-Francois Arcand&lt;/a&gt; and &lt;a href="http://devoxx.be/display/DV09/Paul+Sandoz" title="Paul Sandoz"&gt;Paul Sandoz. &lt;/a&gt;&lt;br /&gt;The guys compared polling, Ajax push and HTTP streaming. Atmosphere is based on RESTful web services, i.e. with JAX-RS. No vendor lock, works with all application servers, runs on top of any Servlet 2.3/3.0 compliant servlet container. REST + Jersey = Atmosphere plus a number of tags: @Suspend, @Resume, @Broadcast, @Schedule, @Cluster. Features:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;cookie based transactions&lt;/li&gt;&lt;li&gt;web socket support&lt;/li&gt;&lt;li&gt;persistence support&lt;/li&gt;&lt;li&gt;adaptive event aggregator&lt;/li&gt;&lt;/ul&gt;&lt;i&gt;Recommended sites:&lt;/i&gt;&lt;a href="http://atmosphere.dev.java.net/"&gt; &lt;/a&gt;&lt;a href="http://atmosphere.dev.java.net/"&gt;http://atmosphere.dev.java.net&lt;/a&gt;, &lt;a target="_blank" href="http://jersey.dev.java.net/"&gt;http://jersey.dev.java.net&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The day finished with &lt;a href="http://devoxx.be/display/DV09/Project+Coin" title="Project Coin"&gt;Project Coin&lt;/a&gt; by &lt;a href="http://devoxx.be/display/DV09/Joseph+D.+Darcy" title="Joseph D. Darcy"&gt;Joseph D. Darcy&lt;/a&gt; and the new additions to Java 7. So, there will be the possibility to write:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;String s;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;switch (s) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   case "one" : &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;variable names will contain any character&lt;/li&gt;&lt;li&gt;automatic resource management, e.g.&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:courier new;"&gt;try (FileInputStream is, FileOutputStream os) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;i.e. there will be no catch statement and resources will be released automatically.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;simplified varargs method invocation&lt;/li&gt;&lt;li&gt;collections will now use [], e.g.  &lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:courier new;"&gt;List&lt;integer&gt; l = new LinkedList&lt;&gt;();&lt;/integer&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;l[0] = 6;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;New elvis operator (from Groovy): &lt;span style="font-family:courier new;"&gt;a ?: b    &lt;=&gt;  if (a!=null) a else b&lt;/span&gt;&lt;/li&gt;&lt;li style="font-family: georgia;"&gt;JSR 292 support&lt;/li&gt;&lt;li style="font-family: georgia;"&gt;EnumSet, EnumMap&lt;/li&gt;&lt;li style="font-family: georgia;"&gt;reification&lt;/li&gt;&lt;li style="font-family: georgia;"&gt;multiple exceptions support&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family:courier new;"&gt;try {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; ...&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;} catch (final Exception1 ex | Exception2 ex) {&lt;br /&gt;throw ex;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;The day finishes with a beer call and free chips.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;big&gt;&lt;big&gt;&lt;b&gt;Day 4 - Conference Day 2&lt;/b&gt;&lt;/big&gt;&lt;/big&gt;&lt;br /&gt;&lt;br /&gt;Day 4 starts very interestingly too, with &lt;a href="http://devoxx.be/display/DV09/Ivar+Jacobson" title="Ivar Jacobson"&gt;Ivar Jacobson&lt;/a&gt; and &lt;a href="http://devoxx.be/display/DV09/Do+we+really+know+how+to+develop+software" title="Do we really know how to develop software"&gt;Do we really know how to develop software? &lt;/a&gt;For those who didn't know, Ivar is one of the three amigos behind UML.&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_rfX28kGqbFM/SwheXgnPa1I/AAAAAAAAAGA/l-FvyX_umfI/s1600/IMAGE_015.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_rfX28kGqbFM/SwheXgnPa1I/AAAAAAAAAGA/l-FvyX_umfI/s320/IMAGE_015.jpg" alt="" id="BLOGGER_PHOTO_ID_5406675110642805586" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;Ivar spoke about people who don't know about software and try to make money out of it. He also addressed the issue that academic research must be aligned with industry practice.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_rfX28kGqbFM/Swhe-WVr0NI/AAAAAAAAAGQ/sgDgiumbPvA/s1600/IMAGE_016.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_rfX28kGqbFM/Swhe-WVr0NI/AAAAAAAAAGQ/sgDgiumbPvA/s320/IMAGE_016.jpg" alt="" id="BLOGGER_PHOTO_ID_5406675777899712722" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;There are currently thousands of methods and methodologies which simply reinvent the wheel over and over again. We don't know what others are doing. We need a theoretical basis to develop software!!! One that aligns academic research with industry practice.&lt;br /&gt;He has started a Software Engineering Method And Theory (SEMAT) which can be found in &lt;a href="http://www.semat.org/"&gt;http://www.semat.org&lt;/a&gt;. In this work, he defines a &lt;span style="font-style: italic;"&gt;kernel&lt;/span&gt; to be an empty process which defines a common basis to start with. The kernel ensures common understanding across all teams. The kernel is surrounded by &lt;span style="font-style: italic;"&gt;practices  &lt;/span&gt;which define the various practices specific to the kernel.&lt;br /&gt;He asks to give him our thoughts about this theory by sending an email to &lt;a href="mailto:a_theory@ivarjacobson.com"&gt;a_theory@ivarjacobson.com&lt;/a&gt;. He doesn't know if he will succeed or not, but he finished his presentation with a saying of Kurt Lewin: "There is nothing as practical as a good theory".&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_rfX28kGqbFM/Sxoz1nWCZhI/AAAAAAAAAGY/LYgVIG28uCE/s1600-h/IMAGE_017.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://1.bp.blogspot.com/_rfX28kGqbFM/Sxoz1nWCZhI/AAAAAAAAAGY/LYgVIG28uCE/s320/IMAGE_017.jpg" alt="" id="BLOGGER_PHOTO_ID_5411694898426570258" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;And the day continues with &lt;a href="http://devoxx.be/display/DV09/Robert+C.+Martin" title="Robert C. Martin"&gt;Robert C. Martin&lt;/a&gt; or uncle Bob and &lt;a href="http://devoxx.be/display/DV09/Filling+The+Professionalism+Gap" title="Filling The Professionalism Gap"&gt;Filling The Professionalism Gap: Craftsmanship and Policy&lt;/a&gt;. Eccentric uncle Bob, author of books like "UML for Java Programmers" and "Clean Code" starts walking up and down the scene describing the story of his career. He started his career in the late 70s, when at the age of 18 he was hired along with 2 other teenagers to migrate a program to a new system for which they even had to write the operating system for! He went on describing the 80s, the 90s and our decade and he always ended up to the same conclusion between management and developers: "They hated us; we hated them"!!!!! He dared to say a great truth, that we, developers, do &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; have a defined profession yet! The difference between professionalism and craftmanship is that a professional is proud of what s/he does, and is able to do a good job. What prevents us from doing a good job? The managers? He advises that we should learn to say &lt;span style="font-weight: bold;"&gt;no&lt;/span&gt;! We are being viewed as blue colar workers (with a hourly rate). Do doctors and lawyers charge per hour?&lt;br /&gt;There is also a temptation for developers to become managers (management &lt;span style="font-style: italic;"&gt;is&lt;/span&gt; a profession by the way).&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_rfX28kGqbFM/Sxoz9ECrz0I/AAAAAAAAAGg/EcZwM_Iuy8g/s1600-h/IMAGE_018.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_rfX28kGqbFM/Sxoz9ECrz0I/AAAAAAAAAGg/EcZwM_Iuy8g/s320/IMAGE_018.jpg" alt="" id="BLOGGER_PHOTO_ID_5411695026389110594" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;There is a &lt;a href="http://manifesto.softwarecraftsmanship.org/"&gt;manifesto of software craftmanship&lt;/a&gt;, which came out of the agile manifesto.&lt;br /&gt;So, how can a software developer behave like a professional?&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Do no harm (say no when managers say they want it tommorrow)&lt;/li&gt;&lt;li&gt;Write clean code by using TDD with 100% test coverage (it is not professional to not know if your code works)! QA is a specification not a verification.&lt;/li&gt;&lt;li&gt;Work team-based, not project-based and keep the team together! Do not change teams depending on projects; all projects should be assigned to the same team.&lt;/li&gt;&lt;/ol&gt;&lt;i&gt;Recommended book&lt;/i&gt;: "&lt;span style="text-decoration: underline;"&gt;Clean Code&lt;/span&gt;" &lt;span class="as"&gt;by Robert C. Martin.&lt;/span&gt;&lt;br /&gt;&lt;i&gt;Recommended site:&lt;/i&gt; &lt;a target="_blank" href="http://www.objectmentor.com/"&gt;http://www.objectmentor.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After such a morning, I continued with &lt;a href="http://devoxx.be/display/DV09/Spring+Framework+3.0" title="Spring Framework 3.0"&gt;Spring Framework 3.0&lt;/a&gt; by &lt;a href="http://devoxx.be/display/DV09/Arjen+Poutsma" title="Arjen Poutsma"&gt;Arjen Poutsma&lt;/a&gt;. So, what to expect from the 3rd version of the most used Java framework. Well, six things:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Java 5 syntax&lt;/li&gt;&lt;li&gt;Expression language as an independent component&lt;/li&gt;&lt;li&gt;RESTful web services support&lt;/li&gt;&lt;li&gt;Portlets 2.0 support&lt;/li&gt;&lt;li&gt;Declarative annotation support (JSR 303)&lt;/li&gt;&lt;li&gt;JEE 6 support&lt;/li&gt;&lt;/ol&gt;In more detail. Spring 3.0 will provide Generics support which will backward compatible like in Java. Object XML (OXM) module moved to the core. There will be property editors, type converters and formatters, and annotated factory methods and meta-annotations.&lt;br /&gt;Spring configuration can now be defined in a Spring Java config class:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;@Configuration&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;public class AppConfig {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;EL came out of the core as a separate component. EL is now used, additionally to web navigation, in bean definitions, in annotations, and in default context attributes determined at runtime.&lt;br /&gt;&lt;br /&gt;Sping 3.0 now supports URI templates to create RESTful URLs, e.g. /hotel/{hotelid}&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;@PathVariable @RequestMapping(/hotels/{hotelid}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;class HotelController {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;     public void handleHotel(@PathVariable ("hotel") String hotel) { }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;/blockquote&gt;Other annotations: &lt;span style="font-family:courier new;"&gt;@CookieValue, @RequestHeader, @RequestBody, @ResponseBody&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;template = new RestTemplate();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;result = template.getForObject(uri, HotelList.class, "1");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;template.postForLocation(uri, booking, vars);  // vars is a hashmap  of {hotel}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;template.delete(location);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;template.execute(uri, HttpMethodGET, myReqCallback, myResCallback);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Partial support for JEE 6 will include: JSF 2, JPA 2, Bean Validation, JSR 303 and dependency injection. Spring 3.1 will provide full JEE 6 support.&lt;br /&gt;&lt;br /&gt;In Spring 3.0, Common Attributes and TopLink have been pruned. MVC controller hierarchy, JUnit 3.8, Struts 1.x, and some outdated helper classes have been deprecated.&lt;br /&gt;&lt;br /&gt;And the day continues with &lt;a href="http://devoxx.be/display/DV09/The+not+so+dark+art+of+Performance+Tuning" title="The not so dark art of Performance Tuning"&gt;The not so dark art of Performance Tuning&lt;/a&gt; by &lt;a href="http://devoxx.be/display/DV09/Kirk+Pepperdine" title="Kirk Pepperdine"&gt;Kirk Pepperdine&lt;/a&gt; and &lt;a href="http://devoxx.be/display/DV09/Dan+Hardiker" title="Dan Hardiker"&gt;Dan Hardiker. &lt;/a&gt;Kirk, together with Java evangelist &lt;a href="http://javaspecialists.eu/"&gt;Heinz Kabutz&lt;/a&gt;, are located in Chania Crete from where they provide expertise on many Java issues; one of them, performance. Kirk demonstrated &lt;a href="http://jakarta.apache.org/jmeter/"&gt;Apache JMeter&lt;/a&gt;, a tool for load and stress testing, to find performance problems in a web application. One can create a test plan to do his/her tests. There are four dominating consumers: hardware, JVM/OS, application and actors.&lt;br /&gt;He also talked about VisualVM, &lt;a href="https://tda.dev.java.net/"&gt;ThreadDumpAnalyzers&lt;/a&gt; and stack traces.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Recommended site:&lt;/i&gt; &lt;a target="_blank" href="http://www.javaperformancetuning.com/"&gt;http://www.javaperformancetuning.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://devoxx.be/display/DV09/iBeans+-+dead+simple+integration+for+the+Web" title="iBeans - dead simple integration for the Web"&gt;iBeans: dead-simple integration for the Web&lt;/a&gt; by &lt;a href="http://devoxx.be/display/DV09/Ross+Mason" title="Ross Mason"&gt;Ross Mason&lt;/a&gt;. Ross presented an alternative solution to SOA and ESB for web integration. An iBean is a Java Interface with annotated methods; a definition of how to talk to a service; a web service without XML! iBeans provide a simple solution for performing common integration tasks such as receiving and sending messages over Email, JMS or calling a Web Service. iBeans use no SOA, are cross-platform, easy to resuse and task-focused. iBeans central is a shared repository of iBeans. There is a Server API with functions like send/receive data, schedule tasks, create request/receive services, support protocols, and a Client API which allows you application to talk to other systems like Twitter, Google, Amazon, Facebook etc.&lt;br /&gt;iBeans deals with details like security in various service providers.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_rfX28kGqbFM/SyNM1NpeGlI/AAAAAAAAAGs/KHqL_pk2X2A/s1600-h/iBeans.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 206px;" src="http://4.bp.blogspot.com/_rfX28kGqbFM/SyNM1NpeGlI/AAAAAAAAAGs/KHqL_pk2X2A/s320/iBeans.png" alt="" id="BLOGGER_PHOTO_ID_5414255654109846098" border="0" /&gt;&lt;/a&gt;The Server API is contained in ibeans.war and has a number of useful annotations to use in your server side code:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;@Send (uri="xmpp:// ... ")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;@Schedule (interval="60000")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;void method() { ... }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;@Receive (uri="jms://my_queue")&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;void onMessage(Object msg) { ... }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;@Transform  // transforms a JMS message to an object we define e.g. Order&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;@IntegrationBean&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;On the client side, you can use iBeans in Javascript:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;var ibeans = new IBeansClientCJ;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;var x = ibeans.config.get( ... );&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;ibeans.twitter.set(x);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;iBeans provide support for GWT, Grails, Spring, Struts 2.x, Play! Its target is to become the WCF for the Web. What's next? WS support.&lt;br /&gt;&lt;i&gt;&lt;br /&gt;Recommended site: &lt;/i&gt;&lt;a href="http://www.mulesoft.org/display/IBEANS/Home"&gt;http://www.mulesoft.org/display/IBEANS/Home&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After the lunch break, back to some more JEE stuff: &lt;a href="http://www.devoxx.com/display/DV09/Deep+dive+on+the+Java+EE+6+platform+with+GlassFish+V3" title="Deep dive on the Java EE 6 platform with GlassFish V3"&gt;Deep dive on the Java EE 6 platform with GlassFish V3&lt;/a&gt; by &lt;a href="http://www.devoxx.com/display/DV09/Roberto+Chinnici" title="Roberto Chinnici"&gt;Roberto Chinnici&lt;/a&gt; and &lt;a href="http://www.devoxx.com/display/DV09/Ludovic+Champenois" title="Ludovic Champenois"&gt;Ludovic Champenois&lt;/a&gt;. Lets see what new features does JEE 6 bring on.&lt;br /&gt;- The new Web Servlet container brings initializers. Initializer libraries are stored in &lt;span style="font-family:courier new;"&gt;/META-INF/resources/&lt;/span&gt;.  Initializer class implements &lt;span style="font-family:courier new;"&gt;ServletContainerInitializer&lt;/span&gt; inside &lt;span style="font-family:courier new;"&gt;/META-INF/web-fragment.xml&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&amp;lt;web-fragment&amp;gt;&lt;br /&gt;&amp;lt;servlet&amp;gt;ServletClassName&amp;lt;.servlet&amp;gt;&lt;br /&gt;&amp;lt;/web-fragment&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;- CDI portable extensions. WebBeans support JSR-330 Context Injection. There is context management with scopes (and a new &lt;span style="font-family:courier new;"&gt;@ConversationScope&lt;/span&gt;), bean discovery and injection points in a bean. Below is an extension interface:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;public Interface Bean&lt;t&gt; extends Contextual&lt;t&gt; {&lt;/t&gt;&lt;/t&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   interface AnnotatedType&lt;t&gt; extends Annotated;&lt;/t&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;These are stored in &lt;span style="font-family:courier new;"&gt;/META-INF/services&lt;/span&gt;. Finally, there is support for Before/After discovery events.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Glassfish v3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Very fast, very small, modular, embedded, OSGi, RESTful administration, various containers (JRuby, Django, Grails, Rails). Containers are added/removed automatically.&lt;br /&gt;There is also a stripped jar (&amp;lt;1Mb) that contains all JEE 6 jars.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;java -jar glassfish.jar mywebapp.war&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There is automatic compilation support; thus you can change your servlet, then save your changes and refresh your browser to see your changes. There is a maven web application to manage your maven projects.&lt;br /&gt;Monitoring and management are exposed via RESTful web services: &lt;span style="font-family:courier new;"&gt;&lt;br /&gt;http://localhost:4848/management/domain&lt;br /&gt;http://localhost:4848/monitoring/domain/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Recommended site:&lt;/i&gt; &lt;a href="http://java.sun.com/javaee/downloads/index.jsp"&gt;http://java.sun.com/javaee/downloads/index.jsp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_rfX28kGqbFM/SyNlcv0wJdI/AAAAAAAAAG0/pJXKok_BPIo/s1600-h/IMAGE_019.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_rfX28kGqbFM/SyNlcv0wJdI/AAAAAAAAAG0/pJXKok_BPIo/s320/IMAGE_019.jpg" alt="" id="BLOGGER_PHOTO_ID_5414282721577936338" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The last presentation of the day was &lt;a href="http://www.devoxx.com/display/DV09/Maven+Reloaded" title="Maven Reloaded"&gt;Maven Reloaded&lt;/a&gt; by &lt;a href="http://www.devoxx.com/display/DV09/Jason+van+Zyl" title="Jason van Zyl"&gt;Jason van Zyl&lt;/a&gt;. Jason presented the new features of Maven 3.0. There will be backwards compatibility. The project builder has been refactored, there is a pluggable model reader and mixins to extend POMs, DSLs (Groovy, Ruby, Python, Scala), incremental build support (also in mEclipse), lifecycle extension points, OSGi bundles and a maven shell.&lt;br /&gt;&lt;br /&gt;And this ends day 4.&lt;br /&gt;&lt;br /&gt;&lt;big&gt;&lt;big&gt;&lt;b&gt;Day 5 - Conference Day 3&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/big&gt;&lt;/big&gt;The companies have started packaging their kiosks, and the exposition area seems empty. After 4 tiring but rewarding days, time for some fun with &lt;a href="http://www.devoxx.com/display/DV09/Gaming+JavaFX" title="Gaming JavaFX"&gt;Gaming JavaFX &lt;/a&gt;by &lt;a href="http://www.devoxx.com/display/DV09/Richard+Bair" title="Richard Bair"&gt;Richard Bair&lt;/a&gt; and &lt;a href="http://www.devoxx.com/display/DV09/Jasper+Potts" title="Jasper Potts"&gt;Jasper Potts&lt;/a&gt;.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_rfX28kGqbFM/SyNlkFPy7zI/AAAAAAAAAG8/Zxs9LbjQ6Rc/s1600-h/IMAGE_020.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://4.bp.blogspot.com/_rfX28kGqbFM/SyNlkFPy7zI/AAAAAAAAAG8/Zxs9LbjQ6Rc/s320/IMAGE_020.jpg" alt="" id="BLOGGER_PHOTO_ID_5414282847587594034" border="0" /&gt;&lt;/a&gt;Their games are based in a physics library: Phys2D --&gt; JBox2D --&gt; Phys2D.&lt;br /&gt;World contains a static and dynamic body. Collision detection is expensive. In JavaFx, you start by creating a &lt;span style="font-family:courier new;"&gt;PhysicalScene&lt;/span&gt; which contains a &lt;span style="font-family:courier new;"&gt;PhysicsWorld&lt;/span&gt; with gravity and interactions. A &lt;span style="font-family:courier new;"&gt;PhysicalObject&lt;/span&gt; is a node in the scene with a physics body which has a geometry. &lt;span style="font-family:courier new;"&gt;Prism&lt;/span&gt; replaces AWT, and talks directly to the hardware (Direct3D or OpenGL).&lt;br /&gt;The speakers presented a number of games, one involving explosions. An explosion visual has been emulated with iterating images.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;class ExplosionFS extends FourceSource&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   public var explosions[]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   Stage {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;     Scene: PhysicalScene {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;         content { &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;             Ground { &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                     ... &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;             }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;             Ball { &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;             }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;         }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Recommended site:&lt;/i&gt; &lt;a href="http://www.fxexperience.com/"&gt;http://www.fxexperience.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The next presentation was mainly due to work. &lt;a href="http://www.devoxx.com/display/DV09/Managing+Glassfish+on+OpenSolaris" title="Managing Glassfish on OpenSolaris"&gt;Managing Glassfish on OpenSolaris&lt;/a&gt; by &lt;a href="http://www.devoxx.com/display/DV09/Simon+Ritter" title="Simon Ritter"&gt;Simon Ritter&lt;/a&gt;. Glassfish and OpenSolaris are both free and open source under CDDL license. Simon talked about various containers: ZFS, Zone (multi-core CPUs virtualisation), Crossbow (network virtualisation), SMF (automate services) and how to run GF with RBAC (Robust Access Control) and SMF.&lt;br /&gt;ZFS is the new file system created by SUN Microsystems. It is a pool based storage with no volumes, that prevents silent data corruption (i.e. no need for fsck) using a big checksum, almost zero overhead and easy rollback.&lt;br /&gt;Volumes have been replaced by a 128-bit storage pool and all free storage is always available, fast and simple. ZFS snapshots are read-only, incremental, thus efficient. ZFS storage pools can be accessed with the following commands:&lt;br /&gt;&lt;br /&gt;# zpool list&lt;br /&gt;# zpool status&lt;br /&gt;# pfexec zpool create mypool (&lt;device&gt;)&lt;br /&gt;# pfexec zfs snapshot&lt;br /&gt;# pfexec zfs rollback&lt;br /&gt;# pfexec zfs send &lt;mypool&gt; &lt;myfs&gt;&lt;br /&gt;# pfexec zfs receive &lt;mypool&gt; &lt;myfs&gt;&lt;br /&gt;&lt;br /&gt;Zones virtualise system resources (CPUs, NICs, memory etc) not the hardware. They are lightweight and no virtual machine is needed. Crossbow, e.g. can virtualise a number of NICs (Virtual NICs) that run different applications:&lt;br /&gt;&lt;br /&gt;&lt;/myfs&gt;&lt;/mypool&gt;&lt;/myfs&gt;&lt;/mypool&gt;&lt;/device&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_rfX28kGqbFM/SyNvwE_tsvI/AAAAAAAAAHE/DFg6x4eVsJY/s1600-h/crossbow.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 163px;" src="http://3.bp.blogspot.com/_rfX28kGqbFM/SyNvwE_tsvI/AAAAAAAAAHE/DFg6x4eVsJY/s320/crossbow.png" alt="" id="BLOGGER_PHOTO_ID_5414294048794850034" border="0" /&gt;&lt;/a&gt;SMF provides a uniform mechanism to manage services:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;svcadm [disable|enable] mydomain&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Dependencies are declared in an xml manifest for the service. Compared to rc*.d, there is a GUI.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;asadmin create-service&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And the last presentation was &lt;a href="http://www.devoxx.com/display/DV09/ArchiMate" title="ArchiMate"&gt;ArchiMate: A common language for Enterprise Architecture&lt;/a&gt;  by &lt;a href="http://www.devoxx.com/display/DV09/Remco+Blom" title="Remco Blom"&gt;Remco Blom.&lt;/a&gt; Archimate is a standard language for modelling and visualising enterprise architectures. It bridges the gap from business pictures to technical UML diagrams. UML is not designed for Enterprise Architecture; business people don't understand it; there is no explicit service paradigm and has many models.&lt;br /&gt;BizzDesign is an IDE that supports the Archimate language. Architype is a structure of a system in terms of components, relations, underlying principles and visible properties. Enterprise Architecture has a process view (way of working) and a product view (design). TOGAF (Open Group Architecture Framework) defines the process and Archimate defines the language. The archimate IO specification defines 3 layers (business, application and technology) and 3 aspects (passive structure, active structure and behaviour).&lt;br /&gt;Then, he demonstrated the bizzdesign tool and he didn't miss to mention a TOGAF eclipse &lt;a href="http://www.opengroup.org/togaf/epf-intro.html"&gt;plugin&lt;/a&gt;, too. BizzDesign can be integrated with Visio (with stencils) or can be downloaded as an IDE (BizzDesign Architect). One can refer from an archetype diagram to a UML diagram and vice versa.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Recommended sites:&lt;/i&gt; &lt;a href="http://www.archimate.org/"&gt;http://www.archimate.org&lt;/a&gt;, &lt;a href="http://www.opengroup.org/archimate"&gt;http://www.opengroup.org/archimate&lt;/a&gt;, &lt;a href="http://www.bizzdesign.com/"&gt;http://bizzdesign.com&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;And this ends 2009 Devoxx conference. All the presentations will be available from January next year hopefully, in &lt;a href="http://parleys.com/"&gt;parleys.com&lt;/a&gt; and all those who couldn't participate will have a chance to take a snif of what was presented there, and what you missed. See you, hopefully, next year!&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-5965865968697486925?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/5965865968697486925/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=5965865968697486925' title='4 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/5965865968697486925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/5965865968697486925'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2009/11/devoxx-09_17.html' title='DEVOXX 09'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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/_rfX28kGqbFM/Swhe2Vz8IaI/AAAAAAAAAGI/2vtanrOCEzM/s72-c/IMAGE_014.jpg' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5488862533782141445.post-5375117321165863653</id><published>2009-06-14T04:35:00.000-07:00</published><updated>2009-06-14T04:35:00.610-07:00</updated><title type='text'>Are analysts/GUI designers doing a good job?</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;I happened to ask for a new telephone in the company I work, and I went to the guy who was responsible. The guy complained to me about the new application he had to use, a Java Swing application that allowed him to set the phone number to the UTP plug etc. "In the previous application you could open a new account in just one click. With this new one, you have to save, click here, then back to the tree, wait until it is saved etc." he complained.&lt;br/&gt;&lt;br/&gt;I wondered what the analyst/GUI designer responsible for the GUI of that application was thinking. Didn't he look at the previous application s/he was replacing? The new application had to be at least as easy and fast to use as the previous one. Do we keep in mind the one-click pattern of WWW when we design the GUIs of our Swing applications, or not?&lt;br/&gt;&lt;br/&gt;Our purpose, as analysts/designers/developers is not only to be able to create nice interfaces with great components (trees, tables etc.) but also to make them as user friendly as possible. Listen to the user next time, and understand his/her needs!&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-5375117321165863653?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/5375117321165863653/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=5375117321165863653' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/5375117321165863653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/5375117321165863653'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2009/06/are-analystsgui-designers-doing-good.html' title='Are analysts/GUI designers doing a good job?'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-6095727971707649222</id><published>2009-04-02T06:50:00.002-07:00</published><updated>2009-04-02T06:51:00.286-07:00</updated><title type='text'>How to remove elements from an array</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;b&gt;Problem&lt;/b&gt;&lt;br/&gt;&lt;br/&gt;I have an array, e.g. &lt;br/&gt;&lt;br/&gt;&lt;font face='Courier New'&gt;String strArray[] = new String[3];&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;and I 'd like to remove elements that satisfy a certain condition. &lt;br/&gt;&lt;br/&gt;You could write something like:&lt;br/&gt;&lt;br/&gt;&lt;font face='Courier New'&gt;List lstStrings = Arrays.asList(strArray);&lt;br/&gt;for (int i=&lt;/font&gt;&lt;font face='Courier New'&gt;lstStrings&lt;/font&gt;&lt;font face='Courier New'&gt;.size()-1; i&amp;gt;=0; i--) {&lt;br/&gt;   String s =  (String)&lt;/font&gt;&lt;font face='Courier New'&gt;lstStrings&lt;/font&gt;&lt;font face='Courier New'&gt;.get(i);&lt;br/&gt;   if (s.equals("target")) {&lt;br/&gt;       &lt;/font&gt;&lt;font face='Courier New'&gt;lstStrings&lt;/font&gt;&lt;font face='Courier New'&gt;.remove(i);&lt;br/&gt;   }&lt;br/&gt;}&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;and you 'll get a &lt;br/&gt;&lt;br/&gt;&lt;font face='Courier New'&gt;java.lang.UnsupportedOperationException at java.util.AbstractList.remove&lt;br/&gt;&lt;/font&gt;&lt;br/&gt;What's wrong? Well, the problem lies in this command:&lt;br/&gt;&lt;br/&gt;&lt;font face='Courier New'&gt;List lstStrings = Arrays.asList(strArray);&lt;br/&gt;&lt;br/&gt;&lt;font face='sans-serif'&gt;The result of&lt;/font&gt;&lt;/font&gt;&lt;font face='sans-serif'&gt; &lt;font face='Courier New'&gt;Arrays.asList&lt;/font&gt; is an &lt;font face='Courier New'&gt;Arrays$ArrayList&lt;/font&gt;&lt;/font&gt;&lt;font face='Courier New'&gt;&lt;font face='sans-serif'&gt; (and &lt;i&gt;not &lt;/i&gt;an &lt;font face='Courier New'&gt;ArrayList&lt;/font&gt;) which is immutable and doesn't provide for a remove method.&lt;br/&gt;&lt;br/&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face='Courier New'&gt;List lstStrings = new ArrayList(Arrays.asList(strArray));&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=455c8df5-56d0-839f-b8f1-6edee70b4b2b' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-6095727971707649222?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/6095727971707649222/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=6095727971707649222' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/6095727971707649222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/6095727971707649222'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2009/04/how-to-remove-elements-from-array_94.html' title='How to remove elements from an array'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-9057405298489716559</id><published>2009-02-27T07:34:00.001-08:00</published><updated>2009-02-27T07:34:21.845-08:00</updated><title type='text'>JSPs and mime types</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;I have a simple request. I have an .xml file stored somewhere in my server. The file is an Excel sheet saved in .xml format. I simply point to it from an anchor in my jsp page. I want, when the user, left-clicks to it, MS-Excel (or OO Calc) to open to display the file instead of its contents being displayed inside the browser. So, I set the mime type in the anchor tag like so:&lt;br/&gt;&lt;br/&gt;&lt;font face='Courier New'&gt;&amp;lt;a type="application/vnd.ms-excel; charset=UTF-8" href="&amp;lt;c:url value='/templates/template.xml'/&amp;gt;"&amp;gt;&amp;lt;img src="&amp;lt;c:url value='/images/excel.gif'/&amp;gt;"&amp;gt;&amp;lt;/a&amp;gt;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;The trick seems to work fine for Firefox, but alas, not for Internet Explorer. If someone knows a solution, please let me know. :-)&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=b1b36e24-8b56-4db7-9082-c289eaf1d86b' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-9057405298489716559?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/9057405298489716559/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=9057405298489716559' title='2 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/9057405298489716559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/9057405298489716559'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2009/02/jsps-and-mime-types.html' title='JSPs and mime types'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-7740078946047740895</id><published>2009-02-11T00:53:00.000-08:00</published><updated>2009-02-11T01:33:37.715-08:00</updated><title type='text'>Speed up Intellij IDEA startup time</title><content type='html'>Intellij IDEA 8 has become a big IDE and takes quite sometime to startup. Here are a couple of hints to improve startup time:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;replace &lt;span style="font-family: courier new;"&gt;idea.exe.vmoptions&lt;/span&gt; contents with the following one:&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-family: courier new;"&gt;-Xms400m&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;-Xmx800m&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;-XX:MaxPermSize=120m&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;-ea&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;-Dsun.awt.keepWorkingSetOnMinimize=true &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;increasing the RAM size allocation even more if your machine can handle it, e.g. to 1024m&lt;br /&gt;&lt;br /&gt;     2. modify&lt;span style="font-family: courier new;"&gt; idea.properties&lt;/span&gt; by moving the config directory to a faster drive if e.g. you home profile is saved in a network drive, e.g.:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;# idea.config.path=${user.home}/.IntelliJIdea80/config&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;idea.config.path=D:/Config/.IntelliJIdea80/config&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-7740078946047740895?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/7740078946047740895/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=7740078946047740895' title='1 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/7740078946047740895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/7740078946047740895'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2009/02/speed-up-intellij-idea-startup-time.html' title='Speed up Intellij IDEA startup time'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-4392829037986797939</id><published>2009-01-15T02:57:00.000-08:00</published><updated>2009-01-15T03:02:42.113-08:00</updated><title type='text'>Freelance in Northern Europe vs. in Southern</title><content type='html'>Did you know this? If you negotiate your daily rate in Northern Europe and/or US, it is without VAT. If you do in the south, then VAT is included! This is how companies save money!&lt;br /&gt;&lt;br /&gt;So, if e.g. your daily rate is 500€, then in northern Europe you invoice the customer 617 € (assuming VAT 19%). In southern Europe, you invoice 500€, and you pay the VAT, hence your actual rate is 405€!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-4392829037986797939?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/4392829037986797939/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=4392829037986797939' title='3 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/4392829037986797939'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/4392829037986797939'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2009/01/freelance-in-northern-europe-vs-in.html' title='Freelance in Northern Europe vs. in Southern'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-75512154141899223</id><published>2008-12-02T00:20:00.000-08:00</published><updated>2009-01-11T10:52:02.013-08:00</updated><title type='text'></title><content type='html'>Οι καθηγητές Πληροφορικής αγωνίζονται ενάντια στην απαξίωση - υποβάθμιση του επιπέδου σπουδών Πληροφορικής στο Δημόσιο Σχολείο όπου πρόσφατα μεθόδευσε το ΥΠΕΠΘ και απαιτούν: &lt;ol&gt;&lt;li&gt;Οι αναθέσεις μαθημάτων ΚΑΙ για τα μαθήματα τα σχετικά με την Πληροφορική να γίνονται με βάση το γνωστικό αντικείμενο του πτυχίου και μόνο.&lt;/li&gt;&lt;li&gt; Ο αριθμός μαθητών ανά καθηγητή στα εργαστηριακά μαθήματα να γίνει δώδεκα (12) ΚΑΙ για τα μαθήματα Πληροφορικής και όχι δεκαεπτά (17) όπως τώρα κατ’ εξαίρεση ορίζει η νέα εγκύκλιος.&lt;/li&gt;&lt;li&gt;Ισονομία για τους υπεύθυνους εργαστηρίων Πληροφορικής με τρίωρη μείωση ωραρίου ΚΑΙ για το ΣΕΚ.&lt;/li&gt;&lt;/ol&gt;ΒΟΗΘΕΙΣΤΕ ΣΤΟΝ ΑΓΩΝΑ ΤΩΝ ΠΛΗΡΟΦΟΡΙΚΩΝ ΓΙΑ ΤΗΝ ΕΚΠΑΙΔΕΥΣΗ ΠΛΗΡΟΦΟΡΙΚΗΣ ΚΑΙ ΜΕΤΑΔΩΣΤΕ ΤΟ ΜΥΝΗΜΑ. Διαβάστε το &lt;a href="http://www.keplinet-chanion.gr/index.php?option=com_docman&amp;amp;task=doc_download&amp;amp;gid=105&amp;amp;Itemid="&gt;αυτονόητο.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-75512154141899223?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/75512154141899223/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=75512154141899223' title='1 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/75512154141899223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/75512154141899223'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2008/12/blog-post.html' title=''/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-6298800214943393954</id><published>2008-09-29T01:59:00.000-07:00</published><updated>2009-01-11T10:53:25.171-08:00</updated><title type='text'>Tips and tricks</title><content type='html'>&lt;ol&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Tricks on immutability&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div style="text-align: justify;"&gt;a. Always make a copy of mutable objects inside your methods, e.g.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;void myMethod(Date date) {&lt;br /&gt; Date myCopy = new Date(date.getTime());&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;span style="font-size:100%;"&gt;b. How do I create an immutable Java Bean or POJO? Make it read-only, and pass any parameters during initialisation (in the constructor):&lt;br /&gt;&lt;/span&gt;&lt;pre&gt;&lt;br /&gt;public class MyClass {&lt;br /&gt;private int param1;&lt;br /&gt;private String param2;&lt;br /&gt;private Date date;&lt;br /&gt;&lt;br /&gt;public MyClass (int param1, String param2, Date d) {&lt;br /&gt;    this.param1 = param1;&lt;br /&gt;    this.param2 = param2;&lt;br /&gt;    this.date = new Date(d.getTime());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public int getParam1() {&lt;br /&gt;    return param1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String getParam2() {&lt;br /&gt;    return param2;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public Date getDate() {&lt;br /&gt;    return new Date(date.getTime());&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;c. Immutable objects and Hibernate&lt;br /&gt;&lt;ul&gt;&lt;li&gt;set the access type to “field” in order to use reflection to set the fields instead of property access, which uses setters.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;set mutable to false (Hibernate will perform small optimizations, too).&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-6298800214943393954?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/6298800214943393954/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=6298800214943393954' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/6298800214943393954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/6298800214943393954'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2008/09/tips-and-tricks.html' title='Tips and tricks'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-2031182012030749692</id><published>2008-09-07T04:04:00.000-07:00</published><updated>2008-09-29T07:33:41.881-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Comparator'/><category scheme='http://www.blogger.com/atom/ns#' term='Collator'/><category scheme='http://www.blogger.com/atom/ns#' term='Greek'/><category scheme='http://www.blogger.com/atom/ns#' term='String'/><title type='text'>Compare and sort Greek Strings</title><content type='html'>&lt;span style="font-size:100%;"&gt;In&lt;/span&gt;spired from the article &lt;span style="font-style: italic;"&gt;&lt;a href="http://www.javapractices.com/topic/TopicAction.do?Id=207"&gt;Compare and sort Strings&lt;/a&gt;&lt;/span&gt;, I hereby present an example of Collators and Comparators with Strings that contain Greek letters.&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import java.text.Collator;&lt;br /&gt;import java.util.Arrays;&lt;br /&gt;import java.util.Collections;&lt;br /&gt;import java.util.List;&lt;br /&gt;import java.util.Locale;&lt;br /&gt;&lt;br /&gt;public class GreekCollator {&lt;br /&gt;private static final Locale GREEK_LOCALE = new Locale("el", "GR");&lt;br /&gt;private static final int NO_COLLATOR = -1;&lt;br /&gt;&lt;br /&gt; private enum CollatorEnum {&lt;br /&gt;  NoCollator(NO_COLLATOR),&lt;br /&gt;  Primary(Collator.PRIMARY),&lt;br /&gt;  Secondary(Collator.SECONDARY),&lt;br /&gt;  Tertiary(Collator.TERTIARY),&lt;br /&gt;  Identical(Collator.IDENTICAL);&lt;br /&gt;  &lt;br /&gt;  private int collatorStrength;&lt;br /&gt;  CollatorEnum(int collatorStrength) {&lt;br /&gt;   this.collatorStrength = collatorStrength;&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* @param args&lt;br /&gt;*/&lt;br /&gt;public static void main(String[] args) {&lt;br /&gt; List&amp;lt;String&amp;gt; words = Arrays.asList("άλλος", "αλάνι", "βασικός", "ελεύθερος", "Ελεύθερος", "Άλλος", "Αλάνι");&lt;br /&gt;&lt;br /&gt;System.out.println(words + " - Original Data\n");&lt;br /&gt;  sort(words, CollatorEnum.NoCollator); // don't use a collator&lt;br /&gt;  sort(words, CollatorEnum.Primary);&lt;br /&gt;  sort(words, CollatorEnum.Secondary);&lt;br /&gt;  sort(words, CollatorEnum.Tertiary);&lt;br /&gt;  sort(words, CollatorEnum.Identical);&lt;br /&gt;&lt;br /&gt;  System.out.println();&lt;br /&gt;  compare("αβγ", "ΆΒΓ", CollatorEnum.NoCollator);&lt;br /&gt;  compare("αβγ", "ΆΒΓ", CollatorEnum.Primary);&lt;br /&gt;  compare("αβγ", "ΆΒΓ", CollatorEnum.Secondary);&lt;br /&gt;  compare("αβγ", "ΆΒΓ", CollatorEnum.Tertiary);&lt;br /&gt;  compare("αβγ", "ΆΒΓ", CollatorEnum.Identical);&lt;br /&gt;&lt;br /&gt;  System.out.println();&lt;br /&gt;  compare("αβγ", "ΑΒΓ", CollatorEnum.NoCollator);&lt;br /&gt;  compare("αβγ", "ΑΒΓ", CollatorEnum.Primary);&lt;br /&gt;  compare("αβγ", "ΑΒΓ", CollatorEnum.Secondary);&lt;br /&gt;  compare("αβγ", "ΑΒΓ", CollatorEnum.Tertiary);&lt;br /&gt;  compare("αβγ", "ΆΒΓ", CollatorEnum.Identical);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private static void sort(List&amp;lt;String&amp;gt; aWords, CollatorEnum collatorEnum) {&lt;br /&gt;  if (collatorEnum.collatorStrength &lt; 0) {&lt;br /&gt;   Collections.sort(aWords);&lt;br /&gt;  } else {&lt;br /&gt;   Collator collator = Collator.getInstance(GREEK_LOCALE);&lt;br /&gt;   collator.setStrength(collatorEnum.collatorStrength);&lt;br /&gt;   Collections.sort(aWords, collator);&lt;br /&gt;  }&lt;br /&gt;  System.out.println(aWords.toString() + " " + collatorEnum);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  private static void compare(String aThis, String aThat, CollatorEnum collatorEnum) {&lt;br /&gt; int comparison = 999;&lt;br /&gt;  if (collatorEnum.collatorStrength &lt; 0) {&lt;br /&gt;   comparison = aThis.compareTo(aThat);&lt;br /&gt;  } else {&lt;br /&gt;   Collator collator = Collator.getInstance(GREEK_LOCALE);&lt;br /&gt;   collator.setStrength(collatorEnum.collatorStrength);&lt;br /&gt;   comparison = collator.compare(aThis, aThat);&lt;br /&gt;  }&lt;br /&gt;  if (comparison == 0) {&lt;br /&gt;   System.out.println("Collator sees them as the same : " + aThis&lt;br /&gt;     + ", " + aThat + " - " + collatorEnum);&lt;br /&gt;  } else {&lt;br /&gt;   System.out.println("Collator sees them as DIFFERENT  : " + aThis&lt;br /&gt;     + ", " + aThat + " - " + collatorEnum);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;Here is the output of the program, for your comments.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[άλλος, αλάνι, βασικός, ελεύθερος, Ελεύθερος, Άλλος, Αλάνι] - Original Data&lt;br /&gt;&lt;br /&gt;[Άλλος, Αλάνι, Ελεύθερος, άλλος, αλάνι, βασικός, ελεύθερος] NoCollator&lt;br /&gt;[Αλάνι, αλάνι, Άλλος, άλλος, βασικός, Ελεύθερος, ελεύθερος] Primary&lt;br /&gt;[Αλάνι, αλάνι, Άλλος, άλλος, βασικός, Ελεύθερος, ελεύθερος] Secondary&lt;br /&gt;[αλάνι, Αλάνι, άλλος, Άλλος, βασικός, ελεύθερος, Ελεύθερος] Tertiary&lt;br /&gt;[αλάνι, Αλάνι, άλλος, Άλλος, βασικός, ελεύθερος, Ελεύθερος] Identical&lt;br /&gt;&lt;br /&gt;Collator sees them as DIFFERENT  : αβγ, ΆΒΓ - NoCollator&lt;br /&gt;Collator sees them as the same : αβγ, ΆΒΓ - Primary&lt;br /&gt;Collator sees them as DIFFERENT  : αβγ, ΆΒΓ - Secondary&lt;br /&gt;Collator sees them as DIFFERENT  : αβγ, ΆΒΓ - Tertiary&lt;br /&gt;Collator sees them as DIFFERENT  : αβγ, ΆΒΓ - Identical&lt;br /&gt;&lt;br /&gt;Collator sees them as DIFFERENT  : αβγ, ΑΒΓ - NoCollator&lt;br /&gt;Collator sees them as the same : αβγ, ΑΒΓ - Primary&lt;br /&gt;Collator sees them as the same : αβγ, ΑΒΓ - Secondary&lt;br /&gt;Collator sees them as DIFFERENT  : αβγ, ΑΒΓ - Tertiary&lt;br /&gt;Collator sees them as DIFFERENT  : αβγ, ΆΒΓ - Identical&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style=";font-family:lucida grande;font-size:130%;"  &gt;References&lt;/span&gt;&lt;br /&gt;&lt;ol  style="font-family:lucida grande;"&gt;&lt;li&gt;Java Practices, &lt;span style="font-style: italic;"&gt;&lt;a href="http://www.javapractices.com/topic/TopicAction.do?Id=207"&gt;Compare and sort Strings&lt;/a&gt;.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-2031182012030749692?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/2031182012030749692/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=2031182012030749692' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/2031182012030749692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/2031182012030749692'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2008/09/compare-and-sort-greek-strings.html' title='Compare and sort Greek Strings'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-8493598424211916430</id><published>2008-07-16T00:50:00.000-07:00</published><updated>2008-07-16T00:57:34.646-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='List'/><category scheme='http://www.blogger.com/atom/ns#' term='Collections'/><category scheme='http://www.blogger.com/atom/ns#' term='Copy'/><category scheme='http://www.blogger.com/atom/ns#' term='ArrayList'/><category scheme='http://www.blogger.com/atom/ns#' term='IndexOutOfBoundsException'/><title type='text'>Collections.copy</title><content type='html'>Well, it looks like this method contains a "&lt;a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6350752"&gt;bug&lt;/a&gt;"?!?!?&lt;br /&gt;&lt;br /&gt;Simply do this test:&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;public void testCollectionsCopy () {&lt;br /&gt;   ArrayList&lt;string&gt; list1 = new ArrayList&lt;string&gt;(3);&lt;br /&gt;   list1.add("one");&lt;br /&gt;   list1.add("two");&lt;br /&gt;   list1.add("three");&lt;br /&gt;   ArrayList&lt;string&gt; list2 = new ArrayList&lt;string&gt;(3);&lt;br /&gt;   Collections.copy(list2, list1);   // throws IndexOutOfBoundsException!!!!!&lt;br /&gt;}&lt;/string&gt;&lt;/string&gt;&lt;/string&gt;&lt;/string&gt;&lt;/blockquote&gt;&lt;string&gt;&lt;string&gt;&lt;string&gt;&lt;string&gt;Well, the solution? Pass the collection to be copied as a parameter to the constructor.&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;ArrayList&lt;string&gt; list1 = new ArrayList&lt;string&gt;(list1);&lt;/string&gt;&lt;/string&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;/string&gt;&lt;/string&gt;&lt;/string&gt;&lt;/string&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-8493598424211916430?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/8493598424211916430/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=8493598424211916430' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/8493598424211916430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/8493598424211916430'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2008/07/collectionscopy.html' title='Collections.copy'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-2168133388502210453</id><published>2008-06-28T03:31:00.000-07:00</published><updated>2008-07-02T03:00:43.847-07:00</updated><title type='text'>JavaOne Afterglow 2008</title><content type='html'>On Friday, 27th of June 2008, I attended the JavaOne Afterglow 2008 in &lt;a href="http://www.demontil.com/eng/"&gt;De Montil&lt;/a&gt;, Affligem, a few km outside Brussels. It was a well organised day event, that gave us useful information about the things to come, a summary of what was presented in JavaOne conference. Here is the agenda:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Agenda&lt;/span&gt;:&lt;br /&gt;09:15 - 09:45 Registration&lt;br /&gt;09:45 - 10:45 "JavaOne Afterglow keynote"&lt;br /&gt;                David Delabassée - Sun Microsystems Belgium&lt;br /&gt;10:45 - 11:30 "Modularity in Java : OSGi and/or JSR 277 ?"&lt;br /&gt;               Stijn Van Den Enden - ACA IT-Solutions&lt;br /&gt;11:30 - 12:30 "Project Fuji, an Integration Profile"&lt;br /&gt;               Andreas Egloff - Sun Microsystems Inc.&lt;br /&gt;12:30 - 13:30 Lunch&lt;br /&gt;13:30 - 14:30 "Java EE 6"&lt;br /&gt;               Alexis Moussine - Pouchkine - Sun Microsystems Inc.&lt;br /&gt;14:30 - 15:30 "Boldly Go Where the Java Programming Language Has Never Gone Before"&lt;br /&gt;               Geert Bevin - Terracotta&lt;br /&gt;15:30 - 15:45 Coffee break&lt;br /&gt;15:45 - 16:15 "JavaFX overview"&lt;br /&gt;               Jo Voordeckers - RealDolmen&lt;br /&gt;16:15 - 17:00 "Parleys.com: A Flex/AIR, JavaFX and GWT Case Study"&lt;br /&gt;                Stephan Janssen - RealDolmen&lt;br /&gt;17:00 - 17:15 Wrap-up and prize raffle&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The conference started with &lt;span style="font-weight: bold;"&gt;David Delabasée&lt;/span&gt;, the Java ambassador in Belgium-Luxembourgh, who gave an overview of the new things we are to expect regarding Java 7 as well as other Java technologies such as &lt;a href="http://java.sun.com/javacard/"&gt;Java Card&lt;/a&gt;. A Java Card is a smart card that contains an application server in it! Hence, you can upload a servlet to itconnect it to various devices and call it from various programs and devices as David demonstrated. David also shown a roadmap of Java through expected version 7, mentioning &lt;a href="http://openjdk.java.net/"&gt;OpenJDK&lt;/a&gt;/IcedTea project, the new &lt;a href="https://nimbus.dev.java.net/"&gt;Nimbus look &amp;amp; feel&lt;/a&gt; in JDK 6 update 10 (consumer JRE). The "Java Virutal Machine" becomes simply "Virtual Machine", as it now hosts not only Java but a large number of other languages such as Ruby, Groovy, Grails, Pascal etc. Characteristics of the new JDK 7 are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;hosting of many languages, as already mentioned&lt;/li&gt;&lt;li&gt;Profiles&lt;/li&gt;&lt;li&gt;JMX 2.0&lt;/li&gt;&lt;li&gt;Visual JVM (a nice tool that will graphically displays the internal of the VM); and  &lt;/li&gt;&lt;li&gt;closures&lt;/li&gt;&lt;/ul&gt;Next, &lt;span style="font-weight: bold;"&gt;Stijn Van Den Enden&lt;/span&gt;, spoke about modularity and compared the current two frameworks, &lt;a href="http://www.osgi.org/"&gt;OSGi &lt;/a&gt;and&lt;a href="http://jcp.org/en/jsr/detail?id=277"&gt; JSR 277&lt;/a&gt;. As you already know, currently modularity in Java is addressed by packages and interfaces and there is no versioning or access control. If a class in one package needs to access a class in another package, the only way is to declare the class in the other package public, hoping that no one will find out that an internal class is exposed as public.&lt;br /&gt;OSGi solves these problems with bundles. A bundle is a package with some useful metadata about the package in MANIFEST.MF. It separates private from public resources; determines package resolution; and allows versioning.&lt;br /&gt;JSR 277, or Java Module System, is a new specification that addresses the same problem. The equivalent to OSGi bundle is called Java Module and it is packaged as a special kind of JAR, called JAM (JAva Module). Metadata is not in the manifest file, but as annotations.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Andreas Engloff&lt;/span&gt; gave a presentation about &lt;a href="https://fuji.dev.java.net/"&gt;project Fuji&lt;/a&gt;, an integration profile project or standard plugin model for modules. It has three layers, Modularity, Service Orientation and application interface. It is based on OSGi, Open ESB and provides for Enterprise Integration. Andreas presented a demo of the simple workflow language one can use to easily get RSS feeds, filter them by JRuby and feed them to an XMPP (instant messaging) application. He wrote less than 10 lines of simple commands to accomplish this!&lt;br /&gt;&lt;br /&gt;The session continued after the lunch break with &lt;span style="font-weight: bold;"&gt;Geert Bevin&lt;/span&gt; from Terracotta who presented 4 hot Java technologies:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.terracotta.org/"&gt;Terracotta&lt;/a&gt;, an open source clustering framework which allows you to run your code to multiple JVMs seamlessly&lt;/li&gt;&lt;li&gt;&lt;a href="http://rifers.org/"&gt;RIFE&lt;/a&gt;, a full-stack component framework for web applications, which with the principle of continuation, allows you to stop, save and reload a web app state like one does with computer games&lt;/li&gt;&lt;li&gt;&lt;a href="http://code.google.com/webtoolkit/"&gt;Google Web Toolkit&lt;/a&gt;; and&lt;/li&gt;&lt;li&gt;&lt;a href="http://code.google.com/android/"&gt;Google Android&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;Alexis Moussine-Pouchkine&lt;/span&gt; gave a presentation about upcoming &lt;a href="https://glassfish.dev.java.net/"&gt;Glassfish &lt;/a&gt;v.3 application server as well as about the new features of Java EE 6:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Extensibility&lt;/li&gt;&lt;li&gt;Profiles&lt;/li&gt;&lt;li&gt;Pruning; and&lt;/li&gt;&lt;li&gt;ease of development&lt;/li&gt;&lt;/ul&gt;After the coffee break, &lt;span style="font-weight: bold;"&gt;Jo Voordecker&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;s&lt;/span&gt; gave a short presentation about &lt;a href="http://www.sun.com/software/javafx/"&gt;JavaFX&lt;/a&gt;, or the return of the applet. JavaFX is the new scripting language provided by SUN, that hopes to boost and simplify both desktop and web development. The new "Java 6 update N" is less than 3 Mb, compared to ~12 Mb of current JRE 6, which can be quickly downloaded by clients' machines. However, JavaFX has a number of competitors, like &lt;a href="http://www.adobe.com/products/flex/"&gt;Adobe Flex&lt;/a&gt;, &lt;a href="http://silverlight.net/"&gt;MS Silverlight&lt;/a&gt; but also &lt;a href="http://jruby.codehaus.org/"&gt;JRuby&lt;/a&gt; and others.&lt;br /&gt;&lt;br /&gt;The conference ended with &lt;span style="font-weight: bold;"&gt;Stephan Janssen&lt;/span&gt;s' presentation of &lt;a href="http://parleys.com/"&gt;parleys.com&lt;/a&gt;, and a comparison of 3 hot competitors in the RIA arena, namely, &lt;a href="http://www.adobe.com/products/flex/"&gt;Adobe Flex&lt;/a&gt;, &lt;a href="http://www.sun.com/software/javafx/"&gt;JavaFX &lt;/a&gt;and &lt;a href="http://code.google.com/webtoolkit/"&gt;GWT&lt;/a&gt;.&lt;br /&gt;Adobe provides &lt;a href="http://www.adobe.com/products/air/"&gt;AIR &lt;/a&gt;for desktop and Flex for Web applications; JavaFX is for both the desktop and the web; while GWT is only for developing Web applications. A thing to note is that Flex is only compatible with Flash version 9 or later, so he is developing a version of parleys.com with GWT which is compatible with Flash version 8 for clients that run this version of Flash.&lt;br /&gt;&lt;br /&gt;The conference finished with some draws, and the winners won books and a playstation 3.&lt;br /&gt;&lt;br /&gt;A well organised conference as I said, but in the middle of nowhere, with no public transport available, and difficult to go there if you don't have a car! :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-2168133388502210453?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/2168133388502210453/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=2168133388502210453' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/2168133388502210453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/2168133388502210453'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2008/06/javaone-afterglow-2008.html' title='JavaOne Afterglow 2008'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-4107385471474758713</id><published>2008-06-24T01:56:00.000-07:00</published><updated>2008-09-01T12:49:39.696-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HashMap'/><category scheme='http://www.blogger.com/atom/ns#' term='Hashtable'/><title type='text'>Hashtable vs. HashMap</title><content type='html'>&lt;span style="font-family:courier new;"&gt;HashMap&lt;/span&gt;s accept &lt;code&gt;null&lt;/code&gt; values, while &lt;span style="font-family:courier new;"&gt;Hashtable&lt;/span&gt;s don't.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import java.util.HashMap;&lt;br /&gt;import java.util.Hashtable;&lt;br /&gt;&lt;br /&gt;import junit.framework.TestCase;&lt;br /&gt;&lt;br /&gt;public class HashMapTest extends TestCase {&lt;br /&gt;   private HashMap&lt;string,object&gt; map = new HashMap&lt;string,object&gt;();&lt;/string,object&gt;&lt;/string,object&gt;&lt;br /&gt;   private Hashtable&lt;string,&gt; hashtable = new Hashtable&lt;string,&gt;();&lt;/string,&gt;&lt;/string,&gt;&lt;br /&gt;  &lt;br /&gt;   public void testHashMap() {&lt;br /&gt;       map.put("name", null);&lt;br /&gt;       assertNotNull(map);&lt;br /&gt;       assertEquals(1,map.size());&lt;br /&gt;   }&lt;br /&gt;  &lt;br /&gt;   public void testHashtable() {&lt;br /&gt;       hashtable.put("name", null);&lt;br /&gt;       assertNotNull(hashtable);&lt;br /&gt;       assertEquals(1,hashtable.size());&lt;br /&gt;   }   &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The 2nd test simply throws a &lt;code&gt;NullPointerException&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Hashtable&lt;/span&gt; is historical, according to &lt;a href="http://www.javapractices.com/topic/TopicAction.do;jsessionid=3BDAE6E95E3135F74C8293C812EA5663?Id=65"&gt;JavaPractices&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-4107385471474758713?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/4107385471474758713/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=4107385471474758713' title='1 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/4107385471474758713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/4107385471474758713'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2008/06/hashtable-vs-hashmap.html' title='Hashtable vs. HashMap'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-2262971728531657278</id><published>2008-02-01T00:17:00.000-08:00</published><updated>2008-03-31T04:44:16.330-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JEE'/><category scheme='http://www.blogger.com/atom/ns#' term='Debug'/><category scheme='http://www.blogger.com/atom/ns#' term='Web application'/><category scheme='http://www.blogger.com/atom/ns#' term='J2EE'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><category scheme='http://www.blogger.com/atom/ns#' term='Netbeans'/><title type='text'>How to debug your web application in JBoss with Eclipse</title><content type='html'>&lt;div style="text-align: justify;"&gt;For many developers, debugging a web application simply means looking at the logs and trying to figure out what went wrong. Fortunately, there is an easier way. You can debug a web/JEE application the same way you debug a JSE or JME application.&lt;br /&gt;With today's IDEs you can also debug web/jee applications step by step,  while the application is deployed to an application server like JBoss. The following trick works with JBoss application server, please contribute for other application servers.&lt;br /&gt;OK, here is the trick. Open %&lt;span style="font-family:courier new;"&gt;JBOSS_HOME%/bin/&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;run.bat&lt;/span&gt; (Windows) or &lt;span style="font-family:courier new;"&gt;$JBOSS_HOME/bin/run.sh &lt;/span&gt;(Linux) and uncomment the line that contains the port &lt;span style="font-family:courier new;"&gt;8787&lt;/span&gt;, i.e. this line (by simply deleting the rem word in front):&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;rem set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family:georgia;"&gt;If you cannot find the line in &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;run.sh&lt;/span&gt;&lt;span style="font-family:georgia;"&gt;, try &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;$JBOSS_HOME/bin/run.conf.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;In your eclipse environment, click on the arrow next to the &lt;span style="font-weight: bold;"&gt;Debug&lt;/span&gt; button and select &lt;span style="font-weight: bold;"&gt;Debug...&lt;/span&gt; Select &lt;span style="font-weight: bold;"&gt;Remote Java Application&lt;/span&gt; and press the &lt;span style="font-weight: bold;"&gt;New&lt;/span&gt; button to create a new configuration of this type.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;In the &lt;span style="font-weight: bold;"&gt;Connect&lt;/span&gt; tab, browse your web / jee eclipse project, leave the connection type to Standard (Socket Attach) and enter the host name (localhost if it is local) but modify the port to 8787 (this is JBoss' debugging port). In the &lt;span style="font-weight: bold;"&gt;Source&lt;/span&gt; tab you may wish to add any dependent projects. Click on &lt;span style="font-weight: bold;"&gt;Apply. &lt;/span&gt;That's it.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div  style="text-align: justify;font-family:georgia;"&gt;Now all you need to do is start your JBoss application server, deploy before or after your war or ear file. The application server stops waiting for someone to listen to port 8787. Click on &lt;span style="font-weight: bold;"&gt;Debug&lt;/span&gt; or select the above configuration in the Debug window, and voila, JBoss continues starting up.&lt;br /&gt;&lt;br /&gt;Set your breakpoints etc. enjoy!&lt;br /&gt;&lt;br /&gt;P.S. Netbeans has very good debugging integration with most of the application servers. If your application server is not listed in its list of available application servers, simply define it under &lt;span style="font-weight: bold;"&gt;Tools --&gt; Server.&lt;br /&gt;&lt;br /&gt;References&lt;br /&gt;&lt;/span&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://wiki.jboss.org/wiki/Wiki.jsp?page=MonitorARemoteJbossServerFromEclipse"&gt;Monitoring a remote JBoss Server from Eclipse&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-2262971728531657278?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/2262971728531657278/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=2262971728531657278' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/2262971728531657278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/2262971728531657278'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2008/02/how-to-debug-your-web-application-in.html' title='How to debug your web application in JBoss with Eclipse'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-4671030285716278670</id><published>2007-12-17T00:17:00.000-08:00</published><updated>2008-11-23T10:56:54.283-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javapolis 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='javapolis java conference'/><title type='text'>Javapolis 2007</title><content type='html'>&lt;div style="text-align: justify;"&gt;This was my first time in a &lt;a href="http://www.javapolis.com/"&gt;Javapolis &lt;/a&gt;event. Javapolis, like JavaOne, is a  fiest of Java. It is not only the new knowledge that one acquires from the  various presentations, which are going to be available from &lt;a href="http://parleys.com/"&gt;parleys.com&lt;/a&gt; anyway, but also the exhibition, exchanging ideas with other Java developers, meeting famous authors etc.  &lt;/div&gt;&lt;p style="text-align: justify;"&gt;This event was even more special because the legend, James Gosling himself, was there! 3000+ participants watched his speech live! &lt;a href="http://www.javapolis.com/"&gt;Javapolis&lt;/a&gt; takes place in Antwerp, Belgium,  every year since 2004. It is equal, or even better as some say, from JavaOne, in the US. I really had very good time all these five days,  from 10&lt;sup&gt;th&lt;/sup&gt; to 14&lt;sup&gt;th&lt;/sup&gt; of December.&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;Here is my point of view of the event, the program of which you can find &lt;a href="http://www.javapolis.com/confluence/display/JP07/Schedule"&gt;here&lt;/a&gt;. Unfortunately, there had been 5  parallel sessions so if you wished to attend more than one of them at the same  time, then you had a problem.&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="margin-top: 0.42cm; text-align: justify;"&gt;&lt;span style="font-family:Arial,sans-serif;"&gt;&lt;span style="font-size:130%;"&gt;Day 1  (University day)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;I chose to start my day with Maurice Naftalin's “Java Generics and  Collections” speech. Maurice is the author with an excellent book with the same  title. He presented a deep understanding on Generics issues, what  to do and what to avoid, e.g. problems like casts and instanceof, parametric  exceptions and problems with arrays. “Never ignore unchecked warnings” he said.  Generics may have not had the great acceptance in the Java community yet, but I  believe it is one of the positive additions of the language, and if you learn  how to use them correctly, you can get great benefits from them.&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;After the break, I didn't watch the 2&lt;sup&gt;nd&lt;/sup&gt; part on Collections, as I  also wanted to watch Sang Shin's “Introduction to Ajax”. Another excellent  speaker, Sang maintains the &lt;a href="http://www.javapassion.com/"&gt;Javapassion&lt;/a&gt; web site where he gives  lessons in Java for free! If you check his site you 'll see a lot of information  in almost every aspect of the language, and all this for free! Sang gave an  overview of the main Ajax toolkits like Dojo, GWT, jMaki, JSF 2.0 with Ajax  support etc. Amazing to watch this guy on stage.&lt;br /&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;After the lunch break, I attended “Seam in Action”. Seam is an extention to  JSF, and as the speakers said, Seam &lt;i&gt;is&lt;/i&gt; the new Struts. E.g. apart from  &lt;span style="font-style: italic;"&gt;Event&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;Session &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;Application&lt;/span&gt;, Seam also introduces the notions of &lt;span style="font-style: italic;"&gt;Page&lt;/span&gt;,  &lt;span style="font-style: italic;"&gt;Conversation &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;Business Process&lt;/span&gt;. It seems to be a good extension and  improvement upon JSF.&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;In the afternoon, I attended "BPM in action" using SoftwareAG's &lt;span style="font-style: italic;"&gt;webMethods  &lt;/span&gt;software, another tool for Business Process Modelling development.  Unfortunately, the demo didn't work and so wasn't demonstrated by the good  though speaker, Hilde Janssen.&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;Finally, I attended JetBrains' "Teamcity" tool. It seems to be an excellent  tool for teamworking. Mike Aizatsky, an excellent speaker, demonstrated, using simple and to the point slides, the benefits of using the tool, which is now in version 3 and you can  download it for free. E.g. one use of the tool is before the Version Control  system, where it checks whether your code compiles before submitting it to version  control. This way, you can be sure that only compiled versions are submitted to  version control.&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="margin-top: 0.42cm; text-align: justify;"&gt;&lt;span style="font-family:Arial,sans-serif;"&gt;&lt;span style="font-size:130%;"&gt;Day 2  (University day)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;In day 2, the exhibition kiosks were set in place. The conference sponsors,  like SUN, Adobe, Jboss, Intellij, Oracle, IBM and others, provided information  about their products, and gave gifts to the participants. The participants could  also participate in many video games and competitions. For example, the faster driver of a BMW emulator, brought by Cegeka, gained a PSP each day. JavaBlackBelt also  had daily competitions; you had to answer 5 tricky multiple choice questions in  a limited time. Those who had the best score and finished earlier participated in  the finals for a PSP 3. And of course, Adobe, gave away O' Reilly books on  Flex 2 and ActionScript. And there were many more gifts from other sponsors.  This is the best part of Javapolis I think!&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;I began my second day with Bruce Eckel's presentation “Thinking in Flex”.  Bruce moved to Adobe for those who didn't know. It was great to watch the author  of one of the best Java books “Thinking in Java” live on the stage. Along with  the help of Christophe Rooms, they presented Adobe Flex. It was a very good  presentation and Flex 2 is a very impressive tool that now works with Java as  the back end. I wish Java had the same impressive GUI components as Adobe Flex  does. I avoided developing in Flash all these years because, however impressive  the result of a Flash application is, the code is difficult to maintain.  But with Flex and ActionScript you can create impressive Flash applications with a  powerful scripting language that is easy to maintain. Even though a proprietary  product, I 'll definitely give it a try. The new version of &lt;a href="http://parleys.com/"&gt;parleys.com&lt;/a&gt; is going to be built with this tool!&lt;br /&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;“JavaFX in Action” by Jim Weaver was my next attendance. I don't know if you  have noticed, but there is a plethora or scripting languages nowadays and many  more are developed. See e.g. Perl, PHP, Ruby, JavaScript, ActionScript, Wicket just to  name a few. And many developers prefer to develop faster using a scripting  languages. For many, scripting languages are the future of programming. Java's  answer is JavaFX, a scripting language based in Java that allows you to develop  quickly from swing applications for desktops, to mobile, or even  web applications. SUN seems to have put a lot of effort in this new language, so  I 'll give it a try and I suggest you do too.&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;In the afternoon I watched “Developing software like a band plays Jazz”  presented by another legend, Erich Gamma, one of Gang of Four guys. Now employed  by IBM, he presented Jazz, a collaboration product for enterprises. Erich  addressed one of the main problems in companies today, lack of collaboration,  which this tool addresses. Even though I didn't like the presentation, this  tool seems to be of great help to software teams. And, it is an IBM  product.&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="margin-top: 0.42cm; text-align: justify;"&gt;&lt;span style="font-family:Arial,sans-serif;"&gt;&lt;span style="font-size:130%;"&gt;Day 3  (Conference day)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;The day started with the speech of the father of Java, James Gosling, after a  welcome by the event's responsible, Stephan Janssen, president of BeJUG, and an  uncoference kick-off by Bruce Eckel. Three conference rooms where full just to  watch the legend. The father of Java shared impressive statistics with the  audience: 5 million Java enabled devices worldwide, 6 million Java developers,  12 million JRE downloads per week, 4 million Netbeans and 2.5 million Glassfish  downloads. “If you are still using Emacs, then go shoot yourself”, said James,  announcing Netbeans version 6.0. This new version has support for not only Java  but also for Ruby, C++, Javascript and PHP. And as I say to my friends who use  Visual Studio, just go and download Netbeans to see how Visual Studio 2012 is  going to be like! James, also showed some impressive statistics regarding the  speed of Java 6.0 which is now equal in speed or even outperforms C++! Far  behind is C#, which is still very slow in all benchmarks. Finally, the father of  Java asked the community to download and try JavaFX, where SUN puts a lot of  effort in. We watched a couple of applications on Java, such as a very  impressive demo of navigating two robots!&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;After this impressive beginning, the rest of the day continued with a  presentation of “SoapUI”, a very good commercial product to test SOA  applications, something that was actually missing from SOA apps.&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;“Google Web Toolkit” gave a nice overview of GWT also through the  presentation of OpenSocial, an application developed by GWT.&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;The afternoon sessions were far more interesting. Instead of “Scrum in  practice for non-believers”, &lt;a href="http://parleys.com/display/PARLEYS/Home#title=Project%20anti-patterns.%20How%20to%20make%20your%20project%20fail;talk=16285749;slide=1"&gt;Sander Hoogendoom&lt;/a&gt; gave a presentation on Anti-management  practices or how to make your project fail! An excellent presentation that shows  the reality in most software projects, and what to avoid to make your project  succeed, or rather fail, in the speaker's words. He successfully presented  common syndromes encountered today in project managers, architects, developers etc. The presentaiton is live on &lt;a href="http://parleys.com/display/PARLEYS/Home#title=Project%20anti-patterns.%20How%20to%20make%20your%20project%20fail;talk=16285749;slide=1"&gt;parleys&lt;/a&gt;.&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;The last presentation of the day was actually a Q&amp;amp;A with James Gosling,  Joshua Bloch, Neal Gafter and Martin Odersky were the speakers answered  questions posed by the audience. Not very successful in my opinion though.&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="margin-top: 0.42cm; text-align: justify;"&gt;&lt;span style="font-family:Arial,sans-serif;"&gt;&lt;span style="font-size:130%;"&gt;Day 4  (Conference day)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;The 2&lt;sup&gt;nd&lt;/sup&gt; conference day also started dynamically with a  presentation of Adobe Flex by Bruce Eckel, followed by a speech of the  Javapolis' creator, Stephan Janssen, who presented &lt;a href="http://parleys.com/"&gt;parleys.com&lt;/a&gt; version 2, built on Adobe Flex, and a  keynote on JavaFX by Tim Cramer. We had the chance to see the  possibilities of Netbeans 6 in developing mobile applications. Did you know that  JME now comes with a games engine for mobile game applications?&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;After the break, I watched JPA 2.0 by Linda Demichiel, the chief architect of  JPA at SUN Microsystems. With 20 years experience in IT, she gave an overview of  JPA's new features and future work on it. &lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;After the lunch break, the day was devoted to Joshua Bloch, an excellent  speaker and author! The author of the most popular Java book “Effective Java”,  changed his initial presentation and gave a presentation on Closures, a feature to be  added to Java 7. Closures will allow to pass whole piece of code from one method  to another. The speaker presented his skeptisism about this new feature and said  that the language has already become too complicated to add yet another such  complicated feature. And I wouldn't agree more with him. How many developers  actually use most of Java 5's new features? Many still have problems to even  understand Generics. Personally, I don't find Closures to be a useful addition  to the language. We developers need the language to help us in solving our  business or scientific problems in a simple and easy way, and I cannot see how  Closures can help us in that. I don't see why to add a feature that will be used  rarely or not at all by most of us. I would prefer to see improvements in the  existing language syntax, like simplification or best practices of use of the features of the language, properties, even better performance etc.&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;Emmanuel Bernard gave next a presentation on “Hibernate search” or how to use  Hibernate with Lucene to do efficient and effective full text searching. &lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;Mark Janssen, author of “&lt;a href="http://soabook.com/"&gt;SOA using Java Web  Services&lt;/a&gt;” book, gave a technical overview of how to develop web services  with Java.&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;The day had the best ending ever with “The Java puzzlers” show by Joshua  Bloch and Neal Gafter. Dressed with uniforms from Star Wars, they started their  show by “fencing” with their “light pointers”! Each one of them posed  alternatively 4 Java puzzlers to the other, and the audience had to answer which  one of the 4 multiple answers was correct. These were new puzzlers to be added  to “Java Puzzlers” version 2 book. If you haven't got this excellent book yet, what are you waiting for? Many participants bought it with 20% discount  from the kiosk in the exhibition hall after this presentation!&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;This was the best day of the conference, ended with many more gifts, and  competitions by the sponsor companies, as this was the last day of the  exhibition. The day finshed by watching the movie “BeoWulf”. &lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="margin-top: 0.42cm; text-align: justify;"&gt;&lt;span style="font-family:Arial,sans-serif;"&gt;&lt;span style="font-size:130%;"&gt;Day 5  (Conference day)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;The last day of the conference lasted only half a day and was not as good as  the previous ones. “Wicket2”, presented by Martjin Dashorst, seems to be another  very cool framework for building web applications using simply Wicket scripting  language inside HTML for the presentation layer and Java for the business logic.  No complicated things like JEE and EJB. Very promising framework which I 'll  give it a try.&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;The rest presentations of the day were not that interesting. I started with  OSGi, but I found the presentation rather boring and then left to watch  “Innovating with Java” which I didn't find interesting either. &lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;“Testing Driven Development” by the author Lasse Koskela of the book with the  same name as the presentation, didn't say many new things to what I already  know.&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;Thus, the conference finished.&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;A few final comments. The food was awful. An event, or something could also  have been organised the last day of the conference to give us a better feeling  of the last day and keep up our interest. Free drinks, like coke, sprite, water, even beer, were offered  all five days. The exhibition was great!&lt;/p&gt;&lt;div style="text-align: justify;"&gt; &lt;/div&gt;&lt;p style="text-align: justify;"&gt;You can watch all presentations from &lt;a href="http://parleys.com/"&gt;parleys.com&lt;/a&gt; when they become available. But of  course, the value is to attend the conference, to live the excitement of these  five days, to meet new people with same interests, to participate in the  competitions and games, to get all these gifts, T-shirts, Cds, coffee cups,  pens, bags etc. This is the spirit of Javapolis. See you there next year.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-4671030285716278670?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/4671030285716278670/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=4671030285716278670' title='1 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/4671030285716278670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/4671030285716278670'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2007/12/javapolis-2007.html' title='Javapolis 2007'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-3416496294946774990</id><published>2007-10-11T04:34:00.000-07:00</published><updated>2008-11-10T06:16:13.353-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Greek'/><category scheme='http://www.blogger.com/atom/ns#' term='Tomcat'/><title type='text'>Greek and Java</title><content type='html'>Under this subject I publish any issues that a Java programmer may encounter with Greek letters while writing Java programs. This information might be useful to programmers of other native languages too.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Issue 1: Apache Tomcat doesn't display Greek&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Instead ???? are displayed.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution&lt;/span&gt;&lt;br /&gt;You have to perform the following steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Edit &lt;span style="font-family:courier new;"&gt;conf/server.xml&lt;/span&gt; like so:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;connector port="8080" maxhttpheader="8192" maxthreads="150" minsparethreads="25" maxsparethreads="75" enablelookups="false" redirectport="8443" acceptcount="100" connectiontimeout="20000" disableuploadtimeout="true" &lt;span style="font-weight: bold;"&gt;URIEncoding="ISO-8859-7"&lt;/span&gt;&lt;/code&gt; or &lt;code&gt;&lt;span style="font-weight: bold;"&gt;URIEncoding="UTF-8"&lt;/span&gt;&lt;span style="font-family:georgia;"&gt; depending on your application.&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;If you are using a servlet, then you have to add the following lines of code to your doGet() method:&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;code&gt;request.setCharacterEncoding("ISO-8859-7");   // or UTF-8&lt;br /&gt;response.setCharacterEncoding("ISO-8859-7");  // or UTF-8&lt;/code&gt;&lt;br /&gt;&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;If you are using a JSP, then you must include the following header on the beginning of the jsp page:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"&lt;/code&gt;&lt;code&gt;%&gt;    // or ISO-8859-7&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style=";font-family:georgia;font-size:100%;"  &gt;You may need to add this line too&lt;/span&gt;&lt;br /&gt;&lt;meta equiv="Content-Type" content="text/html; charset=UTF-8"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;code&gt;// or ISO-8859-7&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style=";font-family:georgia;font-size:100%;"  &gt;In case the encoding of the GET command is different than the one in URIEncoding (e.g. &lt;span style="font-family:courier new;"&gt;ISO-8859-7&lt;/span&gt; and &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span&gt;URIEncoding="UTF-8"&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:georgia;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:georgia;"&gt;, then use the command &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span class="postbody"  style="font-family:courier new;"&gt;request.getQueryString()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:georgia;font-size:100%;"  &gt; to get the original query string, before this is changed by Tomcat's URIEncoding, manually parse the string to a variable, e.g. &lt;span style="font-family:courier new;"&gt;myVar&lt;/span&gt;, and then use e.g. &lt;/span&gt;&lt;span class="postbody"  style="font-family:courier new;"&gt;URLDecoder.decode(myvar, "ISO-8859-7")&lt;/span&gt;.&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;i style="font-weight: bold;"&gt;Note&lt;/i&gt;: This info applies to JBoss too, as it is based on Tomcat.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-weight: bold;"&gt;References&lt;/span&gt;:&lt;/i&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://www.jhug.gr/phpnuke/PHP-Nuke-6.5/html/modules.php?name=Forums&amp;amp;file=viewtopic&amp;amp;t=937&amp;amp;highlight=tomcat+%CE%B5%CE%BB%CE%BB%CE%B7%CE%BD%CE%B9%CE%BA%CE%AC"&gt;JHUG forum link&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://wiki.apache.org/tomcat/Tomcat/UTF-8"&gt;Apache Tomcat wiki&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.joelonsoftware.com/articles/Unicode.html"&gt;The absolute minimum about Unicode and Character Sets&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Issue 2: Greek support in Eclipse IDE&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Right click an eclipse project and select &lt;span style="font-family:courier new;"&gt;Properties&lt;/span&gt;. In the &lt;span style="font-family:courier new;"&gt;info &lt;/span&gt;property, under &lt;span style="font-family:courier new;"&gt;Text file encoding&lt;/span&gt; box, select one of the following encodings:&lt;br /&gt;&lt;ul&gt;&lt;li style="font-family: courier new;"&gt;ISO-8859-7&lt;/li&gt;&lt;li style="font-family: courier new;"&gt;Cp1253&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;UTF-8&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;Issue 3: Greek support in Netbeans IDE&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Right click on a project and select &lt;span style="font-family:courier new;"&gt;Properties&lt;/span&gt;. In the &lt;span style="font-family:courier new;"&gt;Encoding &lt;/span&gt;property, select one of the following encodings:&lt;br /&gt;&lt;ul&gt;&lt;li style="font-family: courier new;"&gt;ISO-8859-7&lt;/li&gt;&lt;li style="font-family: courier new;"&gt;Windows-1253&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;UTF-8&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;Issue 4: Greek support in MySQL&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Use one of the following collations: &lt;span style="font-family:courier new;"&gt;utf8_unicode_ci&lt;/span&gt; or &lt;span style="font-family:courier new;"&gt;utf8_general_ci&lt;/span&gt;. Charset should be &lt;span style="font-family:courier new;"&gt;UTF-8&lt;/span&gt;.&lt;br /&gt;If you are using &lt;span style="font-family:courier new;"&gt;phpmyadmin&lt;/span&gt;,  you can do this while creating the database. If you have already created the database, you can change its collation by clicking on &lt;span style="font-family:courier new;"&gt;Operations &lt;/span&gt;tab.&lt;br /&gt;If you can still not see Greek, edit &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;my.conf &lt;/span&gt;&lt;/span&gt;and under &lt;span class="postbody"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;[mysqld]&lt;/span&gt;&lt;/span&gt; tag add the string&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;character-set-server = utf8&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;To use together with Tomcat:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;code&gt;url="jdbc:mysql://localhost/timesheet?useUnicode=true;characterEncoding=utf8" // or ISO-8859-7&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;Issue 5: Define encoding&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Whenever you open/save a text file, specify the character encoding and don't rely on the OS default encoding:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;Reader r = new InputStreamReader(new FileInputStream(file), "UTF-8"); // ISO-8859-7&lt;br /&gt;Reader r = new InputStreamWriter(new FileInputStream(file), Charset.forName("ISO-8859-7"));&lt;br /&gt;Writer w = new OutputStreamWriter(new FileOutputStream(file), "ISO-8859-7"); // UTF-8&lt;br /&gt;Writer w = new OutputStreamWriter(new FileOutputStream(file), Charset.forName("UTF-8"));&lt;br /&gt;String s = new String(byteArray, "UTF-8");&lt;br /&gt;byte[] a = string.getBytes("UTF-8");    // Cp1253&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Issue 6: Greek locale&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;private static final Locale GREEK_LOCALE = new Locale("el", "GR");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Issue 7: Greek and JEditorPane&lt;br /&gt;&lt;/span&gt;Unfortunately, &lt;span style="font-family:courier new;"&gt;JEditorPane &lt;/span&gt;supports HTML 3.2 (to some arguable extend), while named Greek entities were added in HTML 4.0. This means, that&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;jEditorPane.setContentType("text/html"); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;jEditorPane.setText("αβγδ"); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;System.out.println(jEditorPane.getText());&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;will not return the Greek characters but something like&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#965;#966;#967;#968&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can try&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;jEditorPane.setContentType("text/html;charset=utf-8"); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;jEditorPane.setText(new String("αβγδ".getBytes("utf-8"),"utf-8"); &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;but it still doesn't work.&lt;br /&gt;&lt;br /&gt;A solution is simply to use&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;jEditorPane.setContentType("text/plain"); &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In any case, it is better to handle the text from the variable it is stored than getting it from &lt;span style="font-family:courier new;"&gt;jEditorPane.getText().&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;span style="font-weight: bold;"&gt;References&lt;/span&gt;:&lt;/i&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://www.jhug.gr/phpnuke/PHP-Nuke-6.5/html/modules.php?name=Forums&amp;amp;file=viewtopic&amp;amp;t=937&amp;amp;highlight=tomcat+%CE%B5%CE%BB%CE%BB%CE%B7%CE%BD%CE%B9%CE%BA%CE%AC"&gt;&lt;/a&gt;&lt;a href="http://www.odi.ch/prog/design/newbies.php#7"&gt;Java Anti-Patterns&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-3416496294946774990?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/3416496294946774990/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=3416496294946774990' title='1 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/3416496294946774990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/3416496294946774990'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2007/10/greek-and-java.html' title='Greek and Java'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-4322982484817858319</id><published>2007-09-26T00:35:00.000-07:00</published><updated>2007-10-11T04:32:37.340-07:00</updated><title type='text'>Simple suggestions for 'team' programming</title><content type='html'>Most programmers think that they are unique, that the way they program is the best, and they program only for themselves. This selfish attitude, however, does more bad than good. Working as a team has more advantages, less individual work, better cooperation to achieve deadlines, just to name a few, so why don't we (developers) learn how to cooperate?&lt;br /&gt;Here I put four suggestions, which are so obvious to me, but I don't know why most programmers don't wish to follow:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Use and apply design patterns; they help better communication between the team as the provide for a common language; not to mention all the other advantages they provide, like extensible code, program to an interface etc.;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Don't hesitate to write javadoc and comments; they save another developer that looks at your methods and classes much time to know what it does than having to go through the code to realise what an uncommented method does;&lt;/li&gt;&lt;li&gt;Write test cases; they are mainly for documentation; they show another developer what is the input to a method and what to expect as an output than having to guess each time, especially when there is no javadoc;&lt;/li&gt;&lt;li&gt;Use this *bloody* CVS/SVN of yours correctly; add a comment each time you do a modification letting others know what you did and why. E.g. another guy just erased (or moved to another eclipse project) some classes in the team I work, and he never writes anything in CVS, letting me in nowhere of knowing why he did that and he 's too busy to ask.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;If you have never heard of design patterns, then here are some references you may find useful:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Gamma E., Helm R., Johnson R., Vlissides J. (1995), &lt;span style="font-style: italic;"&gt;Design Patterns – Elements of reusable components&lt;/span&gt;, Addison-Wesley.&lt;/li&gt;&lt;li&gt;Vlissides J. (1998), &lt;span style="font-style: italic;"&gt;Pattern Hatching,&lt;/span&gt; Addison-Wesley.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Freeman, E. &amp;amp; Freeman, E. (2004), &lt;i&gt;Head First Design Patterns,&lt;/i&gt; O’ Reilly.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Eckel, B. (2003), &lt;i&gt;Thinking in Patterns with Java, &lt;/i&gt;&lt;a href="http://mindview.net/Books/TIPatterns/" target="_parent"&gt;http://mindview.net/Books/TIPatterns/&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;JavaCamp, &lt;a href="http://javacamp.org/designPattern/index.html" target="_parent"&gt;http://javacamp.org/designPattern/index.html&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Wikipedia, &lt;a href="http://en.wikipedia.org/wiki/Design_Patterns"&gt;http://en.wikipedia.org/wiki/Design_Patterns&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;Write javadoc comments even to package or private methods explaining the algorithm that you use, any reference to a web site or book, and of course reference back to the use case or requirement that forced you to write this method. In eclipse it is also very easy to produce the html API by clicking on the project in package explorer and then to menu &lt;span style="font-family:courier new;"&gt;Project --&gt; Generate Javadoc&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Creating junit test cases is also very easy with eclipse, just right click on the class you wish to test and choose &lt;span style="font-family:courier new;"&gt;New --&gt; JUnit Test Case&lt;/span&gt;. Eclipse will ask you of the methods that you wish to test and will create the skeleton for you.&lt;br /&gt;&lt;br /&gt;Next time you write a piece of code, think that you don't write it for yourself, but also for others who might review it or continue from where you left or need to modify it. Stop thinking selfishly; it doesn't help.&lt;br /&gt;&lt;br /&gt;Heinz Kabutz also gave an interview on becoming a Better Programmer in &lt;a href="http://java.sun.com/developer/technicalArticles/Interviews/community/kabutz_qa.html"&gt;SUN's website&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-4322982484817858319?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/4322982484817858319/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=4322982484817858319' title='1 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/4322982484817858319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/4322982484817858319'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2007/09/simple-suggestions-for-team-programming.html' title='Simple suggestions for &apos;team&apos; programming'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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-5488862533782141445.post-8225016630882755421</id><published>2007-09-13T01:23:00.000-07:00</published><updated>2007-09-20T07:16:16.240-07:00</updated><title type='text'>Secrets of Concurrency (Part 1) -- The Law of the Ritalin Child</title><content type='html'>&lt;div style="text-align: justify;"&gt;Do you read Heinz Kabutz's &lt;a href="http://www.javaspecialists.eu/archive/archive.jsp"&gt;newsletter&lt;/a&gt;? I do, even though I don't always understand what a Java Champion such as Heinz means. :-) As I 'm not a Java champion and I don't think I 'll ever be, I sometimes spend quite a lot of time to follow Java champions' newsletters, speeches etc. :-)&lt;br /&gt;This happened with his &lt;a href="http://www.javaspecialists.eu/archive/Issue146.html"&gt;issue 146&lt;/a&gt;, "&lt;span style="font-style: italic;"&gt;Secrets of Concurrency (Part 1) -- The Law of the Ritalin Child&lt;/span&gt;". To understand this newsletter, on a difficult topic such as threads, I had to create some drawings on a piece of paper. So, for all the rest of you who didn't understand exactly what that issue says, or who didn't bother to look more seriously into it, here I put a drawing and my understanding of it.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;So, back to our subject. The first question Heinz poses in his newsletter is what does &lt;code&gt;InterruptedException&lt;/code&gt;  mean?&lt;br /&gt;Let's first examine when an &lt;code&gt;InterruptedException&lt;/code&gt; is thrown. A thread can be in any one of the states that are shown in the following state transition diagram, i.e. &lt;code&gt;NEW, RUNNABLE, BLOCKED, WAITING, TIMED_WAITING&lt;/code&gt; and &lt;code&gt;TERMINATED&lt;/code&gt;. See &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.State.html"&gt;&lt;b&gt;java.lang.Thread.State&lt;/b&gt;&lt;/a&gt; if you don't believe me.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_rfX28kGqbFM/RulIKyJMslI/AAAAAAAAAAc/plzyl-ogwE8/s1600-h/thread-states.png"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_rfX28kGqbFM/RulIKyJMslI/AAAAAAAAAAc/plzyl-ogwE8/s320/thread-states.png" alt="" id="BLOGGER_PHOTO_ID_5109694602324783698" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Now, assume that our thread, lets call it &lt;code&gt;thisThread&lt;/code&gt;,  is in the &lt;code&gt;RUNNABLE &lt;/code&gt;state. Heinz says that&lt;br /&gt;"[i]f the thread is not in a waiting state, then &lt;span style="font-style: italic;"&gt;only the interrupted status is set&lt;/span&gt;, nothing else."&lt;br /&gt;I.e., if &lt;code&gt;thisThread&lt;/code&gt;'s state is &lt;code&gt;RUNNABLE&lt;/code&gt;, and it calls its &lt;code&gt;interrupt()&lt;/code&gt; method, the only thing that happens is that &lt;code&gt;thisThread.interrupted=true&lt;/code&gt;. In other words:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;code&gt;// thisThread is in RUNNABLE state&lt;br /&gt;// when&lt;br /&gt;thisThread.interrupt();&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;/code&gt; then the following occurs:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;thisThread.interrupted=true;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;"If the thread is currently in either the WAITING or TIMED_WAITING states, it immediately causes an InterruptedException and returns from the method that caused the waiting state."&lt;br /&gt;I.e., if &lt;code&gt;thisThread&lt;/code&gt;'s state is either &lt;code&gt;WAITING&lt;/code&gt; or &lt;code&gt;TIMED_WAITING&lt;/code&gt;, and its &lt;code&gt;interrupt()&lt;/code&gt; method is called,&lt;span style="font-family:monospace;"&gt; &lt;/span&gt;&lt;code&gt;&lt;/code&gt;it throws an &lt;code&gt;InterruptedException&lt;/code&gt; and returns from the method that caused the waiting state. Its &lt;code&gt;interrupted&lt;/code&gt; status should already be &lt;code&gt;true&lt;/code&gt;. However, as we shall see later, when an &lt;code&gt;InterruptedException&lt;/code&gt; is thrown, the &lt;code&gt;interrupted &lt;/code&gt;status of the thread is flipped back to &lt;code&gt;false&lt;/code&gt;. In other words:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;code&gt;// &lt;/code&gt;&lt;code&gt;thisThread&lt;/code&gt; is in &lt;code&gt;WAITING or TIMED_WAITING&lt;/code&gt; state&lt;br /&gt;&lt;code&gt;// when&lt;br /&gt;thisThread.interrupt();&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;then an &lt;code&gt;InterruptedException&lt;/code&gt; is thrown and&lt;br /&gt;&lt;code&gt;thisThread.interrupted=false;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;"However, if later on the thread calls a method that would change the state into WAITING or TIMED_WAITING, the InterruptedException is immediately caused and the method returns."&lt;br /&gt;I.e. if &lt;code&gt;thisThread.interrupted=true&lt;/code&gt;, because its &lt;code&gt;interrupt()&lt;/code&gt; method was called previously, and &lt;code&gt;thisThread&lt;/code&gt; called a method that causes a state transition to one of either &lt;code&gt;WAITING&lt;/code&gt; or &lt;code&gt;TIMED_WAITING&lt;/code&gt; states, then, because &lt;code&gt;thisThread.interrupted&lt;/code&gt; is already &lt;code&gt;true&lt;/code&gt;, an &lt;code&gt;InterruptedException&lt;/code&gt; is immediately thrown and its state remains to &lt;code&gt;RUNNABLE&lt;/code&gt;. In other words:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;code&gt;// thisThread is in RUNNABLE state&lt;br /&gt;&lt;/code&gt;&lt;code&gt;thisThread.interrupted=true;&lt;br /&gt;// when&lt;br /&gt;&lt;/code&gt;&lt;code&gt;thisThread.wait();&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;then&lt;br /&gt;&lt;br /&gt;&lt;code&gt;thisThread.State=RUNNABLE&lt;/code&gt;&lt;br /&gt;an &lt;code&gt;InterruptedException&lt;/code&gt; is thrown and&lt;br /&gt;&lt;code&gt;thisThread.interrupted=false;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;But how can &lt;code&gt;&lt;/code&gt;&lt;code&gt;thisThread&lt;/code&gt; &lt;code&gt;&lt;/code&gt;change its state to &lt;code&gt;WAITING or TIMED_WAITING&lt;/code&gt;? By calling one of the following methods: &lt;code&gt;wait(), Thread.sleep(), BlockingQueue.get(), Semaphore.acquire()&lt;/code&gt; and &lt;code&gt; Thread.join()&lt;/code&gt;.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;E.g.&lt;br /&gt;&lt;code&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;try&lt;/span&gt;&lt;/b&gt; {&lt;br /&gt;Thread.sleep(&lt;span style="color: rgb(0, 0, 255);"&gt;1000&lt;/span&gt;); &lt;i&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;// 1 second&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;} &lt;b&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;catch&lt;/span&gt;&lt;/b&gt;(InterruptedException ex) {&lt;br /&gt;&lt;i&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;  // ignore - won't happen&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;}&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;"Note that attempting to lock on a monitor with     &lt;code&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;synchronized&lt;/span&gt;&lt;/b&gt;&lt;/code&gt; puts the thread in     BLOCKED state, not in WAITING nor TIMED_WAITING.     Interrupting a thread that is blocked will do nothing except     set the interrupted status to true.  You cannot stop a thread     from being blocked by interrupting it.  Calling     the &lt;code&gt;stop()&lt;/code&gt; method similarly has no effect when a     thread is blocked.  "&lt;br /&gt;OK? Did you get that? If &lt;code&gt;thisThread.State=BLOCKED&lt;/code&gt;, calling its &lt;code&gt;interrupt()&lt;/code&gt; method, simply causes &lt;code&gt;thisThread.interrupted=true&lt;/code&gt; while calling its &lt;code&gt;stop()&lt;/code&gt; method has no effect.&lt;br /&gt;&lt;br /&gt;The interrupted status is nowadays commonly used to indicate     when a thread should be shut down because it is thrown at well defined places that wouldn't cause any problems, not like &lt;code&gt;Thread.stop()&lt;/code&gt; method. The problem with the     &lt;code&gt;Thread.stop()&lt;/code&gt; method was that it would cause     an asynchronous exception at any point of the thread's     execution code.&lt;br /&gt;&lt;br /&gt;"Note that the interrupted status is set to false when an     InterruptedException is caused or when the     &lt;code&gt;Thread.interrupted()&lt;/code&gt; method is explicitly     called.  Thus, when we catch an InterruptedException, we need     to remember that the thread is now not interrupted anymore!     In order to have orderly shutdown of the thread, we should     keep the thread set to "interrupted"."&lt;br /&gt;&lt;br /&gt;So, what should we do when we call code that may cause an     InterruptedException? Heinz has two answers on this:&lt;br /&gt;&lt;/div&gt;&lt;ol&gt;&lt;li style="text-align: justify;"&gt;&lt;b&gt;Rethrow the InterruptedException from your method.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Catch it, set interrupted status, return&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;E.g.&lt;br /&gt;&lt;pre&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;while&lt;/span&gt;&lt;/b&gt; (!Thread.currentThread().isInterrupted()) {&lt;br /&gt;&lt;i&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;   // do something&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;   try&lt;/span&gt;&lt;/b&gt; {&lt;br /&gt;TimeUnit.SECONDS.sleep(&lt;span style="color: rgb(0, 0, 255);"&gt;1000&lt;/span&gt;);&lt;br /&gt;} &lt;b&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;catch&lt;/span&gt;&lt;/b&gt; (InterruptedException e) {&lt;br /&gt;Thread.currentThread().interrupt();&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;      break&lt;/span&gt;&lt;/b&gt;;&lt;br /&gt;}&lt;br /&gt;}&lt;/pre&gt;&lt;div style="text-align: justify;"&gt;Remember! Don't just ignore     interruptions, deal with the cause!&lt;br /&gt;&lt;br /&gt;So, to recap:&lt;br /&gt;&lt;/div&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt;if a thread is in &lt;code&gt;RUNNABLE&lt;/code&gt; state and its &lt;code&gt;interrupt()&lt;/code&gt; method is called, its &lt;code&gt;interrupted&lt;/code&gt; status changes to &lt;code&gt;true&lt;/code&gt;;&lt;/li&gt;&lt;li&gt;if a thread is in &lt;code&gt;WAITING&lt;/code&gt; or &lt;code&gt;TIMED_WAITING&lt;/code&gt; state and its &lt;code&gt;interrupt()&lt;/code&gt; method is called, it throws an &lt;code&gt;InterruptedException&lt;/code&gt; and its &lt;code&gt;interrupted&lt;/code&gt; status changes back to &lt;code&gt;false&lt;/code&gt;;&lt;/li&gt;&lt;li&gt;if a thread is in &lt;code&gt;RUNNABLE&lt;/code&gt; state and one of its methods that changes its state to &lt;code&gt;WAITING&lt;/code&gt; or &lt;code&gt;TIMED_WAITING&lt;/code&gt; is called, and, previously its &lt;code&gt;interrupted&lt;/code&gt; status has been set to &lt;code&gt;true&lt;/code&gt; by a call to its &lt;code&gt;interrupt()&lt;/code&gt; method, then an &lt;code&gt;InterruptedException&lt;/code&gt; is thrown, its state changes to &lt;code&gt;RUNNABLE&lt;/code&gt; &lt;code&gt;&lt;/code&gt; and its &lt;code&gt;interrupted&lt;/code&gt; status changes back to &lt;code&gt;false&lt;/code&gt;;&lt;/li&gt;&lt;li&gt;finally, if a thread is in &lt;code&gt;BLOCKED&lt;/code&gt; state and its &lt;code&gt;interrupt()&lt;/code&gt; method is called, its &lt;code&gt;interrupted&lt;/code&gt; status changes to &lt;code&gt;true&lt;/code&gt;; while nothing seems to happen when its &lt;code&gt;stop()&lt;/code&gt; method is called. (It seems that if there is a lot of contention for locks, the stop signals get lost).&lt;/li&gt;&lt;/ul&gt;Actually, for the last case, this can be checked by the following piece of code (contributed by Heinz):&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;public class&lt;/span&gt; CheckBlocking {&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;   &lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;public static void&lt;/span&gt; &lt;/span&gt;main(String[] args) &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;throws &lt;/span&gt;InterruptedException {&lt;br /&gt; Thread t1 = &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;new &lt;/span&gt;Thread() {&lt;br /&gt; &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;public void&lt;/span&gt; run() {&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;while &lt;/span&gt;(&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;true&lt;/span&gt;) {&lt;br /&gt;     System.out.println("t1");&lt;br /&gt;     &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;synchronized &lt;/span&gt;(CheckBlocking.class) {&lt;br /&gt;      &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;try &lt;/span&gt;{&lt;br /&gt;        CheckBlocking.&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;class&lt;/span&gt;.wait(10000);&lt;br /&gt;      } &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;catch &lt;/span&gt;(InterruptedException e) {&lt;br /&gt;        interrupt();&lt;br /&gt;        &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;return&lt;/span&gt;;&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;Thread t2 = &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;new &lt;/span&gt;Thread() {&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;public void&lt;/span&gt; run() {&lt;br /&gt; &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;while &lt;/span&gt;(&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;true&lt;/span&gt;) {&lt;br /&gt;  System.out.println("t2 blocked");&lt;br /&gt;    &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;synchronized &lt;/span&gt;(CheckBlocking.class) {&lt;br /&gt;      System.out.println("t2");&lt;br /&gt;      &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;try &lt;/span&gt;{&lt;br /&gt;        CheckBlocking.&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;class&lt;/span&gt;.wait(950);&lt;br /&gt;      } catch (InterruptedException e) {&lt;br /&gt;        interrupt();&lt;br /&gt;        &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;return&lt;/span&gt;;&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;t1.start();&lt;br /&gt;Thread.sleep(2000);&lt;br /&gt;t2.start();&lt;br /&gt;Thread.sleep(2000);&lt;br /&gt;t2.stop();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;If you run this code, you will notice that no exception is thrown. It gets lost somewhere.&lt;br /&gt;&lt;br /&gt;Thanks Heinz.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;For those of you who want to learn about Java threads, I would recommend "&lt;span style="font-style: italic;"&gt;Java concurrency in practice&lt;/span&gt;" by &lt;a class="v1" target="_new"&gt;Brian Goetz&lt;/a&gt;, &lt;a class="v1" target="_new"&gt;Tim Peierls&lt;/a&gt;, &lt;a class="v1" target="_new"&gt;Joshua Bloch&lt;/a&gt;, &lt;a class="v1" target="_new"&gt;Joseph Bowbeer&lt;/a&gt;, &lt;a class="v1" target="_new"&gt;David Holmes&lt;/a&gt;, &lt;a class="v1" target="_new"&gt;Doug Lea&lt;/a&gt;, the only book in my opinion that explains in plain english and allows you to understand what is going on in multithreading java and the strange behaviour of your multithreading programs, if you have encountered such.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-8225016630882755421?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/8225016630882755421/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=8225016630882755421' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/8225016630882755421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/8225016630882755421'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2007/09/secrets-of-concurrency-part-1-law-of.html' title='Secrets of Concurrency (Part 1) -- The Law of the Ritalin Child'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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://3.bp.blogspot.com/_rfX28kGqbFM/RulIKyJMslI/AAAAAAAAAAc/plzyl-ogwE8/s72-c/thread-states.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5488862533782141445.post-1128134157490797456</id><published>2007-09-12T02:32:00.000-07:00</published><updated>2007-10-30T04:19:01.677-07:00</updated><title type='text'>java.util.Formatter</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;span style="font-family:arial;"&gt;Since JDK 1.5, java has &lt;code&gt;java.util.Formatter &lt;/code&gt;class, an interpreter for printf-style format strings. However, the API for &lt;code&gt;java.util.Formatter &lt;/code&gt;is rather obscure to understand. This blog is to help you see each format command and its result and be able to use the most appropriate format string for your case right away, without the need to go through the long Java API for this class.&lt;br /&gt;&lt;br /&gt;The following info applies to:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;Formatter.format()&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;String.format()&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;java.io.PrintStream.format()&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;java.io.PrintWriter.format()&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;printf()&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;but String.format() is only shown here for convenience. The same arguments can be used for the other 2 methods.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Here is a test case to display the use of format strings for date/time. I use this date as an example: &lt;code&gt;07-01-2007 22:05:01 (7th of January 2007, my name day!)&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;import &lt;/span&gt;java.text.SimpleDateFormat;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;import &lt;/span&gt;java.util.Calendar;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;import &lt;/span&gt;junit.framework.TestCase;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;/**&lt;br /&gt;* Class to test java.util.Formatter&lt;br /&gt;* @author jkost&lt;br /&gt;* @see java.util.Formatter&lt;br /&gt;* @since JDK 1.5&lt;br /&gt;*/&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public class&lt;/span&gt; FormatterTester &lt;span style="color: rgb(51, 51, 255);"&gt;extends &lt;/span&gt;TestCase {&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    private final&lt;/span&gt; SimpleDateFormat sf = &lt;span style="color: rgb(51, 51, 255);"&gt;new &lt;/span&gt;SimpleDateFormat("dd-MM-yyyy hh:mm:ss");&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    private &lt;/span&gt;Calendar cal = Calendar.getInstance();&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    protected void&lt;/span&gt; setUp() &lt;span style="color: rgb(51, 51, 255);"&gt;throws &lt;/span&gt;Exception {&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; super&lt;/span&gt;.setUp();&lt;br /&gt;cal.setTime(sf.parse("07-01-2007 22:05:01"));&lt;br /&gt;}&lt;br /&gt;/**&lt;br /&gt;* Conversion characters for formatting dates.&lt;br /&gt;*&lt;br /&gt;*/&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    public void&lt;/span&gt; testDateFormatter() {&lt;br /&gt;// full day of week&lt;br /&gt;assertEquals("Sunday", String.format("%tA", cal));&lt;br /&gt;// abbreviated day of week&lt;br /&gt;assertEquals("Sun", String.format("%ta", cal));&lt;br /&gt;// full month name&lt;br /&gt;assertEquals("January", String.format("%tB", cal));&lt;br /&gt;// abbreviated month name&lt;br /&gt;assertEquals("Jan", String.format("%tb", cal));&lt;br /&gt;assertEquals("Jan", String.format("%th", cal));&lt;br /&gt;// the century, 00 to 99, i.e. year divided by 100&lt;br /&gt;assertEquals("20", String.format("%tC", cal));&lt;br /&gt;// day of month, 2-digit format&lt;br /&gt;assertEquals("07", String.format("%td", cal));&lt;br /&gt;// day of month, 1-digit format, i.e. without leading zeros&lt;br /&gt;assertEquals("7", String.format("%te", cal));&lt;br /&gt;// Date formatted as "m/d/y" (short numeric form)&lt;br /&gt;assertEquals("01/07/07", String.format("%tD", cal));&lt;br /&gt;// ISO 8601  complete date formatted as "Y-m-d".&lt;br /&gt;assertEquals("2007-01-07", String.format("%tF", cal));&lt;br /&gt;// 3-digit day of year&lt;br /&gt;assertEquals("007", String.format("%tj", cal));&lt;br /&gt;// 2-digit, month of year&lt;br /&gt;assertEquals("01", String.format("%tm", cal));&lt;br /&gt;// no week of year; SUN needs to implement this&lt;br /&gt;// assertEquals("01", String.format("%tw", cal));&lt;br /&gt;// 4-digit year&lt;br /&gt;assertEquals("2007", String.format("%tY", cal));&lt;br /&gt;// last 2 digits of year&lt;br /&gt;assertEquals("07", String.format("%ty", cal));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Conversion characters for formatting times.&lt;br /&gt;*&lt;br /&gt;*/&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    public void&lt;/span&gt; testTimeFormatter() {&lt;br /&gt;// 24-hour of day, 2-digit format, 00-23&lt;br /&gt;assertEquals("22", String.format("%tH", cal));&lt;br /&gt;// 12-hour of day, 2-digit format, 00-12&lt;br /&gt;assertEquals("10", String.format("%tI", cal));&lt;br /&gt;// 24-hour of day, 1-digit format, 0-23&lt;br /&gt;assertEquals("22", String.format("%tk", cal));&lt;br /&gt;// 12-hour of day, 1-digit format, 0-12&lt;br /&gt;assertEquals("10", String.format("%tl", cal));&lt;br /&gt;// minutes, 2-digit format, 00-59&lt;br /&gt;assertEquals("05", String.format("%tM", cal));&lt;br /&gt;// seconds, 2-digit format, 00-59&lt;br /&gt;assertEquals("01", String.format("%tS", cal));&lt;br /&gt;// milliseconds, 3-digit format, 000-999&lt;br /&gt;assertEquals("000", String.format("%tL", cal));&lt;br /&gt;// nanoseconds, 9-digit format, 000000000 - 999999999&lt;br /&gt;assertEquals("000000000", String.format("%tN", cal));&lt;br /&gt;// am or pm&lt;br /&gt;assertEquals("pm", String.format("%tp", cal));&lt;br /&gt;// AM or PM&lt;br /&gt;assertEquals("PM", String.format("%Tp", cal));&lt;br /&gt;// RFC 822  style numeric time zone offset from GMT, e.g. -0800.&lt;br /&gt;assertEquals("+0100", String.format("%tz", cal));&lt;br /&gt;// the abbreviation for the time zone&lt;br /&gt;assertEquals("CET", String.format("%tZ", cal));&lt;br /&gt;// Seconds since the beginning of the epoch starting at 1 January 1970 00:00:00 UTC,&lt;br /&gt;// i.e. Long.MIN_VALUE/1000 to Long.MAX_VALUE/1000.&lt;br /&gt;assertEquals("1168203901", String.format("%ts", cal));&lt;br /&gt;// Milliseconds since the beginning of the epoch starting at 1 January 1970 00:00:00 UTC,&lt;br /&gt;// i.e. Long.MIN_VALUE to Long.MAX_VALUE.&lt;br /&gt;assertEquals("1168203901000", String.format("%tQ", cal));&lt;br /&gt;// Time formatted for the 24-hour clock as "%tH:%tM"&lt;br /&gt;assertEquals("22:05", String.format("%tR", cal));&lt;br /&gt;// Time formatted for the 24-hour clock as "HH:MM:SS".&lt;br /&gt;assertEquals("22:05:01", String.format("%tT", cal));&lt;br /&gt;// Time formatted for the 12-hour clock as "hh:mm:ss AM/PM"&lt;br /&gt;assertEquals("10:05:01 PM", String.format("%tr", cal));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Conversion characters for formatting date/time compositions.&lt;br /&gt;*&lt;br /&gt;*/&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    public void&lt;/span&gt; testDateTimeFormatter() {&lt;br /&gt;// Date and time formatted as e.g. "Sun Jul 20 16:17:00 EDT 1969".&lt;br /&gt;assertEquals("Sun Jan 07 22:05:01 CET 2007", String.format("%tc", cal));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Formats the value as either "true" or "false" (or "TRUE" or "FALSE", for %B).&lt;br /&gt;* For boolean values, this works as expected.&lt;br /&gt;* For all other values, any non-null value is "true", while null values are "false".&lt;br /&gt;* %type&lt;br /&gt;* type = b | B | s | S&lt;br /&gt;*&lt;br /&gt;*/&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public void&lt;/span&gt; testBooleanFormatter() {&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;final boolean&lt;/span&gt; flag = true;&lt;br /&gt;// boolean&lt;br /&gt;assertEquals("true", String.format("%b", flag));&lt;br /&gt;// boolean&lt;br /&gt;assertEquals("TRUE", String.format("%B", flag));&lt;br /&gt;&lt;br /&gt;// as string&lt;br /&gt;assertEquals("true", String.format("%s", flag));&lt;br /&gt;assertEquals("TRUE", String.format("%S", flag));&lt;br /&gt;&lt;br /&gt;assertEquals("false", String.format("%b", null));&lt;br /&gt;assertEquals("true", String.format("%b", 1));&lt;br /&gt;assertEquals("true", String.format("%b", 'a'));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* Formats the value supplied as a single character.&lt;br /&gt;* Supplied value must be a Byte, Short, Character, or Integer.&lt;br /&gt;* %[argument][width]type&lt;br /&gt;* argument = &amp;lt;&lt;br /&gt;* width = any positive integer value&lt;br /&gt;* type = c | C | s | S&lt;br /&gt;*&lt;br /&gt;*/&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public void&lt;/span&gt; testCharacterFormatter() {&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;final char&lt;/span&gt; c = 'a';&lt;br /&gt;// character&lt;br /&gt;assertEquals("a", String.format("%c", c));&lt;br /&gt;// character&lt;br /&gt;assertEquals("A", String.format("%C", c));&lt;br /&gt;// as string&lt;br /&gt;assertEquals("a", String.format("%s", c));&lt;br /&gt;assertEquals("A", String.format("%S", c));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* %[argument][flags][width]type&lt;br /&gt;* argument = &amp;lt; &lt;br /&gt;* flags = - | + | # |  | ( | 0 &lt;br /&gt;* width = any positive integer value&lt;br /&gt;* type = d | o | x | X | H | s&lt;br /&gt;* Arguments must be Byte, Short, Integer, Long, or BigInteger.&lt;br /&gt;*/&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public void&lt;/span&gt; testIntegerFormatter() {&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;final int&lt;/span&gt; intNumber = 7;&lt;br /&gt;&lt;br /&gt;// base-10 integer&lt;br /&gt;assertEquals("7", String.format("%d", intNumber));&lt;br /&gt;&lt;br /&gt;// base-8 (octal) integer&lt;br /&gt;assertEquals("16", String.format("%o", 2*intNumber)); // 2*7 = 14&lt;br /&gt;&lt;br /&gt;// flag '#' indicates that formatted output should appear in alternate form.&lt;br /&gt;// For %o, this means a leading 0.&lt;br /&gt;assertEquals("07", String.format("%#o", intNumber));&lt;br /&gt;&lt;br /&gt;// base-16 (hexadecimal) integer&lt;br /&gt;assertEquals("e", String.format("%x", 2*intNumber)); // 2*7 = 14&lt;br /&gt;assertEquals("E", String.format("%X", 2*intNumber)); // 2*7 = 14&lt;br /&gt;&lt;br /&gt;// flag '#' indicates that formatted output should appear in alternate form.&lt;br /&gt;// For %x and %X, output will include a leading 0x (0X).&lt;br /&gt;assertEquals("0x7", String.format("%#x", intNumber));&lt;br /&gt;assertEquals("0X7", String.format("%#X", intNumber));&lt;br /&gt;&lt;br /&gt;// hexadecimal representation of the value's hashcode&lt;br /&gt;assertEquals("e", String.format("%h", 2*intNumber));  // 2*7 = 14&lt;br /&gt;assertEquals("E", String.format("%H", 2*intNumber));  // 2*7 = 14&lt;br /&gt;&lt;br /&gt;// as string&lt;br /&gt;assertEquals("7", String.format("%s", intNumber));&lt;br /&gt;&lt;br /&gt;// width 3&lt;br /&gt;assertEquals("  7", String.format("%3d", intNumber));&lt;br /&gt;&lt;br /&gt;// flag '-' means left justification&lt;br /&gt;assertEquals("7  ", String.format("%-3d", intNumber));&lt;br /&gt;&lt;br /&gt;// flag '+' indicates that numeric output should always include a sign (+ or -).&lt;br /&gt;assertEquals("+7", String.format("%+d", intNumber));&lt;br /&gt;&lt;br /&gt;// flag '(' indicates that negative numbers should appear in parentheses.&lt;br /&gt;assertEquals("(7)", String.format("%(d", -intNumber));&lt;br /&gt;&lt;br /&gt;// flag '0' indicates that numeric values should be padded on the left.&lt;br /&gt;assertEquals("007", String.format("%03d", intNumber));&lt;br /&gt;&lt;br /&gt;// flag ' ' (space) indicates that non-negative values should be prefixed with a space&lt;br /&gt;// (for alignment with negative numbers).&lt;br /&gt;assertEquals(" 7", String.format("% d", intNumber));&lt;br /&gt;&lt;br /&gt;// flag '#' indicates that formatted output should appear in alternate form.&lt;br /&gt;// For %s and %S, the flag is passed on to the object's formatTo( ) method.&lt;br /&gt;// The # flag only works in conjunction with %s and %S if the argument&lt;br /&gt;// implements java.util.Formattable.&lt;br /&gt;assertEquals("7", String.format("%#s", intNumber));&lt;br /&gt;&lt;br /&gt;// argument &amp;lt; indicates that the previous argument should be used (again),&lt;br /&gt;// rather than continuing on&lt;br /&gt;assertEquals("+7   7", String.format("%+d %&lt;/code&gt;&lt;code&gt;&amp;lt;&lt;/code&gt;&lt;code&gt;3d", , intNumber));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* %[argument][flags][width][.precision]type&lt;br /&gt;* argument = &lt;/code&gt;&lt;code&gt;&amp;lt;&lt;/code&gt;&lt;code&gt;&lt;br /&gt;  * flags = - | + | # |  | ( | 0 | ,&lt;br /&gt;  * width = any positive integer value&lt;br /&gt;  * precision = any positive integer value&lt;br /&gt;  * type = f | a | g | G | e | E | h | H | s&lt;br /&gt;  * Arguments must be Float, Double, or BigDecimal.&lt;br /&gt;  */&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public void&lt;/span&gt; testDoubleFormatter() {&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;final double&lt;/span&gt; doubleNumber = 7.0d;&lt;br /&gt;&lt;br /&gt;// double/float number, 6 decimal digits by default&lt;br /&gt;assertEquals("7.000000", String.format("%f", doubleNumber));&lt;br /&gt;&lt;br /&gt;// double/float number, 5 max decimal digits&lt;br /&gt;// precision is the total number of significant digits to be displayed&lt;br /&gt;assertEquals("7.00000", String.format("%g", doubleNumber));&lt;br /&gt;assertEquals("7.00000", String.format("%G", doubleNumber));&lt;br /&gt;&lt;br /&gt;// exponential notation, default number of decimal digits 6&lt;br /&gt;assertEquals("7.000000e+00", String.format("%e", doubleNumber));&lt;br /&gt;assertEquals("7.000000E+00", String.format("%E", doubleNumber));&lt;br /&gt;&lt;br /&gt;// exponential notation, using base-16 for the decimal part,&lt;br /&gt;// and base-10 for the exponent part&lt;br /&gt;assertEquals("0x1.cp2", String.format("%a", doubleNumber));&lt;br /&gt;&lt;br /&gt;// hexadecimal representation of the value's hashcode&lt;br /&gt;// precision determines the maximum characters output&lt;br /&gt;assertEquals("401c0000", String.format("%h", doubleNumber));&lt;br /&gt;assertEquals("401C0000", String.format("%H", doubleNumber));&lt;br /&gt;&lt;br /&gt;// as string&lt;br /&gt;// precision determines the maximum characters output&lt;br /&gt;assertEquals("7.0", String.format("%s", doubleNumber));&lt;br /&gt;&lt;br /&gt;// 2 decimal digits (precision = 2)&lt;br /&gt;assertEquals("7.00", String.format("%.2f", doubleNumber));&lt;br /&gt;&lt;br /&gt;// width 6, precision = 2 (2 decimal digits)&lt;br /&gt;assertEquals("  7.00", String.format("%6.2f", doubleNumber));&lt;br /&gt;&lt;br /&gt;// flag '-' means left justification&lt;br /&gt;assertEquals("7.00  ", String.format("%-6.2f", doubleNumber));&lt;br /&gt;&lt;br /&gt;// flag '+' indicates that numeric output should always include a sign (+ or -).&lt;br /&gt;assertEquals(" +7.00", String.format("%+6.2f", doubleNumber));&lt;br /&gt;&lt;br /&gt;// flag '(' indicates that negative numbers should appear in parentheses.&lt;br /&gt;assertEquals("(7.00)", String.format("%(.2f", -doubleNumber));&lt;br /&gt;&lt;br /&gt;// flag '0' indicates that numeric values should be padded on the left.&lt;br /&gt;assertEquals("007.00", String.format("%06.2f", doubleNumber));&lt;br /&gt;&lt;br /&gt;// flag ',' indicates that the locale-specific grouping character&lt;br /&gt;// should be used for numeric values.&lt;br /&gt;assertEquals("7,00", String.format(new Locale("el"), "%,.2f", doubleNumber));&lt;br /&gt;&lt;br /&gt;// flag ' ' (space) indicates that non-negative values should be prefixed with a space&lt;br /&gt;// (for alignment with negative numbers).&lt;br /&gt;assertEquals(" 7.00", String.format("% .2f", doubleNumber));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// argument &amp;lt; indicates that the previous argument should be used (again),&lt;br /&gt;// rather than continuing on&lt;br /&gt;assertEquals("7.00 7.0", String.format("%.2f %&lt;/code&gt;&lt;code&gt;&amp;lt;&lt;/code&gt;&lt;code&gt;3.1f", doubleNumber));&lt;br /&gt;}    &lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;&lt;br /&gt;public void&lt;/span&gt; testIntegerNumberFormatter() { &lt;span style="color: rgb(51, 51, 255);"&gt;&lt;br /&gt;final double&lt;/span&gt; intNumber = 7;&lt;br /&gt;&lt;br /&gt;// another way to format integers&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;NumberFormat &lt;/span&gt;nf = &lt;span style="color: rgb(51, 51, 255);"&gt;NumberFormat&lt;/span&gt;.getInstance();&lt;br /&gt;nf.setMinimumIntegerDigits(3);&lt;br /&gt;nf.setParseIntegerOnly(true);&lt;br /&gt;assertEquals("007", nf.format(intNumber));&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5488862533782141445-1128134157490797456?l=jnkjava.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jnkjava.blogspot.com/feeds/1128134157490797456/comments/default' title='Σχόλια ανάρτησης'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5488862533782141445&amp;postID=1128134157490797456' title='0 σχόλια'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/1128134157490797456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5488862533782141445/posts/default/1128134157490797456'/><link rel='alternate' type='text/html' href='http://jnkjava.blogspot.com/2007/09/javautilformatter.html' title='java.util.Formatter'/><author><name>JNK</name><uri>http://www.blogger.com/profile/01858326984077589347</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></feed>
