<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>When IE meets SE...</title>
	<atom:link href="http://biese.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://biese.wordpress.com</link>
	<description></description>
	<lastBuildDate>Mon, 09 Nov 2009 19:54:09 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='biese.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/cc6d3584fe000a71271b7e5f42384c86?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>When IE meets SE...</title>
		<link>http://biese.wordpress.com</link>
	</image>
			<item>
		<title>Using JAXB2 commons to generate your JAXB class more convenience</title>
		<link>http://biese.wordpress.com/2009/11/09/using-jaxb2-commons-to-generate-your-jaxb-class-more-convenience/</link>
		<comments>http://biese.wordpress.com/2009/11/09/using-jaxb2-commons-to-generate-your-jaxb-class-more-convenience/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 19:54:09 +0000</pubDate>
		<dc:creator>biese</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://biese.wordpress.com/?p=504</guid>
		<description><![CDATA[The JAXB XJC schema binding compiler transforms, or binds, a source XML schema to a set of JAXB content classes in the Java programming language.
But sometimes we need more specific stuff in the generated java class.
For exmaple, the JAXB2 Basics Plugins says &#8220;Schema compiler (XJC) produces schema-derived classes which can be used to turn XML [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=504&subd=biese&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The JAXB XJC schema binding compiler transforms, or binds, a source XML schema to a set of JAXB content classes in the Java programming language.<br />
But sometimes we need more specific stuff in the generated java class.<br />
For exmaple, the JAXB2 Basics Plugins says &#8220;Schema compiler (XJC) produces schema-derived classes which can be used to turn XML into object structures and back. However, generated classes lack by default lack convenience and utility methods like equals(&#8230;), hashCode(&#8230;), toString() and so on.&#8221;</p>
<p>We can use Metro&#8217;s JAXB 2.0 commons project to save time. </p>
<p><strong>Reference:</strong><br />
1. <a href="https://jaxb2-commons.dev.java.net/">JAXB 2.0 commons project</a><br />
2. <a href="http://blogs.sun.com/enterprisetechtips/entry/using_jax_ws_with_maven">Using JAX-WS With Maven</a><br />
3. <a href="http://www.mindbug.org/2008/03/jax-ws-metro-jbossws-huh.html">JAX-WS Metro and JBossWS</a><br />
4. <a href="http://java.sun.com/javaee/5/docs/tutorial/doc/bnazf.html">Java EE5 JAXB tutorial</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biese.wordpress.com/504/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biese.wordpress.com/504/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biese.wordpress.com/504/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biese.wordpress.com/504/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biese.wordpress.com/504/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biese.wordpress.com/504/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biese.wordpress.com/504/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biese.wordpress.com/504/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biese.wordpress.com/504/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biese.wordpress.com/504/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=504&subd=biese&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biese.wordpress.com/2009/11/09/using-jaxb2-commons-to-generate-your-jaxb-class-more-convenience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6714d5021cc0c59e52e10a8ef8197745?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">biese</media:title>
		</media:content>
	</item>
		<item>
		<title>Asynchronous Web Service and SOAP over Java Message Service</title>
		<link>http://biese.wordpress.com/2009/09/15/asynchronous-web-service-and-soap-over-java-message-service/</link>
		<comments>http://biese.wordpress.com/2009/09/15/asynchronous-web-service-and-soap-over-java-message-service/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 07:04:07 +0000</pubDate>
		<dc:creator>biese</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://biese.wordpress.com/?p=497</guid>
		<description><![CDATA[There are two principal architectures for Web service interfaces: synchronous Web services and asynchronous Web services. These two architectures are distinguished by their request-response handling. With synchronous services, clients invoke a request on a service and then suspend their processing while they wait for a response. With asynchronous services, clients initiate a request to a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=497&subd=biese&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>There are two principal architectures for Web service interfaces: <strong>synchronous Web services and asynchronous Web services</strong>. These two architectures are distinguished by their request-response handling. With synchronous services, clients invoke a request on a service and then suspend their processing while they wait for a response. With asynchronous services, clients initiate a request to a service and then resume their processing without waiting for a response. The service handles the client request and returns a response at some later point, at which time the client retrieves the response and proceeds with its processing.</p>
<p>Let&#8217;s see some great articles about <strong>Asynchronous Web Service</strong>.<br />
1. <a href="http://java.sun.com/blueprints/webservices/using/webservbp3.html">Web Service Interaction Architectures</a><br />
2. Asynchronous operations and Web services, <a href="http://www.ibm.com/developerworks/library/ws-asynch1.html">Part 1</a>: A primer on asynchronous transactions<br />
3. Asynchronous operations and Web services, <a href="http://www.ibm.com/developerworks/library/ws-asynch2/index.html">Part 2</a><br />
4. <a href="http://weblogs.java.net/blog/johnreynolds/archive/2006/02/can_i_call_you.html">Can I call you back? &#8211; Asynchronous Web Services</a><br />
5. <a href="http://xml.coverpages.org/async.html">Asynchronous Transactions and Web Services</a><br />
6. <a href="http://kingsfleet.blogspot.com/search/label/asynchronous%20webservices">Gerard Davison&#8217;s Asynchronous web service post</a></p>
<p>Since we talk about asynchronous web service, I will drill down the underlying basic,  <strong>SOAP over JMS.</strong> The W3C has just released W3C Candidate Recommendation. See InfoQ: <a href="http://www.infoq.com/news/2009/06/SOAPJMS">SOAP Over Java Messaging Service</a>.</p>
<p>1. <a href="http://www.oreillynet.com/onlamp/blog/2002/10/soap_over_jms_what_does_it_mea.html">Soap over JMS &#8211; what does it mean and why should I care?</a><br />
2. <a href="http://www.ibm.com/developerworks/websphere/library/techarticles/0402_du/0402_du.html">Building a JMS Web service using SOAP over JMS and WebSphere Studio</a><br />
3. <a href="http://www.oracle.com/technology/pub/articles/murphy-soa-jms.html">Using Request-Response SOAP over JMS Web Services</a><br />
4. <a href="http://charithaka.blogspot.com/2008/10/soap-over-jms-with-axis2.html">SOAP over JMS with Axis2</a><br />
5. <a href="http://soa.sys-con.com/node/523481">SOAP Over JMS Interoperability</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biese.wordpress.com/497/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biese.wordpress.com/497/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biese.wordpress.com/497/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biese.wordpress.com/497/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biese.wordpress.com/497/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biese.wordpress.com/497/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biese.wordpress.com/497/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biese.wordpress.com/497/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biese.wordpress.com/497/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biese.wordpress.com/497/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=497&subd=biese&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biese.wordpress.com/2009/09/15/asynchronous-web-service-and-soap-over-java-message-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6714d5021cc0c59e52e10a8ef8197745?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">biese</media:title>
		</media:content>
	</item>
		<item>
		<title>EJB transaction time out and web service performance</title>
		<link>http://biese.wordpress.com/2009/09/15/ejb-transaction-time-out-and-web-service-performance/</link>
		<comments>http://biese.wordpress.com/2009/09/15/ejb-transaction-time-out-and-web-service-performance/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 01:22:34 +0000</pubDate>
		<dc:creator>biese</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://biese.wordpress.com/?p=490</guid>
		<description><![CDATA[Recently I worked on a integration project threw read-timeout exception and blocking web service call. The client calls a EJB web service method to persistent an Entity Bean. Unfortunately this web service is  implemented wihtin a long-running process and it causes JBoss transaction timeout.
The exception like this
This bug looks like easy, and I can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=490&subd=biese&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recently I worked on a integration project threw read-timeout exception and blocking web service call. The client calls a EJB web service method to persistent an Entity Bean. Unfortunately this web service is  implemented wihtin a long-running process and it causes JBoss transaction timeout.<br />
The exception like <a href="http://lists.jboss.org/pipermail/jboss-user/2009-April/154749.html">this</a></p>
<p>This bug looks like easy, and I can just raise the JBoss&#8217;s jboss-service.xml Transaction Timeout value to higher.<br />
But if you look down the details, you may find more interesting thing. Read more on <a href="http://management-platform.blogspot.com/2008/11/transaction-timeouts-and-ejb3jpa.html">Transaction Timeouts and EJB3/JPA</a> and <a href="http://www.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/4.2.0.cp07/html/Transactions_JTA_Programmers_Guide/chap-Transactions_JTA_Programmers_Guide-Using_JBossJTA_in_Application_Servers.html">Using JBossJTA in Application Servers</a>.</p>
<p>Although this might fix my problem of tansaction timeout, I still haven&#8217;t solved the performance issue from client calling the long-running process. Then I change the code inside of EJB web service. I crate a Message Driven Bean (MDB) and move the persistent Entity Bean there. Now the exposed web service method sends JMS message to MDB asynchronously and return to client fast. No more blocking web service call.</p>
<p><strong>Reference:</strong></p>
<p><a href="http://www.ibm.com/developerworks/websphere/library/techarticles/0402_du/0402_du.html">Building a JMS Web service using SOAP over JMS and WebSphere Studio</a></p>
<p><img class="alignnone size-medium wp-image-493" title="pic0914" src="http://biese.files.wordpress.com/2009/09/pic09141.jpg?w=300&#038;h=142" alt="pic0914" width="300" height="142" /></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biese.wordpress.com/490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biese.wordpress.com/490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biese.wordpress.com/490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biese.wordpress.com/490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biese.wordpress.com/490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biese.wordpress.com/490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biese.wordpress.com/490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biese.wordpress.com/490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biese.wordpress.com/490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biese.wordpress.com/490/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=490&subd=biese&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biese.wordpress.com/2009/09/15/ejb-transaction-time-out-and-web-service-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6714d5021cc0c59e52e10a8ef8197745?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">biese</media:title>
		</media:content>

		<media:content url="http://biese.files.wordpress.com/2009/09/pic09141.jpg?w=300" medium="image">
			<media:title type="html">pic0914</media:title>
		</media:content>
	</item>
		<item>
		<title>Debug Java by JVM diagnostics tools</title>
		<link>http://biese.wordpress.com/2009/08/28/debug-java-in-jvm-diagnostics-tools/</link>
		<comments>http://biese.wordpress.com/2009/08/28/debug-java-in-jvm-diagnostics-tools/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 06:02:05 +0000</pubDate>
		<dc:creator>biese</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://biese.wordpress.com/?p=486</guid>
		<description><![CDATA[sometimes I need to debug program with multiple threads and complex codes. Or I work on analyzing and interpreting the JVM performance monitoring and diagnostics statistics. I need a sharp tool to do it. So I find most powerful kits to help.
1. An Introduction to Java Stack Traces
2. JDB Example: Generating a Thread Dump
3. How [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=486&subd=biese&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>sometimes I need to debug program with multiple threads and complex codes. Or I work on analyzing and interpreting the JVM performance monitoring and diagnostics statistics. I need a sharp tool to do it. So I find most powerful kits to help.</p>
<p>1. <a href="http://java.sun.com/developer/technicalArticles/Programming/Stacktrace/">An Introduction to Java Stack Traces</a><br />
2. <a href="http://javatechniques.com/blog/jdb-example-generating-a-thread-dump/">JDB Example: Generating a Thread Dump</a><br />
3. <a href="http://albert.rierol.net/java_tricks.html">How to debug a multithreaded java program</a><br />
4. <a href="http://bwithers.wordpress.com/2007/12/29/schedule-your-own-java-thread-dumps/">Schedule your own Java thread dumps</a><br />
5. <a href="http://www.javapassion.com/javase/javadebugcommandtools.pdf">JDK Debugging Tools</a><br />
6. <a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/">JDK Tools and Utilities</a><br />
7. <a href="http://www.javapassion.com/handsonlabs/javase6tools/index.html">Exercise basic command line debugging tools</a><br />
8. <a href="http://articles.techrepublic.com.com/5100-10878_11-6139512.html">Debug your Java code with ease using JPDA</a><br />
9. <a href="http://www.infoq.com/news/2007/11/ibm-sap">IBM and SAP Open Source their JVM Diagnostics Tools</a><br />
10. <a href="http://www.alphaworks.ibm.com/tech/jca?open&amp;S_TACT=105AGX59&amp;S_CMP=GR&amp;ca=dgr-jw22awjca">IBM Thread and Monitor Dump Analyzer for Java</a><br />
11. <a href="https://visualvm.dev.java.net/">Sun VisualVM</a> is a visual tool integrating several commandline JDK tools and lightweight profiling capabilities.<br />
12. <a href="http://www.eclipse.org/tptp/">Eclipse Test &amp; Performance Tools Platform Project</a><br />
13. <a href="http://satukubik.com/2009/08/26/eclipse-tips-debugging-your-multi-thread-application-2/">Eclipse Tips: Debugging your multi thread application</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biese.wordpress.com/486/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biese.wordpress.com/486/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biese.wordpress.com/486/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biese.wordpress.com/486/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biese.wordpress.com/486/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biese.wordpress.com/486/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biese.wordpress.com/486/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biese.wordpress.com/486/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biese.wordpress.com/486/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biese.wordpress.com/486/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=486&subd=biese&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biese.wordpress.com/2009/08/28/debug-java-in-jvm-diagnostics-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6714d5021cc0c59e52e10a8ef8197745?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">biese</media:title>
		</media:content>
	</item>
		<item>
		<title>Constraint Programming in Java</title>
		<link>http://biese.wordpress.com/2009/08/21/constraint-programming-in-java/</link>
		<comments>http://biese.wordpress.com/2009/08/21/constraint-programming-in-java/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 18:25:34 +0000</pubDate>
		<dc:creator>biese</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://biese.wordpress.com/?p=484</guid>
		<description><![CDATA[The constraint programming technology has matured to the point where it is possible to isolate some essential features and offer them as libraries or embedded cleanly in general purpose host programming languages.
For example ILOG Solver is for planning or scheduling systems. Now I am trying to use Constraint Programming Satisfy (CPS) and domain specific language [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=484&subd=biese&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The constraint programming technology has matured to the point where it is possible to isolate some essential features and offer them as libraries or embedded cleanly in general purpose host programming languages.<br />
For example ILOG Solver is for planning or scheduling systems. Now I am trying to use Constraint Programming Satisfy (CPS) and domain specific language (DSL) at scheduling system.</p>
<p><strong>Library</strong><br />
1. <a href="http://jacop.osolpro.com/">JaCoP &#8211; Java Constraint Programming solver</a><br />
2. <a href="http://bach.istc.kobe-u.ac.jp/cream/">Cream: Class Library for Constraint Programming in Java</a><br />
3. <a href="http://jopt.sourceforge.net/js_general.php">jOpt is an open source implementation of the Optimization Programming Language</a><br />
4. <a href="http://www.pms.ifi.lmu.de/software/jack/docu/index.html">JACK: A Java Constraint Kit</a><br />
5. <a href="http://www.ilog.com/products/cpoptimizer/">ILOG CP Optimizer</a><br />
6. <a href="http://www.koalog.com/php/jcs.php">Koalog Constraint Solver</a><br />
7. <a href="http://www.manageability.org/blog/stuff/open-source-constraint-programming-java">Open Source Constraint Programming Solvers Written in Java (collections)</a></p>
<p><strong>Reference</strong><br />
1. <a href="http://www.springerlink.com/content/111647/">Magazine: Journal of Scheduling</a><br />
2. <a href="http://www.cs.cityu.edu.hk/~hwchun/research/PDF/PACLP99JSolver.pdf">Constraint Programming in Java with JSolver (ILOG)</a><br />
3. <a href="http://ai.uwaterloo.ca/~vanbeek/Courses/resources.shtml">Course: CS 886: Topics in Artificial Intelligence: Constraint Programming</a><br />
4. <a href="http://www.cs.mu.oz.au/~pjs/book/course.html">Course: Programming with Constraints: an Introduction</a><br />
5. <a href="http://ktiml.mff.cuni.cz/~bartak/constraints/">Course: CONSTRAINT PROGRAMMING</a><br />
6. <a href="http://www.ps.uni-sb.de/courses/cp-ss07/services.html">Course: Constraint Programming: Services</a><br />
7. <a href="http://books.google.ca/books?id=jBYAleHTldsC&amp;dq=Programming+with+Constraints&amp;pg=PP1&amp;ots=QfhyTiUzBP&amp;source=bn&amp;sig=BuqKI2n2fkcPzek-8C-T9m82e0Q&amp;hl=en&amp;sa=X&amp;oi=book_result&amp;resnum=4&amp;ct=result#PPT437,M1">Book: Programming with constraints</a><br />
8. <a href="http://books.google.com.au/books?id=Kjap9ZWcKOoC&amp;printsec=frontcover&amp;source=gbs_v2_summary_r&amp;cad=0">Book: Handbook of constraint programming</a><br />
9. <a href="http://today.java.net/pub/a/today/2005/11/29/solving-sudokus-in-java.html">Solving Sudokus in Java</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biese.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biese.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biese.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biese.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biese.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biese.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biese.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biese.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biese.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biese.wordpress.com/484/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=484&subd=biese&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biese.wordpress.com/2009/08/21/constraint-programming-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6714d5021cc0c59e52e10a8ef8197745?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">biese</media:title>
		</media:content>
	</item>
		<item>
		<title>Effective using Java Concurrency part-4</title>
		<link>http://biese.wordpress.com/2009/08/11/effective-using-java-concurrency-part-4/</link>
		<comments>http://biese.wordpress.com/2009/08/11/effective-using-java-concurrency-part-4/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 06:44:34 +0000</pubDate>
		<dc:creator>biese</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://biese.wordpress.com/?p=476</guid>
		<description><![CDATA[1. Atomic
1.1 JDK API
1.2 Ensure Thread Safety On Single Values With Atomic Variables
1.3 The Atomic classes in Java 5
1.4 Going atomic
2. Life cycle of a thread &#8211; join, yield, sleep
2.1 Life Cycle of A Thread
2.2 Java Threads Tutorial
2.3 When to join threads
2.4 Threads join
2.5 when to switch threads with yield()
2.6 Thread.yield
2.7 Pausing the Current Thread [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=476&subd=biese&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>1. Atomic</strong></p>
<p>1.1 <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/atomic/package-summary.html#package_description">JDK API</a><br />
1.2 <a href="http://www.javalobby.org/java/forums/m91839242.html">Ensure Thread Safety On Single Values With Atomic Variables</a><br />
1.3 <a href="http://www.javamex.com/tutorials/synchronization_concurrency_7_atomic.shtml">The Atomic classes in Java 5</a><br />
1.4 <a href="http://www.ibm.com/developerworks/java/library/j-jtp11234/">Going atomic</a></p>
<p><strong>2. Life cycle of a thread &#8211; join, yield, sleep</strong></p>
<p>2.1 <a href="http://www.tutorialspoint.com/java/java_multithreading.htm">Life Cycle of A Thread</a><br />
2.2 <a href="http://www.scribd.com/doc/6832058/Java-Threads-Tutorial">Java Threads Tutorial</a><br />
2.3 <a href="http://javahowto.blogspot.com/2007/05/when-to-join-threads.html">When to join threads</a><br />
2.4 <a href="http://www.java2s.com/Code/Java/Threads/Threadsjoin.htm">Threads join</a><br />
2.5 <a href="http://www.java2s.com/Code/Java/Threads/Suggestingwhentoswitchthreadswithyield.htm">when to switch threads with yield()</a><br />
2.6 <a href="http://www.javamex.com/tutorials/threads/yield.shtml">Thread.yield</a><br />
2.7 <a href="http://www.exampledepot.com/egs/java.lang/Sleep.html">Pausing the Current Thread (sleep)</a><br />
2.8 <a href="http://www.javamex.com/tutorials/threads/sleep.shtml">Thread.sleep</a><br />
2.9 <a href="http://www.javamex.com/tutorials/synchronization_volatile.shtml">The volatile keyword in Java<a><br />
2.10 <a href="http://www.ibm.com/developerworks/java/library/j-jtp06197.html">Managing volatility</a></p>
<p><strong>3.Overall</strong></p>
<p>3.1 <a href="https://www6.software.ibm.com/developerworks/education/j-concur/j-concur-a4.pdf">Concurrency in JDK 5.0</a><br />
3.2 <a href="http://www.briangoetz.com/pubs.html">Brian Goetz&#8217;s blog</a><br />
3.3 <a href="http://tutorials.jenkov.com/java-concurrency/index.html">Introduction to Java Concurrency and Multithreading</a><br />
3.4 <a href="http://java.sun.com/developer/technicalArticles/J2SE/concurrency/">Concurrent Programming with J2SE 5.0</a><br />
3.5 <a href="http://developerlife.com/tutorials/?p=24">Introduction to Java 5 java.util.concurrent API</a><br />
3.6 <a href="http://java.sun.com/docs/books/jls/third_edition/html/memory.html">Java Language Specification (3rd): Threads and Locks</a><br />
3.7 <a href="http://elvis.rowan.edu/~hartley/JavaConcProg/#BLOCKINGQUEUES">Java as a Concurrent Programming Language for Operating Systems and Related Courses</a><br />
3.8 <a href="http://www.javamex.com/tutorials/synchronization_concurrency_1.shtml">Java Synchronization and concurrency</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biese.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biese.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biese.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biese.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biese.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biese.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biese.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biese.wordpress.com/476/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biese.wordpress.com/476/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biese.wordpress.com/476/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=476&subd=biese&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biese.wordpress.com/2009/08/11/effective-using-java-concurrency-part-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6714d5021cc0c59e52e10a8ef8197745?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">biese</media:title>
		</media:content>
	</item>
		<item>
		<title>Effective using Java Concurrency part-3</title>
		<link>http://biese.wordpress.com/2009/08/10/effective-using-java-concurrency-part-3/</link>
		<comments>http://biese.wordpress.com/2009/08/10/effective-using-java-concurrency-part-3/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 07:46:38 +0000</pubDate>
		<dc:creator>biese</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://biese.wordpress.com/?p=473</guid>
		<description><![CDATA[1. Concurrency Blocking Queue
1.1 JDK API
1.2 Java 5&#8217;s BlockingQueue
1.3 More fun with Java Concurrency: BlockingQueue
1.4 Which Java blocking queue is most efficient for single-producer single-consumer scenarios
1.5 BlockingQueue
1.6 How can I leverage the java.util.concurrent BlockingQueue?
1.7 Implement Blocking Queue
1.8 Introduction to nonblocking algorithms
2. wait, notify and notifyall
2.1 Using wait(), notify() and notifyAll()
2.2 notify and notifyall
2.3 The wait/notify [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=473&subd=biese&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>1. Concurrency Blocking Queue</strong></p>
<p>1.1 <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/BlockingQueue.html">JDK API</a><br />
1.2 <a href="http://www.developer.com/java/ent/article.php/3645111">Java 5&#8217;s BlockingQueue</a><br />
1.3 <a href="http://blog.carbonfive.com/2009/02/java/more-fun-with-java-concurrency-blockingqueue">More fun with Java Concurrency: BlockingQueue</a><br />
1.4 <a href="http://stackoverflow.com/questions/976940/which-java-blocking-queue-is-most-efficient-for-single-producer-single-consumer-s">Which Java blocking queue is most efficient for single-producer single-consumer scenarios</a><br />
1.5 <a href="http://www.javamex.com/tutorials/blockingqueue.shtml">BlockingQueue</a><br />
1.6 <a href="http://java-interview-faqs.blogspot.com/2009/06/how-can-i-leverage-javautilconcurrent.html">How can I leverage the java.util.concurrent BlockingQueue?</a><br />
1.7 <a href="http://www.roseindia.net/javatutorials/blocking_queue.shtml">Implement Blocking Queue</a><br />
1.8 <a href="http://www.ibm.com/developerworks/java/library/j-jtp04186/index.html?S_TACT=105AGX02&amp;S_CMP=EDU">Introduction to nonblocking algorithms</a></p>
<p><strong>2. wait, notify and notifyall</strong></p>
<p>2.1 <a href="http://www.javamex.com/tutorials/synchronization_wait_notify.shtml">Using wait(), notify() and notifyAll()</a><br />
2.2 <a href="http://www.coderanch.com/t/261022/Programmer-Certification-SCJP/certification/notify-vs-notifyAll">notify and notifyall</a><br />
2.3 <a href="http://www.jchq.net/certkey/0703certkey.htm">The wait/notify protocol</a><br />
2.4 <a href="http://www.java2s.com/Code/Java/Threads/Threadnotify.htm">Thread notify</a><br />
2.5 <a href="http://www.linuxtopia.org/online_books/programming_books/thinking_in_java/TIJ315_016.htm">Thinking in Java: Wait and notify</a><br />
2.6 <a href="http://www.iterasi.net/openviewer.aspx?sqrlitid=bgiqqyofl0iiwj_kwrvjka">The producer-consumer pattern in Java 5: using blocking queues in preference to wait()/notify()</a><br />
2.7 <a href="http://www.artima.com/insidejvm/ed2/threadsynch.html">Thread Synchronization</a></p>
<p><strong>3. Synchronizers</strong></p>
<p>3.1 <a href="http://java.sun.com/developer/JDCTechTips/2005/tt0216.html#1">GETTING TO KNOW SYNCHRONIZERS</a><br />
3.2 <a href="http://java-x.blogspot.com/2006/11/java-5-concurrency-selecting.html">Java 5 Concurrency: Selecting Synchronizers</a></p>
<p><strong>4. Semaphore</strong></p>
<p>4.1 <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Semaphore.html">JDK API</a><br />
4.2 <a href="http://programmingexamples.wikidot.com/java-semaphore">Java Semaphore</a><br />
4.3 <a href="http://tutorials.jenkov.com/java-concurrency/semaphores.html">Semahores</a></p>
<p><strong>5. CyclicBarrier</strong></p>
<p>5.1 <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/CyclicBarrier.html">JDK API</a><br />
5.2 <a href="http://www.javamex.com/tutorials/threads/CyclicBarrier.shtml">cyclicBarrier: concordinating the stages of a multithreaded operation</a></p>
<p><strong>6. Countdown Latch</strong></p>
<p>6.1 <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/CountDownLatch.html">JDK API</a><br />
6.2 <a href="http://programmingexamples.wikidot.com/countdownlatch">Countdownlatch</a><br />
6.3 <a href="http://www.javamex.com/tutorials/threads/CountDownLatch.shtml">Coordinating threads with CountDownLatch</a><br />
6.4 <a href="http://stackoverflow.com/questions/184147/countdownlatch-vs-semaphore">Countdownlatch vs Semaphore</a></p>
<p><strong>7. Exchanger</strong></p>
<p>7.1 <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Exchanger.html">JDK API</a><br />
7.2 <a href="http://www.java2s.com/Code/Java/Threads/AnexampleofExchanger.htm">An example of Exchanger</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biese.wordpress.com/473/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biese.wordpress.com/473/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biese.wordpress.com/473/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biese.wordpress.com/473/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biese.wordpress.com/473/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biese.wordpress.com/473/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biese.wordpress.com/473/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biese.wordpress.com/473/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biese.wordpress.com/473/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biese.wordpress.com/473/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=473&subd=biese&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biese.wordpress.com/2009/08/10/effective-using-java-concurrency-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6714d5021cc0c59e52e10a8ef8197745?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">biese</media:title>
		</media:content>
	</item>
		<item>
		<title>Effective using Java Concurrency part-2</title>
		<link>http://biese.wordpress.com/2009/08/09/effective-using-java-concurrency-part-2/</link>
		<comments>http://biese.wordpress.com/2009/08/09/effective-using-java-concurrency-part-2/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 06:47:17 +0000</pubDate>
		<dc:creator>biese</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://biese.wordpress.com/?p=468</guid>
		<description><![CDATA[1. Callable and Future
The Callable interface is similar to Runnable, in that both are designed for classes whose instances are potentially executed by another thread. A Runnable, however, does not return a result and cannot throw a checked exception. 
1.1 JDK API
1.2 Using Callable to Return Results From Runnables
1.3 Java 5 Concurrency: Callable and Future
1.4 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=468&subd=biese&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>1. Callable and Future</strong><br />
The Callable interface is similar to Runnable, in that both are designed for classes whose instances are potentially executed by another thread. A Runnable, however, does not return a result and cannot throw a checked exception. </p>
<p>1.1 <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Future.html">JDK API</a><br />
1.2 <a href="http://blogs.sun.com/CoreJavaTechTips/entry/get_netbeans_6">Using Callable to Return Results From Runnables</a><br />
1.3 <a href="http://java-x.blogspot.com/2006/11/java-5-concurrency-callable-and-future.html">Java 5 Concurrency: Callable and Future</a><br />
1.4 <a href="http://www.javalobby.org/forums/thread.jspa?messageID=91836328">Concurrency: I Can See Into Your Future </a></p>
<p><strong>2. Concurrent ReadWriteLock</strong><br />
Think of a scenerio that there are many reader threads that reads a shared data frequently and only one writer thread that updates shared data. It&#8217;s not necessary to exclusively lock access to shared data while reading because multiple read operations can be done in parallel unless there is a write operation.</p>
<p>2.1 <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/locks/ReadWriteLock.html">JDK API</a><br />
2.2 <a href="http://ilkinbalkanay.blogspot.com/2008/01/readwritelock-example-in-java.html">ReadWriteLock example in Java</a><br />
2.3 <a href="http://java-x.blogspot.com/2006/11/java-5-concurrency-reader-writer-locks.html">Java 5 Concurrency Reader Writer Locks</a><br />
2.4 <a href="http://www.java2s.com/Code/Java/Threads/ReentrantLocktestfordeadlocks.htm">ReentrantLock: test for deadlocks</a><br />
2.5 <a href="http://tutorials.jenkov.com/java-concurrency/read-write-locks.html">Read / Write Locks in Java</a><br />
2.6 <a href="http://hamletdarcy.blogspot.com/2008/09/declarative-synchronization-with-java.html">Declarative Synchronization with Java 5&#8217;s ReadWriteLock</a><br />
2.7 <a href="http://www.javapractices.com/topic/TopicAction.do?Id=118">Read-write locks</a></p>
<p><strong>3. Locks</strong></p>
<p>3.1 <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/locks/Lock.html">JDk API</a><br />
3.2 <a href="http://tutorials.jenkov.com/java-concurrency/locks.html">Locks in Java</a><br />
3.3 <a href="http://www.javamex.com/tutorials/synchronization_concurrency_9_locks.shtml">Explicit locks in Java 5</a><br />
3.4 <a href="http://robaustin.wikidot.com/reentrantlock">ReentrantLock Example</a><br />
3.5 <a href="http://www.ibm.com/developerworks/java/library/j-jtp10264/">More flexible, scalable locking in JDK 5.0</a><br />
3.6 <a href="http://java-x.blogspot.com/2006/11/java-5-concurrency-locks.html">Java 5 Concurrency: Locks</a><br />
3.7 <a href="http://javabeanz.wordpress.com/2007/07/12/using-reentrant-locks-for-thread-synchronization/">Using ReentrantLock for thread synchronization</a></p>
<p><strong>4. Lock Conditions</strong></p>
<p>4.1 <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/locks/Condition.html">JDK API</a><br />
4.2 <a href="http://java-x.blogspot.com/2006/11/java-5-concurrency-conditions.html">Java 5 Concurrency: Conditions</a><br />
4.3 <a href="http://www.java2s.com/Code/Java/Threads/Java1550newfeaturecollectionandthread.htm">Java 1.5: collection and thread</a></p>
<p><strong>5. Implementing Read-Write Locks by yourself</strong></p>
<p>5.1 <a href="http://www.developer.com/java/article.php/951051">Understanding Java Multithreading and Read-Write Locks, Part 1</a><br />
5.2 <a href="http://www.asingh.net/technical/rwlocks.html">Implementing Read-Write Locks in Java</a><br />
5.3 <a href="http://www.javalobby.org/java/forums/t45090.html">Concurrency: Understanding the Value of Read-Write Locks</a><br />
5.4 <a href="http://www.concentric.net/~Ttwang/tech/rwlock.htm">Java Thread Programming: Implement Read &amp; Write Locks</a></p>
<p><strong>6. Thread Interrupt</strong><br />
An interrupt is an indication to a thread that it should stop what it is doing and do something else. It&#8217;s up to the programmer to decide exactly how a thread responds to an interrupt, but it is very common for the thread to terminate.</p>
<p>6.1 <a href="http://java.sun.com/javase/6/docs/api/java/lang/Thread.html#interrupt()">JDK API</a><br />
6.2 <a href="http://www.roseindia.net/javatutorials/shutting_down_threads_cleanly.shtml">Shutting down threads cleanly</a><br />
6.3 <a href="http://www.herongyang.com/java/Thread-interrupt-Method-to-Terminate-Thread.html">Thread interrupt Method to Terminate Thread</a><br />
6.4 <a href="http://java-x.blogspot.com/2006/11/java-handling-interrupts.html">Java: Handling Interrupts</a><br />
6.5 <a href="http://www.ibm.com/developerworks/java/library/j-jtp05236.html">Dealing with InterruptedException</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biese.wordpress.com/468/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biese.wordpress.com/468/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biese.wordpress.com/468/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biese.wordpress.com/468/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biese.wordpress.com/468/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biese.wordpress.com/468/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biese.wordpress.com/468/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biese.wordpress.com/468/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biese.wordpress.com/468/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biese.wordpress.com/468/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=468&subd=biese&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biese.wordpress.com/2009/08/09/effective-using-java-concurrency-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6714d5021cc0c59e52e10a8ef8197745?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">biese</media:title>
		</media:content>
	</item>
		<item>
		<title>Effective using Java Concurrency part-1</title>
		<link>http://biese.wordpress.com/2009/08/08/effective-using-java-concurrency-part-1/</link>
		<comments>http://biese.wordpress.com/2009/08/08/effective-using-java-concurrency-part-1/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 22:29:56 +0000</pubDate>
		<dc:creator>biese</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://biese.wordpress.com/?p=461</guid>
		<description><![CDATA[Writing correct concurrent code is difficult, but not impossible. Using good object-oriented design techniques can make it easier.
Here I listed most useful tips together and hoepfully you don&#8217;t fear threads any more. 
Basic Lesson: Concurrency
1. ThreadPoolExecutor (Thread pool)
- Maintains caller-specified work queue
- Manages thread pool size and use depending upon queue type and contents, and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=461&subd=biese&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Writing correct concurrent code is difficult, but not impossible. Using good object-oriented design techniques can make it easier.<br />
Here I listed most useful tips together and hoepfully you don&#8217;t fear threads any more. </p>
<p><a href="http://java.sun.com/docs/books/tutorial/essential/concurrency/">Basic Lesson: Concurrency</a></p>
<p><strong>1. ThreadPoolExecutor (Thread pool)</strong><br />
- Maintains caller-specified work queue<br />
- Manages thread pool size and use depending upon queue type and contents, and keepAlive parameter<br />
- Easy instantiation through Executors factory class<br />
- Work queue is implementation of BlockingQueue interface:  LinkedBlockingQueue, PriorityBlockingQueue, ArrayBlockingQueue, SynchronousQueue are provided by lib.</p>
<p>1.1 <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ThreadPoolExecutor.html">JDK API</a><br />
1.2 <a href="http://www.ibm.com/developerworks/library/j-jtp0730.html">Thread pools and work queues</a><br />
1.3 <a href="http://today.java.net/pub/a/today/2008/01/31/query-by-slice-parallel-execute-join-thread-pool-pattern.html">A Thread Pool Pattern in Java</a><br />
1.4 <a href="http://java-x.blogspot.com/2006/11/java-5-executors-threadpool.html">Java 5 Executors: ThreadPool</a></p>
<p>1.5 How to make your own Thread Pool<br />
- create your ThreadPoolExecutor that includes specific BlockingQueue and Comparator.<br />
- override the beforeExecute and afterExecute<br />
- create your ThreadFactory that implement uncaughtException to prevent thread dead problem</p>
<pre>
class MyThreadPoolExecutor extends ThreadPoolExecutor{
	protected MyThreadPoolExecutor(){
		super(corePoolSize, maximumPoolSize, keepAliveTime, unit, new PriorityBlockingQueue(maxCapacity,new MyComparator()),new MyThreadFactory());
	}
	@Override
	protected void beforeExecute(Thread t,Runnable r){
		/*do your stuff*/
		super.beforeExecute(t, r);
	}
	@Override
	protected void afterExecute(Runnable r, Throwable t) {
		/*do your stuff*/
		super.afterExecute(r, t);
	}

}

class MyThreadFactory implements ThreadFactory {
	private final MyThreadGroup tg = new MyThreadGroup();
	    public Thread newThread(Runnable r) {
			     return new Thread(tg,r);
			}
	}
	private class MyThreadGroup extends ThreadGroup{
		private MyThreadGroup(){
			super("MyThreadGroup");
		}
		public void uncaughtException(Thread t, Throwable e){
			log.debug(t);
			/*do something*/
		}
}
</pre>
<p><strong>2. Thread and UncaughtException</strong></p>
<p>2.1 <a href="http://stuffthathappens.com/blog/2007/10/07/programmers-notebook-uncaught-exception-handlers/">UncaughtExceptionHandler</a><br />
2.2 <a href="http://www.ibm.com/developerworks/library/j-jtp0924.html">Hey, where&#8217;d my thread go?</a></p>
<p><strong>3. Collections and Thread</strong></p>
<p>3.1 <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ConcurrentHashMap.html">JDK ConcurrentHashMap</a><br />
3.2 <a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/ConcurrentSkipListSet.html">JDK ConcurrentSkipListSet</a><br />
3.3 <a href="http://www.ibm.com/developerworks/java/library/j-jtp07233.html">Concurrent collections classes</a><br />
3.4 <a href="http://www.javabeat.net/articles/4-what-is-new-in-java-60-collections-api-1.html">What is new in Java 6.0 Collections API?</a><br />
3.5 <a href="http://dmy999.com/article/34/correct-use-of-concurrenthashmap">Correct use of ConcurrentHashMap</a><br />
3.6 <a href="http://www.javamex.com/tutorials/synchronization_concurrency_8_hashmap.shtml">Concurrent structures and collections in Java 5</a></p>
<p>Reference: Understand Skip List Map/Set<br />
3.7 <a href="http://www.developer.com/java/other/article.php/10936_3795251_1">Java Ordered Collections: Trees and Skip Lists</a><br />
3.8 <a href="http://tech.puredanger.com/2007/10/03/skip-lists/">Skip lists</a></p>
<p><strong>4. Thread Scheduling</strong><br />
The JVM schedules using a preemptive , priority based scheduling algorithm.<br />
All Java threads have a priority and the thread with he highest priority is scheduled to run by the JVM. </p>
<p>4.1 <a href="http://lass.cs.umass.edu/~shenoy/courses/fall01/labs/talab2.html">JAVA Thread Scheduling</a><br />
4.2 <a href="http://lass.cs.umass.edu/~shenoy/courses/fall01/">Course online about OS and Thread</a><br />
4.3 <a href="http://www.javaworld.com/javaworld/jw-07-2002/jw-0703-java101.html">Achieve strong performance with threads, Part 3</a><br />
4.4 <a href="http://www.javamex.com/tutorials/threads/thread_scheduling.shtml">Thread Scheduling</a><br />
4.5 <a href="http://www.deitel.com/articles/java_tutorials/20051126/JavaMultithreading_Tutorial_Part3.html">Thread Priorities and Thread Scheduling</a></p>
<p><strong>5. Collections synchronizedList and synchronizedMap</strong></p>
<p>5.1 <a href="http://java.sun.com/javase/6/docs/api/java/util/Collections.html">JDK API</a><br />
5.2 <a href="http://rayfd.wordpress.com/2007/11/">When A Synchronized Class Isn&#8217;t Threadsafe</a><br />
5.3 <a href="http://stackoverflow.com/questions/561671/best-way-to-control-concurrent-access-to-java-collections">Best way to control concurrent access to Java collections</a></p>
<p><strong>6. ThreadLocal</strong><br />
A thread-local variable effectively provides a separate copy of its value for each thread that uses it.<br />
Each thread can see only the value associated with that thread, and is unaware that other threads may be using or<br />
modifying their own copies. </p>
<p>6.1 <a href="http://www.ddj.com/java/184405382">Using Thread-Local Variables In Java</a><br />
6.2 <a href="http://www.ibm.com/developerworks/java/library/j-threads3.html">Threading lightly, Part 3: Sometimes it&#8217;s best not to share</a><br />
6.3 <a href="http://www.naildrivin5.com/daveblog5000/?p=39">Using ThreadLocal and Servlet Filters to cleanly access JPA an EntityManager</a><br />
6.4 <a href="http://www.javamex.com/tutorials/synchronization_concurrency_thread_local2.shtml">Thread-local variables in Java</a><br />
6.5 <a href="http://www.thecoderscorner.com/articleGen/show/3">Introduction to reducing thread contention in Java</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biese.wordpress.com/461/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biese.wordpress.com/461/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biese.wordpress.com/461/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biese.wordpress.com/461/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biese.wordpress.com/461/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biese.wordpress.com/461/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biese.wordpress.com/461/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biese.wordpress.com/461/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biese.wordpress.com/461/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biese.wordpress.com/461/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=461&subd=biese&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biese.wordpress.com/2009/08/08/effective-using-java-concurrency-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6714d5021cc0c59e52e10a8ef8197745?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">biese</media:title>
		</media:content>
	</item>
		<item>
		<title>Refactor your java code-14 (Uncaught exception handler)</title>
		<link>http://biese.wordpress.com/2009/07/28/refactor-your-java-code-14-uncaught-exception-handler/</link>
		<comments>http://biese.wordpress.com/2009/07/28/refactor-your-java-code-14-uncaught-exception-handler/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 21:03:48 +0000</pubDate>
		<dc:creator>biese</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://biese.wordpress.com/?p=457</guid>
		<description><![CDATA[The simplest Java programs run from the console and executed in a single thread, when an uncaught RuntimeException is thrown, it will print a stack trace to the console and terminate the thread and itself.
But if you work on Java Swing, Java web applicaiton or multiple threads application, then the thread always remains alive, in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=457&subd=biese&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The simplest Java programs run from the console and executed in a single thread, when an uncaught RuntimeException is thrown, it will print a stack trace to the console and terminate the thread and itself.<br />
But if you work on Java Swing, Java web applicaiton or multiple threads application, then the thread always remains alive, in spite of any RuntimeExceptions thrown by your program. </p>
<p>1. <a href="http://www.javalobby.org/java/forums/t16517.html">Where Uncaught Exceptions Go</a><br />
2. <a href="http://www.javamex.com/tutorials/exceptions/exceptions_uncaught_handler.shtml">How uncaught exceptions are handled</a><br />
3. <a href="http://www.javapractices.com/topic/TopicAction.do?Id=229">Provide an uncaught exception handler</a><br />
4. <a href="http://stuffthathappens.com/blog/2007/10/07/programmers-notebook-uncaught-exception-handlers/">Uncaught exception handlers</a><br />
5. <a href="http://www.ibm.com/developerworks/java/library/j-jtp0924.html?S_TACT=105AGX02&amp;S_CMP=EDU">Java theory and practice: Hey, where&#8217;d my thread go?</a><br />
6. <a href="http://www.javamex.com/tutorials/exceptions/exceptions_unchecked.shtml">Unchecked exceptions in Java</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biese.wordpress.com/457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biese.wordpress.com/457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biese.wordpress.com/457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biese.wordpress.com/457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biese.wordpress.com/457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biese.wordpress.com/457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biese.wordpress.com/457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biese.wordpress.com/457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biese.wordpress.com/457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biese.wordpress.com/457/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biese.wordpress.com&blog=453908&post=457&subd=biese&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biese.wordpress.com/2009/07/28/refactor-your-java-code-14-uncaught-exception-handler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6714d5021cc0c59e52e10a8ef8197745?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">biese</media:title>
		</media:content>
	</item>
	</channel>
</rss>