<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Java shutdown hooks</title>
	<atom:link href="http://www.certpal.com/blogs/2009/08/java-shutdown-hooks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.certpal.com/blogs/2009/08/java-shutdown-hooks/</link>
	<description>Technology and certifications</description>
	<lastBuildDate>Wed, 28 Jul 2010 06:39:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: CertPal</title>
		<link>http://www.certpal.com/blogs/2009/08/java-shutdown-hooks/comment-page-1/#comment-102</link>
		<dc:creator>CertPal</dc:creator>
		<pubDate>Tue, 08 Sep 2009 11:52:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=152#comment-102</guid>
		<description>&lt;a href=&quot;#comment-100&quot; rel=&quot;nofollow&quot;&gt;@tanzy &lt;/a&gt; 
Why not just hold the write lock to this file ? When your app terminates, the lock that it holds will be released, whether it terminates correctly or not, but the file can remain. When the app starts, check if the write lock is held. The exact locking mechanism your application needs, depends on the situation.

This question would receive more responses on a forum. Have you tried one like javaranch.com ?</description>
		<content:encoded><![CDATA[<p><a href="#comment-100" rel="nofollow">@tanzy </a><br />
Why not just hold the write lock to this file ? When your app terminates, the lock that it holds will be released, whether it terminates correctly or not, but the file can remain. When the app starts, check if the write lock is held. The exact locking mechanism your application needs, depends on the situation.</p>
<p>This question would receive more responses on a forum. Have you tried one like javaranch.com ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tanzy</title>
		<link>http://www.certpal.com/blogs/2009/08/java-shutdown-hooks/comment-page-1/#comment-100</link>
		<dc:creator>tanzy</dc:creator>
		<pubDate>Tue, 08 Sep 2009 10:02:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=152#comment-100</guid>
		<description>Hi writer,

Thanks for posting such a informative article.

Well, in the article there is &quot;The shutdown hook will execute only on normal termination or orderly shutdown.&quot;
I have a query, what if there is need to handle such kind of imroper termination situtaion?

In our project we implemnetd a locking system. In this when instance executes it&#039;s look for a text file.
if exist then instance never executes, otherwise creates this text file, 
and add the shutdown hook on this for deleting this text file at end of execution.

Can you suggest what would be best way to do this, even when there is improper termination of progra?

Thanks,
Tanzy.</description>
		<content:encoded><![CDATA[<p>Hi writer,</p>
<p>Thanks for posting such a informative article.</p>
<p>Well, in the article there is &#8220;The shutdown hook will execute only on normal termination or orderly shutdown.&#8221;<br />
I have a query, what if there is need to handle such kind of imroper termination situtaion?</p>
<p>In our project we implemnetd a locking system. In this when instance executes it&#8217;s look for a text file.<br />
if exist then instance never executes, otherwise creates this text file,<br />
and add the shutdown hook on this for deleting this text file at end of execution.</p>
<p>Can you suggest what would be best way to do this, even when there is improper termination of progra?</p>
<p>Thanks,<br />
Tanzy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CertPal</title>
		<link>http://www.certpal.com/blogs/2009/08/java-shutdown-hooks/comment-page-1/#comment-53</link>
		<dc:creator>CertPal</dc:creator>
		<pubDate>Fri, 28 Aug 2009 16:17:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=152#comment-53</guid>
		<description>&lt;a href=&quot;#comment-42&quot; rel=&quot;nofollow&quot;&gt;@Mark Thornton &lt;/a&gt; 
Thank you for posting that. It might help some one who stumbles upon this.</description>
		<content:encoded><![CDATA[<p><a href="#comment-42" rel="nofollow">@Mark Thornton </a><br />
Thank you for posting that. It might help some one who stumbles upon this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Thornton</title>
		<link>http://www.certpal.com/blogs/2009/08/java-shutdown-hooks/comment-page-1/#comment-42</link>
		<dc:creator>Mark Thornton</dc:creator>
		<pubDate>Fri, 28 Aug 2009 14:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=152#comment-42</guid>
		<description>http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4486580
Shutdown hooks don&#039;t work reliably on Windows apps which have a gui.</description>
		<content:encoded><![CDATA[<p><a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4486580" rel="nofollow">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4486580</a><br />
Shutdown hooks don&#8217;t work reliably on Windows apps which have a gui.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
