<?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-5369017427302932931</id><updated>2012-01-18T00:16:36.157Z</updated><category term='SyncToy'/><category term='Trakko'/><category term='JavaEE'/><category term='jQuery'/><category term='Backups'/><category term='WebSphereMQ'/><category term='Email'/><category term='Subversion'/><category term='Hibernate'/><category term='AJAX'/><category term='GoogleCalendar'/><category term='I18N'/><category term='Windows'/><category term='Security'/><category term='WindowsVista'/><category term='Java'/><category term='Log4j'/><category term='SecurityNow'/><category term='general'/><category term='Middleware'/><category term='OpenSource'/><category term='SpringFramework'/><category term='Tomcat'/><category term='Ivy'/><category term='Javadocs'/><category term='MemoryManagement'/><category term='Eclipse'/><category term='URLPing'/><category term='TrueCrypt'/><category term='Authentication'/><category term='JMS'/><category term='PPP'/><category term='SunMicrosystems'/><category term='JSON'/><category term='ProjectBlackbox'/><category term='GMail'/><category term='LambdaProbe'/><title type='text'>The V N Albuquerque Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5369017427302932931.post-6611962843393768371</id><published>2011-03-15T08:06:00.012Z</published><updated>2011-04-12T07:54:57.857+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JMS'/><category scheme='http://www.blogger.com/atom/ns#' term='SpringFramework'/><category scheme='http://www.blogger.com/atom/ns#' term='WebSphereMQ'/><title type='text'>Messaging With WebSphere MQ Using Spring JMS</title><content type='html'>&lt;p&gt;&lt;a href="http://www.ibm.com/software/websphere/" target="_blank"&gt;&lt;img src="http://www.techvj.com/misc/blog_images/common/websphere_logo.png" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://static.springsource.org/spring/docs/3.1.0.M1/spring-framework-reference/html/jms.html" target="_blank"&gt;Spring JMS&lt;/a&gt; provides a simple API to work with JMS implementations. This post describes how to use Spring JMS to communicate with &lt;a href="http://www.ibm.com/software/integration/wmq/" target="_blank"&gt;IBM WebSphere MQ&lt;/a&gt;. The code has been tested with WebSphere MQ version 7.0.1. &lt;a href="http://maven.apache.org/" target="_blank"&gt;Maven&lt;/a&gt; is used as the build tool. It is also used to resolve the WebSphere MQ and other dependencies. Only relevant code snippets are listed below - for the complete source, please refer to the link at the bottom of this post.&lt;/p&gt;&lt;p&gt;To start off we need to obtain the WebSphere MQ JARs. These JARs are proprietary - hence they will not resolve through a public Maven repository like &lt;a href="http://repo1.maven.org/maven2/" target="_blank"&gt;Maven Central&lt;/a&gt;. These JARs need to be obtained from the WebSphere MQ installation directory and manually deployed to our local Maven repository. The config below defines the WebSphere MQ dependencies in our Maven POM file.&lt;/p&gt;&lt;p&gt;&lt;script src="https://gist.github.com/896046.js?file=springjms_wsmq_1.xml"&gt;&lt;/script&gt; &lt;/p&gt;&lt;p&gt;Spring's &lt;a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jms/core/JmsTemplate.html" target="_blank"&gt;&lt;code&gt;JMSTemplate&lt;/code&gt;&lt;/a&gt; class is the key to simplifying access to the conventional JMS API. It abstracts the common and repetitive boiler-plate code by handling the creation and closing of connections and sessions, sending and receiving of messages and handling of exceptions. &lt;code&gt;JMSTemplate&lt;/code&gt; and a few other beans need to be defined in our Spring config.&lt;/p&gt;&lt;p&gt;&lt;script src="https://gist.github.com/896077.js"&gt;&lt;/script&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzaw.doc/uj29750_.htm" target="_blank"&gt;&lt;code&gt;MQQueueConnectionFactory&lt;/code&gt;&lt;/a&gt; defines the connection to the Queue Manager. Next we define &lt;a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jms/connection/SingleConnectionFactory102.html" target="_blank"&gt;&lt;code&gt;SingleConnectionFactory102&lt;/code&gt;&lt;/a&gt;, &lt;a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jms/support/destination/DynamicDestinationResolver.html" target="_blank"&gt;&lt;code&gt;DynamicDestinationResolver&lt;/code&gt;&lt;/a&gt; and finally &lt;a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jms/core/JmsTemplate102.html" target="_blank"&gt;&lt;code&gt;JmsTemplate102&lt;/code&gt;&lt;/a&gt;. The 102 suffix implies that our underlying JMS implementation version is 1.0.2. Now that our configuration is complete, we can send and receive JMS messages.&lt;/p&gt;&lt;p&gt;To send a JMS message, we use the &lt;a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jms/core/JmsTemplate.html#send%28java.lang.String,%20org.springframework.jms.core.MessageCreator%29" target="_blank"&gt;&lt;code&gt;send(String destinationName, MessageCreator creator)&lt;/code&gt;&lt;/a&gt; method of &lt;code&gt;JMSTemplate&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;&lt;script src="https://gist.github.com/896093.js"&gt;&lt;/script&gt; &lt;/p&gt;&lt;p&gt;To receive a message, we use the &lt;a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/jms/core/JmsTemplate.html#receive%28javax.jms.Destination%29" target="_blank"&gt;&lt;code&gt;receive(String destinationName)&lt;/code&gt;&lt;/a&gt; method.&lt;/p&gt;&lt;p&gt;&lt;script src="https://gist.github.com/896095.js"&gt;&lt;/script&gt; &lt;/p&gt;&lt;p&gt;As we can see, Spring's &lt;code&gt;JMSTemplate&lt;/code&gt; really simplifies and speeds-up connecting to a JMS provider like WebSphere MQ.&lt;/p&gt;&lt;br /&gt;
&lt;div class="src_lnk"&gt;&lt;div class="src_lnk_lft"&gt;&lt;div id="object1"&gt;&lt;img src="http://www.techvj.com/misc/blog_artifacts/common_images/txt.png" /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class="src_lnk_rgt"&gt;&lt;div style="font-weight:bold; margin-bottom:2px;"&gt;Sample Source Code&lt;/div&gt;&lt;div id="object4"&gt;A fully functional example Maven application accompanies this post. It provides the complete source code mentioned in this post. It can be downloaded at GitHub using the link below.&lt;/div&gt;&lt;div style="margin-top:10px;"&gt;&lt;a href="https://github.com/albuquerquev/springjms_wmq" target="_blank"&gt;https://github.com/albuquerquev/springjms_wmq&lt;/a&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/5369017427302932931-6611962843393768371?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/6611962843393768371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=6611962843393768371' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/6611962843393768371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/6611962843393768371'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2011/03/messaging-with-websphere-mq-using.html' title='Messaging With WebSphere MQ Using Spring JMS'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-5860196898877404470</id><published>2009-07-18T00:52:00.011+01:00</published><updated>2009-07-18T01:49:11.613+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Trakko'/><title type='text'>Trakko - Logging for Everyone</title><content type='html'>&lt;p&gt;&lt;a href="http://www.trakko.com/" target="_blank"&gt;&lt;img src="http://www.techvj.com/misc/blog_images/trakko/trakko_logo.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Today I am pleased to announce the launch of &lt;a href="http://www.trakko.com" target="_blank"&gt;Trakko&lt;/a&gt;, a personal project that I have been working on over the past few months. Trakko is an online general purpose logging application enabling users to log events in a central location. Every entry has a date and can be tagged to enable grouping of related entries. Trakko also supports exporting entries to a spreadsheet for reporting purposes.&lt;/p&gt;&lt;p&gt;Trakko was concieved entierly on a need basis and developed during weekends and my spare time. Over the years, I used a number of different ways to log events that I wanted to remember - text files, spreadsheets etc. I then developed a database application that I used personally. After regular use, I was certain that this application would be useful to a broad range of users who wish to keep track of events that are important to them. This led to the launch of Trakko.&lt;/p&gt;&lt;p&gt;Trakko has been built entirely on an open source stack. &lt;a href="http://www.mysql.com" target="_blank"&gt;MySQL&lt;/a&gt;, &lt;a href="http://www.springsource.org" target="_blank"&gt;Spring&lt;/a&gt;, &lt;a href="http://www.hibernate.org" target="_blank"&gt;Hibernate&lt;/a&gt;, &lt;a href="http://jquery.com" target="_blank"&gt;jQuery&lt;/a&gt; and a number of other open source technologies power Trakko.&lt;/p&gt;&lt;p&gt;If you feel the need to do some logging, try out Trakko and make sure you leave some &lt;a href="http://www.trakko.com/contact" target="_blank"&gt;feedback&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-5860196898877404470?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/5860196898877404470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=5860196898877404470' title='70 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/5860196898877404470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/5860196898877404470'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2009/07/trakko-logging-for-everyone.html' title='Trakko - Logging for Everyone'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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>70</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5369017427302932931.post-7899250917784536538</id><published>2009-01-19T14:35:00.019Z</published><updated>2011-03-18T12:25:08.009Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='jQuery'/><title type='text'>Live and Die with jQuery</title><content type='html'>&lt;p&gt;&lt;a href="http://www.jquery.com/" target="_blank"&gt;&lt;img src="http://www.techvj.com/misc/blog_images/common/jquery-logo.png" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://jquery.com/" target="_blank"&gt;jQuery&lt;/a&gt; is a JavaScript library that makes web programming simple and highly productive. With the new &lt;a href="http://blog.jquery.com/2009/01/14/jquery-13-and-the-jquery-foundation/" target="_blank"&gt;1.3 release&lt;/a&gt;, jQuery now supports &lt;code&gt;&lt;a href="http://docs.jquery.com/Events/live" target="_blank"&gt;live&lt;/a&gt;&lt;/code&gt; and &lt;code&gt;&lt;a href="http://docs.jquery.com/Events/die" target="_blank"&gt;die&lt;/a&gt;&lt;/code&gt; events. To understand &lt;code&gt;live&lt;/code&gt; and &lt;code&gt;die&lt;/code&gt; events, we must recollect how things were done before the 1.3 release. To bind events to elements we used jQuery's &lt;code&gt;&lt;a href="http://docs.jquery.com/Events/bind" target="_blank"&gt;bind&lt;/a&gt;&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;
&lt;pre name="code" class="javascript"&gt;
$("input:type=button").bind("click", function() {
    alert($(this).val());
});&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;The code above binds the &lt;code&gt;click&lt;/code&gt; event to all buttons on the page. However, there is one major drawback to using the &lt;code&gt;bind&lt;/code&gt; method. Any buttons dynamically added to the page in the future must be individually bound with the &lt;code&gt;click&lt;/code&gt; event. Hence, &lt;code&gt;bind&lt;/code&gt; only works on the set of elements currently in the &lt;a href="http://en.wikipedia.org/wiki/Document_Object_Model" target="_blank"&gt;DOM&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;live&lt;/code&gt; overcomes this drawback and binds to elements currently present and also ones added in the future. The syntax for &lt;code&gt;live&lt;/code&gt; is similar to &lt;code&gt;bind&lt;/code&gt;. The code below binds the &lt;code&gt;click&lt;/code&gt; event to all buttons currently on the page and even ones added in the future.
&lt;/p&gt;

&lt;p&gt;
&lt;pre name="code" class="javascript"&gt;
$("input:type=button").live("click", function() {
   alert($(this).val());
});
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;die&lt;/code&gt; is the opposite of &lt;code&gt;live&lt;/code&gt;. To unbind all events previously bound with &lt;code&gt;live&lt;/code&gt; we use the &lt;code&gt;die&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;
&lt;pre name="code" class="javascript"&gt;
$("input:type=button").die("click");
&lt;/pre&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-7899250917784536538?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/7899250917784536538/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=7899250917784536538' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/7899250917784536538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/7899250917784536538'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2009/01/live-and-die-with-jquery.html' title='Live and Die with jQuery'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-6589719764935828219</id><published>2008-04-09T17:06:00.004+01:00</published><updated>2009-01-08T15:48:10.851Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='GMail'/><category scheme='http://www.blogger.com/atom/ns#' term='Email'/><title type='text'>Advanced Filtering in GMail</title><content type='html'>&lt;p&gt;&lt;a href="http://www.gmail.com" target="_blank"&gt;&lt;img src="http://www.techvj.com/misc/blog_images/gmail_filters/googlemail.gif"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.gmail.com" target="_blank"&gt;GMail&lt;/a&gt; provides &lt;a href="http://mail.google.com/support/bin/answer.py?hl=en&amp;answer=6579" target="_blank"&gt;filters&lt;/a&gt; and &lt;a href="http://mail.google.com/support/bin/answer.py?hl=en&amp;answer=6560" target="_blank"&gt;labels&lt;/a&gt; that are an effective way to organize and access the huge number of emails that we receive everyday.&lt;/p&gt;&lt;p&gt;Recently I came across another feature of GMail that takes filtering of email to a whole new level. Every GMail address can be suffixed with a + followed by some text. E.g. john@gmail.com can be aliased as john+family@gmail.com, john+facebook@gmail.com or john+cv@gmail.com. All of the aliased mail gets sent to the primary account (john@gmail.com). This opens up whole new possibilities for powerful filtering.&lt;/p&gt;&lt;p&gt;Take for example the email address you provide on your CV or at a job search website. At times when you are actively looking for a new job, these emails are highly important. During other times, you might not want your Inbox to be cluttered with job notifications. This can be easily handled using GMail email aliases. Simply provide john+cv@gmail.com (or john+123@gmail.com if you wish to be discrete) when signing up at a job search website and on your CV. Next &lt;a href="http://mail.google.com/support/bin/answer.py?hl=en&amp;answer=6579" target="_blank"&gt;setup a GMail filter&lt;/a&gt; that looks for emails sent to john+cv@gmail.com and either flags them for your attention or at other times automatically deletes them!&lt;/p&gt;&lt;p&gt;Email rules and filters have existed for a long time but GMail aliases take this to a whole new level. The possibilities (of email suffixes) are indeed endless!&lt;/p&gt;&lt;p align="center"&gt;&lt;img src="http://www.techvj.com/misc/blog_images/gmail_filters/gmail_filters.jpg" /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-6589719764935828219?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/6589719764935828219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=6589719764935828219' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/6589719764935828219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/6589719764935828219'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2008/04/advanced-filtering-in-gmail.html' title='Advanced Filtering in GMail'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-6443749302499029433</id><published>2008-03-20T16:45:00.005Z</published><updated>2009-01-08T15:48:47.891Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Ivy'/><title type='text'>Apache Ivy</title><content type='html'>&lt;p&gt;&lt;a href="http://ant.apache.org/ivy" target="_blank"&gt;&lt;img src="http://www.techvj.com/misc/blog_images/apache_ivy/ivy.jpg"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Almost all Java projects, apart from the most trivial ones have dependencies. These dependencies could either be on other projects or third-party libraries. Managing these dependencies can be extremely time-consuming and distracting from the primary focus of the project. &lt;a href="http://ant.apache.org/ivy" target="_blank"&gt;Apache Ivy&lt;/a&gt; is a tool for managing library dependencies. Ivy neatly fills the gap by providing an easily configurable and automated dependency management system. Further, Ivy supports transitive dependencies management. Hence all we need to do is declare our main dependencies and Ivy automatically fetches all the sub dependencies along with the main dependencies from a public location such as the &lt;a href="http://repo1.maven.org/maven2/" target="_blank"&gt;Maven 2 repository&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;h2&gt;Installation&lt;/h2&gt;Ivy is designed to work with &lt;a href="http://ant.apache.org" target="_blank"&gt;Ant&lt;/a&gt;, wherein Ant is used to run the build tasks and Ivy is used to resolve, retrieve and manage the dependencies. The simplest way to get started is to copy the Ivy jar file to the Ant lib (ANT_HOME/lib) directory.&lt;/p&gt;&lt;p&gt;&lt;h2&gt;Configure ivy.xml&lt;/h2&gt;The ivy.xml configuration file is the main file that is used to describe our dependencies. Below is an example of a configuration file that states two main dependencies, &lt;a href="http://www.hibernate.org" target="_blank"&gt;Hibernate&lt;/a&gt; and the &lt;a href="http://sourceforge.net/projects/c3p0" target="_blank"&gt;C3P0&lt;/a&gt; library.&lt;div class="codeBlock"&gt;&lt;pre&gt;&lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;&lt;span style=' color: Maroon;'&gt;ivy-module&lt;/span&gt; &lt;span style=' color: Red;'&gt;version&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;2.0&lt;/span&gt;"&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;&lt;span style=' color: Maroon;'&gt;info&lt;/span&gt; &lt;span style=' color: Red;'&gt;organisation&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;techvj&lt;/span&gt;" &lt;span style=' color: Red;'&gt;module&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;ivy-test&lt;/span&gt;" /&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;&lt;span style=' color: Maroon;'&gt;dependencies&lt;/span&gt;&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;
        &lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;&lt;span style=' color: Maroon;'&gt;dependency&lt;/span&gt; &lt;span style=' color: Red;'&gt;org&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;org.hibernate&lt;/span&gt;" &lt;span style=' color: Red;'&gt;name&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;hibernate&lt;/span&gt;" &lt;span style=' color: Red;'&gt;rev&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;3.2.6.ga&lt;/span&gt;" /&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;
        &lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;&lt;span style=' color: Maroon;'&gt;dependency&lt;/span&gt; &lt;span style=' color: Red;'&gt;org&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;c3p0&lt;/span&gt;" &lt;span style=' color: Red;'&gt;name&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;c3p0&lt;/span&gt;" &lt;span style=' color: Red;'&gt;rev&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;0.9.1.2&lt;/span&gt;" /&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;/&lt;span style=' color: Maroon;'&gt;dependencies&lt;/span&gt;&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;
&lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;/&lt;span style=' color: Maroon;'&gt;ivy-module&lt;/span&gt;&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;&lt;h2&gt;Integrate With Ant&lt;/h2&gt;The final step is to integrate the Ivy dependency resolution process with our Ant build process. Following is an example of a build.xml file with the retrieve task defined:&lt;div class="codeBlock"&gt;&lt;pre&gt;&lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;&lt;span style=' color: Maroon;'&gt;project&lt;/span&gt; &lt;span style=' color: Red;'&gt;xmlns:ivy&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;antlib:org.apache.ivy.ant&lt;/span&gt;" &lt;span style=' color: Red;'&gt;name&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;hello-ivy&lt;/span&gt;" &lt;span style=' color: Red;'&gt;default&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;retrieve&lt;/span&gt;"&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;
    ...
    &lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;&lt;span style=' color: Maroon;'&gt;target&lt;/span&gt; &lt;span style=' color: Red;'&gt;name&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;retrieve&lt;/span&gt;" &lt;span style=' color: Red;'&gt;description&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;&lt;/span&gt;"&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;
        &lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;&lt;span style=' color: Maroon;'&gt;ivy:retrieve&lt;/span&gt; /&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;/&lt;span style=' color: Maroon;'&gt;target&lt;/span&gt;&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;
&lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;/&lt;span style=' color: Maroon;'&gt;project&lt;/span&gt;&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;&lt;p&gt;On running the above Ant build, Ivy retrieves the Hibernate and C3P0 libraries and all of their dependencies to the local machine. The retrieved libraries are stored in a cache and not downloaded again on successive invocations. Apache Ivy is a great tool in a Java developer's toolbox for managing library dependencies.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-6443749302499029433?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/6443749302499029433/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=6443749302499029433' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/6443749302499029433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/6443749302499029433'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2008/03/apache-ivy.html' title='Apache Ivy'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-3697315109154645940</id><published>2008-03-19T12:55:00.002Z</published><updated>2008-03-19T13:00:20.806Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Wicked Shell for Eclipse</title><content type='html'>&lt;p&gt;An Eclipse plug-in that I have begun to regularly use is &lt;a href="http://www.wickedshell.net" target="_blank"&gt;Wicked Shell&lt;/a&gt;. Wicked Shell provides direct access to the operating system's shell (Cmd, Bash, SH etc.). In fact it is not an actual shell, it only acts as a window to the underlying shell using a SWT text widget to transfer commands and display output. The result is having an Eclipse view that behaves as a shell.&lt;/p&gt;&lt;p&gt;As with any Eclipse view that is regularly accessed, I would suggest setting up a shortcut &lt;a href="http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/wrkAdv_keyBindings_accelSet.htm" target="_blank"&gt;key binding&lt;/a&gt; for Wicked Shell. On my installation I chose &lt;code&gt;Alt+Shift+Q, S&lt;/code&gt; as the combination did not conflict with other pre-set bindings.&lt;/p&gt;&lt;p align="center"&gt;&lt;a href="http://www.techvj.com/misc/blog_images/wicked_shell/wickedshell.jpg" target="_blank"&gt;&lt;img src="http://www.techvj.com/misc/blog_images/wicked_shell/wickedshell_min.jpg"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-3697315109154645940?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/3697315109154645940/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=3697315109154645940' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/3697315109154645940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/3697315109154645940'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2008/03/wicked-shell-for-eclipse.html' title='Wicked Shell for Eclipse'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-7093853576537494625</id><published>2007-11-12T17:04:00.000Z</published><updated>2007-11-12T17:45:18.689Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Authentication'/><category scheme='http://www.blogger.com/atom/ns#' term='PPP'/><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><title type='text'>Perfect Paper Passwords - Two-Factor Authentication for the Masses</title><content type='html'>&lt;p&gt;Usernames and passwords have long been established as the de facto form of &lt;a href="http://en.wikipedia.org/wiki/Authentication" target="_blank"&gt;authentication&lt;/a&gt; for websites and other systems. They provide a convenient system for authenticating and identifying users. However, they are also highly vulnerable to dictionary attacks, weak passwords, key-loggers etc. Recently, &lt;a href="http://en.wikipedia.org/wiki/Two-factor_authentication" target="_blank"&gt;two-factor authentication&lt;/a&gt; has been suggested as providing a much stronger approach. In addition to 'Something You Know', such as a password, you also provide 'Something You Have', such as a &lt;a href="http://en.wikipedia.org/wiki/Security_token" target="_blank"&gt;security token&lt;/a&gt;. &lt;a href="http://www.verisign.com" target="_blank"&gt;Verisign&lt;/a&gt; and &lt;a href="http://www.rsa.com" target="_blank"&gt;RSA Security&lt;/a&gt; offer such products that produce a time-synchronized sequence of digits that change at regular intervals. Systems that incorporate these security token mechanisms, accept the sequence of digits in addition to a password during authentication.&lt;/p&gt;&lt;p&gt;Steve Gibson from &lt;a href="http://www.grc.com" target="_blank"&gt;GRC&lt;/a&gt; recently released a similar system based on passcodes. The &lt;a href="https://www.grc.com/ppp" target="_blank"&gt;Perfect Paper Passwords&lt;/a&gt; system produces a set of one-time passcodes. The passcodes are created using a 256-bit Sequence Key passed through a Rijndael/AES Cipher. The passcodes are then grouped into credit card sized passcards across 7 columns and 10 rows. During authentication, the system would prompt the user to enter the passcode at a particular column-row location (e.g. A3, D8 etc.). Since the passcards can be printed on paper it is an inexpensive, simple and highly-effective method of providing two-factor authentication.&lt;/p&gt;&lt;p align="center"&gt;&lt;img src="http://www.techvj.com/misc/blog_images/ppp/passcard.jpg" /&gt;&lt;/p&gt;&lt;p&gt;The system has been released freely for public use and there are a number of language specific &lt;a href="http://www.grc.com/ppp/othersoftware.htm" target="_blank"&gt;implementations&lt;/a&gt; already in place. Based on the sheer number of possible combinations, the PPP system is 16.77 times more secure than the token based systems by Verisign and RSA Security!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-7093853576537494625?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/7093853576537494625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=7093853576537494625' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/7093853576537494625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/7093853576537494625'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2007/11/perfect-paper-passwords-two-factor.html' title='Perfect Paper Passwords - Two-Factor Authentication for the Masses'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-4479537187076782061</id><published>2007-11-02T10:57:00.002Z</published><updated>2008-04-11T11:15:23.452+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Quick Access in Eclipse</title><content type='html'>&lt;p&gt;Any software developer using an IDE begins to truly appreciate keyboard shortcut keys to make the coding process more seamless. &lt;a href="http://www.eclipse.org/" target="_blank"&gt;Eclipse&lt;/a&gt; has a rich set of keyboard shortcuts for almost every task and view. &lt;code&gt;Ctrl+Shift+L&lt;/code&gt; produces a list of all available keyboard shortcuts. Remembering these key combinations for regular tasks is fairly simple, however we often recollect the task to be performed or the view to be opened without knowing the keys to be pressed.&lt;/p&gt;&lt;p&gt;&lt;a href="http://archive.eclipse.org/eclipse/downloads/drops/S-3.3M7-200705031400/index.php" target="_blank"&gt;Eclipse 3.3 M7&lt;/a&gt; introduced a new feature called &lt;i&gt;Quick Access&lt;/i&gt; (&lt;code&gt;Ctrl+3&lt;/code&gt;). With Quick Access, UI elements such as commands, views, wizards, preference pages etc. can be quickly listed and filtered through. &lt;code&gt;Ctrl+3&lt;/code&gt; or Window -&gt; Navigation -&gt; Quick Access from the menu brings up the Quick Access dialog. On typing in the filter field, the list dynamically filters to display relevant matches. Using the arrow keys, the desired option can be selected and executed.&lt;/p&gt;&lt;p&gt;The next time Quick Access is opened, previous choices made will be remembered and initially displayed. Further, the filter automatically lists previous choices made across different key sequences at the top. Quick Access has now become my &lt;a href="http://en.wikipedia.org/wiki/Swiss_Army_knife" target="_blank"&gt;Swiss Army Knife&lt;/a&gt; while using Eclipse for development.&lt;/p&gt;&lt;p align="center"&gt;&lt;img src="http://www.techvj.com/misc/blog_images/eclipse_qaccess/eclipse_qaccess.jpg"&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-4479537187076782061?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/4479537187076782061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=4479537187076782061' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/4479537187076782061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/4479537187076782061'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2007/11/any-software-developer-using-ide-begins.html' title='Quick Access in Eclipse'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-7093670145040577776</id><published>2007-09-28T15:41:00.000+01:00</published><updated>2007-09-28T22:50:21.668+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OpenSource'/><category scheme='http://www.blogger.com/atom/ns#' term='Middleware'/><title type='text'>Best of Open Source in Platforms and Middleware</title><content type='html'>&lt;p align="center"&gt;&lt;a href="http://www.infoworld.com/slideshow/2007/09/114-best_of_open_so-1.html" target="_blank"&gt;&lt;img src="http://www.techvj.com/misc/blog_images/bossie_awards_07/bossie_awards.jpg" width="434" height="322" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Being a software developer, I have truly begun to appreciate the benefits that my organization receives from Open Source software. This is especially true of &lt;a href="http://en.wikipedia.org/wiki/Middleware" target="_blank"&gt;middleware&lt;/a&gt; which consists of the &lt;span style="font-style:italic;"&gt;meat&lt;/span&gt; of our IT infrastructure. Right from our Java EE application servers to our Web Services stack, the choice and quality of middleware available is truly phenomenal.&lt;/p&gt;&lt;p&gt;Infoworld recently announced the &lt;a href="http://www.infoworld.com/slideshow/2007/09/114-best_of_open_so-1.html" target="_blank"&gt;2007 BOSSIE Awards&lt;/a&gt; for the &lt;span style="font-style:italic;"&gt;Best of open source in platforms and middleware&lt;/span&gt;. I was glad to see &lt;a href="http://labs.jboss.com" target="_blank"&gt;JBoss&lt;/a&gt; and &lt;a href="http://www.mysql.com" target="_blank"&gt;MySQL&lt;/a&gt; picking up awards - two products that I use every single day.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-7093670145040577776?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/7093670145040577776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=7093670145040577776' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/7093670145040577776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/7093670145040577776'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2007/09/best-of-open-source-in-platforms-and.html' title='Best of Open Source in Platforms and Middleware'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-1570238823237951756</id><published>2007-09-09T15:55:00.001+01:00</published><updated>2007-09-09T16:13:10.197+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ProjectBlackbox'/><category scheme='http://www.blogger.com/atom/ns#' term='SunMicrosystems'/><title type='text'>Project Blackbox</title><content type='html'>&lt;p align="center"&gt;&lt;a href="http://www.techvj.com/misc/blog_images/project_blackbox/blackbox_large.jpg" target="_blank"&gt;&lt;img src="http://www.techvj.com/misc/blog_images/project_blackbox/blackbox.jpg" width="404"  height="272" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.sun.com/emrkt/blackbox/index.jsp" target="_blank"&gt;Project Blackbox&lt;/a&gt; was launched around a year ago by &lt;a href="http://www.sun.com" target="_blank"&gt;Sun Microsystems&lt;/a&gt;. It is promoted as a mobile data center built into a 20' shipping container. The goal behind Project Blackbox is to provide a significantly powerful and capable data center that can be easily configured and deployed to varied and extreme locations. It is an interesting product and can be seen to fit into a number of &lt;a href="http://www.sun.com/emrkt/blackbox/scenarios.jsp" target="_blank"&gt;scenarios&lt;/a&gt; where a traditional &lt;i&gt;brick-and-mortar&lt;/i&gt; data center would not be feasible.&lt;/p&gt;&lt;p&gt;The Project Blackbox &lt;a href="http://www.sun.com/emrkt/blackbox/index.jsp" target="_blank"&gt;website&lt;/a&gt; has interesting information on the product. The video of the Earthquake Test of magnitude 6.7 is particularly impressive. I hope to soon spot black shipping containers with the Sun logo on rooftops all over our city.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-1570238823237951756?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/1570238823237951756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=1570238823237951756' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/1570238823237951756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/1570238823237951756'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2007/09/project-blackbox.html' title='Project Blackbox'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-1106579286329505437</id><published>2007-08-12T12:40:00.000+01:00</published><updated>2007-08-14T12:45:22.433+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SecurityNow'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='MemoryManagement'/><title type='text'>Memory Monitoring on Security Now</title><content type='html'>&lt;p&gt;&lt;a href="http://www.twit.tv/SN" target="_blank"&gt;Security Now&lt;/a&gt; is a weekly podcast that focuses on the topic of computer security. I am a regular listener to the show and received a rather pleasant surprise to find a question that I had posted to the podcast being discussed.&lt;p&gt;&lt;p&gt;I often like to track usage of memory (RAM) on my Windows machine. The tool that I usually use is the built-in Process List monitor (activated using Ctrl-Alt-Del). However, I was wondering if there was a more user-friendly app, possibly with a graphical view displaying memory usage by applications and processes. Hence I posted the question to Security Now. Below is the transcript of the question being discussed by Steve Gibson and Leo Laporte on Security Now &lt;a href="http://www.twit.tv/sn104" target="_blank"&gt;Episode 104&lt;/a&gt;.&lt;/p&gt;&lt;p style="color: gray; padding-left: 10px; border-left: 2px; border-left-style: solid;"&gt;...&lt;br/&gt;&lt;br/&gt;LEO:  That’s the problem is that it’s all, you know, it’s international.  You know, it’s tough because we’re an international podcast.  For instance, Vijay Albuquerque in London - or it could be Vijay London in Albuquerque, doesn’t matter - now has plenty of room on his drive.  He says:  Dear Steve and Leo, after hearing about SpaceMonger, which  by the way, Steve, I’ve been recommending everywhere, the original free version...&lt;br/&gt;&lt;br/&gt;STEVE:  Yup, it’s so nice.&lt;br/&gt;&lt;br/&gt;LEO:  I just recommended it on the radio show last weekend.  He says:  I’ve reclaimed virtually gigabytes of data from my hard drive.  It gives you a visual display of what’s wasting space on your hard drive, makes it easier to get rid of it.  He says:  Is there something for memory, for RAM?  He’s using the process monitor.  You hit Ctrl-Alt-Del to get the Task Manager, and then you can click Processes and see the list of processes.  But there must be a simpler, friendlier tool out there, something like SpaceMonger for RAM.  I like it.&lt;br/&gt;&lt;br/&gt;STEVE:  RAM Monger or something, yeah.  Well, it was an interesting question, so I wanted to explain that, you know, RAM is an entirely different animal than hard drive space because it is inherently dynamic.  So applications which are running will use differing amounts of RAM, but there’s really no way to tell an application to stop using that much memory unless it’s a sloppy application that, for example, you could have a photo editing program where you edit a big photo which takes up a whole bunch of memory, and then when you close that photo it doesn’t release the memory, for example.  So it’s possible that you could have apps which are misbehaving and essentially leaking memory.&lt;br/&gt;&lt;br/&gt;But thankfully all Windows versions for the last decade have cleaned up the so-called "resource leaks" when the application terminates and freed up anything, any resources that they had allocated.  So really just terminating processes, if you can, that is, if you don’t need them around, that are using up a lot of memory, will release their memory.  But there isn’t anything that you could run to really clean up memory.  There are some sort of hokey programs that are supposed to optimize your RAM.  But they’ve really got a bad reputation.  And really just, if you have this problem, just restarting Windows and getting things going again is the way to clear everything out.&lt;br/&gt;&lt;br/&gt;LEO:  In the old days of Windows 95, 98, and ME, the memory manager was pretty pathetic, and so you would have fragmentation of RAM, and you’d have some issues.  But XP’s memory manager is fine, and there’s no point in compacting RAM.&lt;br/&gt;&lt;br/&gt;STEVE:  Right, right.&lt;br/&gt;&lt;br/&gt;LEO:  I think the memory manager does a pretty good job of getting rid of unused blocks.  It can’t solve a memory leak, but nothing can solve it.  If the operating system won’t get rid of that block, you know, release the block, no program’s going to come along and do it.  So...&lt;br/&gt;&lt;br/&gt;STEVE:  Right.&lt;br/&gt;&lt;br/&gt;...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-1106579286329505437?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/1106579286329505437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=1106579286329505437' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/1106579286329505437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/1106579286329505437'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2007/08/memory-monitoring-on-security-now.html' title='Memory Monitoring on Security Now'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-2143797927040000516</id><published>2007-07-24T16:10:00.000+01:00</published><updated>2007-07-26T10:52:38.380+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='LambdaProbe'/><category scheme='http://www.blogger.com/atom/ns#' term='Tomcat'/><title type='text'>Lambda Probe - Manage Tomcat with Simplicity</title><content type='html'>&lt;p&gt;&lt;a href="http://tomcat.apache.org" target="_blank"&gt;Apache Tomcat&lt;/a&gt; is&amp;nbsp;arguably the most popular servlet container in use today. It has a well-established user base and is usually one of the first to implement new Servlet and JSP JSR specifications. Tomcat comes bundled with the &lt;a href="http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html" target="_blank"&gt;Manager App&lt;/a&gt; that allows to perform management tasks such as deployment, reloading etc. of webapps and other related services. The Manager App&amp;nbsp;also provides an interface for integration with &lt;a href="http://ant.apache.org" target="_blank"&gt;Ant&lt;/a&gt; and in the future there are plans to also provide a web service interface. The browser-based interface is functional but seems a little lacking especially for monitoring the Tomcat and JVM runtime. This space has been neatly filled by an open source project called &lt;a href="http://www.lambdaprobe.org" target="_blank"&gt;Lambda Probe&lt;/a&gt;. Lambda Probe installs&amp;nbsp;as just another web application under Tomcat and provides a clean, simple visual interface for core administration and monitoring.&lt;/p&gt;&lt;p&gt;Along with performing the usual tasks such as listing, deploying, reloading and un-deploying webapps, Lambda Probe provides&amp;nbsp;comprehensive system monitoring information, JMX integration to monitor memory usage, connector stats for HTTP requests made and clustering information. Another useful feature is browsing the Tomcat log files which can be &lt;em&gt;tailed&lt;/em&gt; in real time. Lambda Probe also provides an &lt;span style="font-style:italic;"&gt;Availability Quick Check&lt;/span&gt;. Quick check is an instant way of checking the availability of the Tomcat server against three primary parameters: data source availability, free memory availability and file creation capability.&lt;/p&gt;&lt;p align="center"&gt;&lt;a href="http://www.techvj.com/misc/blog_images/lambda_probe/lambda_probe.jpg" target="_blank"&gt;&lt;img class="image01" src="http://www.techvj.com/misc/blog_images/lambda_probe/lambda_probe_min.jpg"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-2143797927040000516?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/2143797927040000516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=2143797927040000516' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/2143797927040000516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/2143797927040000516'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2007/07/lambda-probe-manage-tomcat-with.html' title='Lambda Probe - Manage Tomcat with Simplicity'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-2384179788697633876</id><published>2007-06-14T14:54:00.000+01:00</published><updated>2007-06-23T20:55:00.329+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Javadocs'/><category scheme='http://www.blogger.com/atom/ns#' term='Subversion'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Displaying Javadocs in Subversion</title><content type='html'>&lt;p&gt;Javadocs&amp;nbsp;are an essential component of any Java project. It is a convenient way for a developer to gain an understanding of&amp;nbsp;the API and the&amp;nbsp;prescribed ways to use it. This is especially true when hosting open source projects on &lt;a href="http://code.google.com/hosting" target="_blank"&gt;Google Code&lt;/a&gt; or &lt;a href="http://www.sourceforge.net" target="_blank"&gt;Sourceforge&lt;/a&gt;. &lt;a href="http://subversion.tigris.org" target="_blank"&gt;Subversion&lt;/a&gt; is increasingly used as a revision control system to host source code and other project related artifacts. Google Code uses Subversion exclusively while Sourceforge provides it as an option. At times, for the convenience of hosting and&amp;nbsp;to centralize resources it&amp;nbsp;may be required to host the&amp;nbsp;Javadocs in Subversion and access them via a browser.&amp;nbsp;When using &lt;a href="http://www.eclipse.org" target="_blank"&gt;Eclipse&lt;/a&gt; as the IDE, connecting to a Subversion&amp;nbsp;server is simple through the &lt;a href="http://subclipse.tigris.org/" target="_blank"&gt;Subclipse&lt;/a&gt; plugin.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img src="http://www.techvj.com/misc/blog_images/javadoc_svn/javadoc_svn_01.jpg"&gt;&lt;/p&gt;
&lt;p&gt;On successfully committing the Javadocs to the server and viewing the exported pages through a browser, we notice that the pages display in text and are not rendered as normal HTML pages by the browser (&lt;a href="http://www.techvj.com/misc/blog_images/javadoc_svn/javadoc_svn_02.jpg" target="_blank"&gt;Screenshot&lt;/a&gt;). The reason&amp;nbsp;behind this&amp;nbsp;is that the MIME type for the pages is set to &lt;code&gt;text/plain&lt;/code&gt; and must be changed to &lt;code&gt;text/html&lt;/code&gt;. This can be achieved through the Eclipse UI by&amp;nbsp;applying the MIME type to the &lt;code&gt;svn:mime-type&lt;/code&gt; property on the root directory of the Javadocs. The &lt;em&gt;Set property recursively&lt;/em&gt; option must be checked to ensure that all the pages under subdirectories are also updated with the correct type.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img src="http://www.techvj.com/misc/blog_images/javadoc_svn/javadoc_svn_03.jpg"&gt;&lt;/p&gt;
&lt;p&gt;The last change is to update the MIME type of &lt;em&gt;stylesheet.css&lt;/em&gt; to &lt;code&gt;text/css&lt;/code&gt;. The Javadocs in Subversion&amp;nbsp;can now be&amp;nbsp;viewed successfully through a browser (&lt;a href="http://www.techvj.com/misc/blog_images/javadoc_svn/javadoc_svn_04.jpg" target="_blank"&gt;Screenshot&lt;/a&gt;).&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-2384179788697633876?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/2384179788697633876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=2384179788697633876' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/2384179788697633876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/2384179788697633876'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2007/06/displaying-javadocs-in-subversion.html' title='Displaying Javadocs in Subversion'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-3721258436767665459</id><published>2007-06-05T16:38:00.000+01:00</published><updated>2007-06-08T12:26:28.114+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='URLPing'/><title type='text'>URLPing - A Java Utility to Ping a URL</title><content type='html'>&lt;p&gt;&lt;a href="http://www.techvj.com/urlping" target="_blank"&gt;&lt;img src="http://www.techvj.com/misc/blog_images/urlping/urlping.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Recently there was a need at work to programmatically check the status of a URL.&amp;nbsp;The requirement was to test if a specified URL returned a HTTP Status Code 200 OK or otherwise. &lt;a href="http://www.techvj.com/urlping" target="_blank"&gt;URLPing&lt;/a&gt;, the utility that I wrote has been&amp;nbsp;hosted on Google Code and is available for download and reuse. The utility uses the Apache Jakarta Commons &lt;a href="http://jakarta.apache.org/commons/httpclient" target='_blank'&gt;HttpClient&lt;/a&gt; component.&lt;/p&gt;&lt;p&gt;&lt;code&gt;URLPing&lt;/code&gt; is the main class. This class provides two methods &lt;code&gt;ping(String url)&lt;/code&gt; and &lt;code&gt;ping(String url, int timeout)&lt;/code&gt;. The first method accepts a URL to ping and defaults to a timeout of 30 seconds. The second method accepts a timeout interval in seconds in addition to the URL to ping.&lt;/p&gt;&lt;div class="codeBlock"&gt;&lt;pre&gt;URLPing urlPing = &lt;span style=' color: Blue;'&gt;new&lt;/span&gt; URLPing();
PingResponse pingResponse = urlPing.ping(&lt;span style=' color: Maroon;'&gt;"http://www.techvj.com"&lt;/span&gt;);
        
assertEquals(pingResponse.getResponseStatus(), ResponseStatus.OKAY);&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The response to the ping method is a &lt;code&gt;PingReponse&lt;/code&gt; object. This contains a &lt;code&gt;ResponseStatus&lt;/code&gt; enum with values of either &lt;code&gt;OKAY&lt;/code&gt;, &lt;code&gt;ERROR&lt;/code&gt; or &lt;code&gt;TIMEOUT&lt;/code&gt; depending on the outcome of the ping. It also contains a &lt;code&gt;responseCode&lt;/code&gt; property which contains the response code of the HTTP request.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-3721258436767665459?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/3721258436767665459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=3721258436767665459' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/3721258436767665459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/3721258436767665459'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2007/06/urlping-java-utility-to-ping-url.html' title='URLPing - A Java Utility to Ping a URL'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-205302499033116154</id><published>2007-06-05T10:29:00.000+01:00</published><updated>2007-06-05T16:46:47.601+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GoogleCalendar'/><category scheme='http://www.blogger.com/atom/ns#' term='I18N'/><title type='text'>Google Calendar Error Page</title><content type='html'>&lt;p&gt;Don't come across Google products crashing very often, however this morning my &lt;a href="http://calendar.google.com" target="_blank"&gt;Google Calendar&lt;/a&gt; instance crashed with a 'Server Error'. Well, Google Calendar is still in Beta and this is the first time it has crashed on me.&amp;nbsp;I found the error page very interesting. It contained the same error message in 18 languages! Now that denotes an app with true internationalization...&lt;/p&gt;&lt;p align="center"&gt;&lt;a href="http://www.techvj.com/misc/blog_images/gcal_error/gcal_error.jpg" target="_blank"&gt;&lt;img class="image01" src="http://www.techvj.com/misc/blog_images/gcal_error/gcal_error_min.jpg"&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-205302499033116154?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/205302499033116154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=205302499033116154' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/205302499033116154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/205302499033116154'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2007/06/google-calendar-error-page.html' title='Google Calendar Error Page'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-6715184483463407394</id><published>2007-04-26T14:26:00.001+01:00</published><updated>2007-07-24T16:08:52.718+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaEE'/><category scheme='http://www.blogger.com/atom/ns#' term='SpringFramework'/><category scheme='http://www.blogger.com/atom/ns#' term='Hibernate'/><title type='text'>Long-running Processes with Spring DAO and Hibernate</title><content type='html'>&lt;p&gt;&lt;a href="http://www.springframework.org" target="_blank"&gt;Spring&lt;/a&gt; and &lt;a href="http://www.hibernate.org" target="_blank"&gt;Hibernate&lt;/a&gt; are increasingly used together in Java web applications. Spring is used as the &lt;a href="http://java.sun.com/blueprints/patterns/MVC.html" target="_blank"&gt;MVC&lt;/a&gt; and &lt;a href="http://http://www.martinfowler.com/articles/injection.html" target="_blank"&gt;dependency-injection&lt;/a&gt; framework and also provides support for data access, transaction management etc. Hibernate is usually used alongside Spring as the object-relational mapping framework. Spring's support for Hibernate is impressive through it's &lt;a href="http://java.sun.com/blueprints/patterns/DAO.html" target="_blank"&gt;DAO&lt;/a&gt; templating mechanism. This truly simplifies matters as all the routine infrastructure plumbing code is taken care of by Spring.&lt;/p&gt;&lt;p&gt;Spring intercepts requests made to the webapp and through dependency-injection makes objects available in order to fulfil the request. This includes creating the Hibernate &lt;code&gt;&lt;a href="http://www.hibernate.org/hib_docs/v3/api/org/hibernate/Session.html" target="_blank"&gt;Session&lt;/a&gt;&lt;/code&gt; object used by the DAOs. The &lt;code&gt;Session&lt;/code&gt; object is lightweight and created and destroyed for every request. Hibernate sessions are not threadsafe and should be used by only one thread at a time. In order to keep the session open throughout the lifetime of a request we tie it to the view. This is done either by using Spring's &lt;code&gt;&lt;a href="http://www.springframework.org/docs/api/org/springframework/orm/hibernate/support/OpenSessionInViewInterceptor.html" target="_blank"&gt;OpenSessionInViewInterceptor&lt;/a&gt;&lt;/code&gt; or &lt;code&gt;&lt;a href="http://www.springframework.org/docs/api/org/springframework/orm/hibernate/support/OpenSessionInViewFilter.html" target="_blank"&gt;OpenSessionInViewFilter&lt;/a&gt;&lt;/code&gt; as below:&lt;/p&gt;&lt;div class="codeBlock"&gt;&lt;pre&gt;&lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;&lt;span style=' color: Maroon;'&gt;bean&lt;/span&gt; &lt;span style=' color: Red;'&gt;id&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;openSessionInViewInterceptor&lt;/span&gt;" 
    &lt;span style=' color: Red;'&gt;class&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor&lt;/span&gt;"&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;&lt;span style=' color: Maroon;'&gt;property&lt;/span&gt; &lt;span style=' color: Red;'&gt;name&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;sessionFactory&lt;/span&gt;" &lt;span style=' color: Red;'&gt;ref&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;sessionFactory&lt;/span&gt;" /&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;&lt;span style=' color: Maroon;'&gt;property&lt;/span&gt; &lt;span style=' color: Red;'&gt;name&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;flushModeName&lt;/span&gt;" &lt;span style=' color: Red;'&gt;value&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;Flush_AUTO&lt;/span&gt;" /&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;
&lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;/&lt;span style=' color: Maroon;'&gt;bean&lt;/span&gt;&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;

&lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;&lt;span style=' color: Maroon;'&gt;bean&lt;/span&gt; &lt;span style=' color: Red;'&gt;id&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;sessionFactory&lt;/span&gt;" &lt;span style=' color: Red;'&gt;class&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;org.springframework.orm.hibernate3.LocalSessionFactoryBean&lt;/span&gt;"&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;
    &lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;&lt;span style=' color: Maroon;'&gt;property&lt;/span&gt; &lt;span style=' color: Red;'&gt;name&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;dataSource&lt;/span&gt;" &lt;span style=' color: Red;'&gt;ref&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;dataSource&lt;/span&gt;" /&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;
    ...
&lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;/&lt;span style=' color: Maroon;'&gt;bean&lt;/span&gt;&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;

&lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;&lt;span style=' color: Maroon;'&gt;bean&lt;/span&gt; &lt;span style=' color: Red;'&gt;id&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;dataSource&lt;/span&gt;" &lt;span style=' color: Red;'&gt;class&lt;/span&gt;="&lt;span style=' color: Blue;'&gt;org.apache.commons.dbcp.BasicDataSource&lt;/span&gt;"&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;
    ...
&lt;span style=' color: Blue;'&gt;&amp;lt;&lt;/span&gt;/&lt;span style=' color: Maroon;'&gt;bean&lt;/span&gt;&lt;span style=' color: Blue;'&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Most requests are synchronous and completed before the response is returned to the client. However, in the case of long-running processes, a new thread is created for execution of the process. The response is returned back to the client and the process runs independently on the server. Hibernate sessions obtained through &lt;code&gt;OpenSessionInViewInterceptor&lt;/code&gt; are no longer available to the process as they are closed once the view has returned. This throws a &lt;code&gt;&lt;a href="http://www.hibernate.org/hib_docs/v3/api/org/hibernate/LazyInitializationException.html" target="_blank"&gt;LazyInitializationException&lt;/a&gt;&lt;/code&gt; complaining that the owning session was closed.&lt;/p&gt;&lt;p&gt;The problem can be overcome by directly accessing the Hibernate &lt;code&gt;&lt;a href="http://www.hibernate.org/hib_docs/v3/api/org/hibernate/SessionFactory.html" target="_blank"&gt;SessionFactory&lt;/a&gt;&lt;/code&gt; bean and binding the session to the long-running process thread. Hence the session is available and open within the thread itself. The UML diagram below describes our objects.&lt;/p&gt;&lt;p align="center"&gt;&lt;img src="http://www.techvj.com/misc/blog_images/longprocesses_springdao/longprocess.jpg" /&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;TestController&lt;/code&gt; is the &lt;code&gt;&lt;a href="http://www.springframework.org/docs/api/org/springframework/web/servlet/mvc/Controller.html" target="_blank"&gt;Controller&lt;/a&gt;&lt;/code&gt; class that handles the request. Since it implements the &lt;code&gt;&lt;a href="http://www.springframework.org/docs/api/org/springframework/web/context/ServletContextAware.html" target="_blank"&gt;ServletContextAware&lt;/a&gt;&lt;/code&gt; interface, Spring automatically passes the &lt;code&gt;&lt;a href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html" target="_blank"&gt;ServletContext&lt;/a&gt;&lt;/code&gt; object to it. This is used to obtain the &lt;code&gt;&lt;a href="http://www.springframework.org/docs/api/org/springframework/context/ApplicationContext.html" target="_blank"&gt;ApplicationContext&lt;/a&gt;&lt;/code&gt; object. Next we create an instance of our &lt;code&gt;LongProcessInvoker&lt;/code&gt; class, pass &lt;code&gt;ApplicationContext&lt;/code&gt; to it and finally start execution using an &lt;code&gt;&lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/Executor.html" target="_blank"&gt;Executor&lt;/a&gt;&lt;/code&gt;.&lt;/p&gt;&lt;div class="codeBlock"&gt;&lt;pre&gt;&lt;span style=' color: Green;'&gt;// TestController.java&lt;/span&gt;
&lt;span style=' color: Blue;'&gt;public&lt;/span&gt; ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) {
    &lt;span style=' color: Blue;'&gt;try&lt;/span&gt; {
        ApplicationContext ac = 
            WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
            
        LongProcessInvoker lpi = &lt;span style=' color: Blue;'&gt;new&lt;/span&gt; LongProcessInvoker();
        lpi.setApplicationContext(ac);
            
        Executor ex = Executors.newSingleThreadExecutor();
        ex.execute(lpi);
    }
    &lt;span style=' color: Blue;'&gt;catch&lt;/span&gt;(...) {
        ...
    }
}&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In &lt;code&gt;LongProcessInvoker&lt;/code&gt; we obtain the &lt;code&gt;Session&lt;/code&gt; using &lt;code&gt;&lt;a href="http://www.springframework.org/docs/api/org/springframework/orm/hibernate/SessionFactoryUtils.html" target="_blank"&gt;SessionFactoryUtils&lt;/a&gt;&lt;/code&gt; and bind it to the current thread. Next the long running process is invoked and once complete we execute some clean-up code by releasing and closing the &lt;code&gt;Session&lt;/code&gt;.&lt;/p&gt;&lt;div class="codeBlock"&gt;&lt;pre&gt;&lt;span style=' color: Green;'&gt;// LongProcessInvoker.java&lt;/span&gt;
&lt;span style=' color: Blue;'&gt;public&lt;/span&gt; &lt;span style=' color: Blue;'&gt;void&lt;/span&gt; run() {
    &lt;span style=' color: Blue;'&gt;try&lt;/span&gt; {
        &lt;span style=' color: Green;'&gt;// Bind session object. &lt;/span&gt;
        SessionFactory sessionFactory = 
            (SessionFactory) applicationContext.getBean(&lt;span style=' color: Maroon;'&gt;"sessionFactory"&lt;/span&gt;);
        Session session = SessionFactoryUtils.getSession(sessionFactory, &lt;span style=' color: Maroon;'&gt;true&lt;/span&gt;);
        TransactionSynchronizationManager.bindResource(sessionFactory, &lt;span style=' color: Blue;'&gt;new&lt;/span&gt; SessionHolder(session));        
        
        LongProcess lp = (LongProcess) applicationContext.getBean(&lt;span style=' color: Maroon;'&gt;"longProcess"&lt;/span&gt;);
        lp.runLongProcess();
        
        &lt;span style=' color: Green;'&gt;// Release session object.&lt;/span&gt;
        session.flush();
        TransactionSynchronizationManager.unbindResource(sessionFactory);
        SessionFactoryUtils.closeSession(session);
    }
    &lt;span style=' color: Blue;'&gt;catch&lt;/span&gt;(...) {
        ...
    }
}
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Using the above approach, we can now run long-running processes by obtaining the Hibernate session outside the view.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-6715184483463407394?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/6715184483463407394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=6715184483463407394' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/6715184483463407394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/6715184483463407394'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2007/04/long-running-processes-with-spring-dao.html' title='Long-running Processes with Spring DAO and Hibernate'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-9015991912903361297</id><published>2007-04-12T21:31:00.000+01:00</published><updated>2007-06-04T14:30:15.646+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaEE'/><category scheme='http://www.blogger.com/atom/ns#' term='Log4j'/><category scheme='http://www.blogger.com/atom/ns#' term='Tomcat'/><title type='text'>Loading Log4j Properties in Webapps on Tomcat</title><content type='html'>&lt;p&gt;&lt;a href="http://logging.apache.org/log4j/docs" target="_blank"&gt;Log4j&lt;/a&gt; is a well established and widely used logging framework for the Java platform. At the core of Log4j lies a configuration file that allows to finely configure the logging requirements for an application. Currently, the configuration file is either a XML or Java properties file. The documentation states that this configuration file should be present in the classpath of the application. This works fine for most situations however causes problems within webapps on Tomcat.&lt;/p&gt;&lt;p&gt;The Log4j FAQ &lt;a href="http://logging.apache.org/log4j/docs/faq.html#3.5" target="_blank"&gt;describes&lt;/a&gt; this due the way in which JavaEE and Servlet containers utilize Java's class loading system.&lt;/p&gt;&lt;p&gt;The problem can be overcome by using Log4j's &lt;code&gt;&lt;a href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/PropertyConfigurator.html" target="_blank"&gt;PropertyConfigurator&lt;/a&gt;&lt;/code&gt;. &lt;code&gt;PropertyConfigurator&lt;/code&gt; enables to statically load the configuration from an external file. Using the &lt;code&gt;&lt;a href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/PropertyConfigurator.html#configure(java.lang.String)" target="_blank"&gt;configure(String configFilename)&lt;/a&gt;&lt;/code&gt; method we can manually specify the path to the properties file within the webapp. We can tie this code into a &lt;code&gt;&lt;a href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContextListener.html" target="_blank"&gt;ServletContextListener&lt;/a&gt;&lt;/code&gt;'s &lt;code&gt;&lt;a href="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContextListener.html#contextInitialized(javax.servlet.ServletContextEvent)" target="_blank"&gt;contextInitialized(ServletContextEvent sce)&lt;/a&gt;&lt;/code&gt; event to force the properties file to be loaded at webapp startup.
&lt;br/&gt;Our &lt;code&gt;ServletContextListener&lt;/code&gt; implementation is listed below:&lt;/p&gt;&lt;div class="codeBlock"&gt;&lt;pre&gt;&lt;span style=' color: Blue;'&gt;import&lt;/span&gt; javax.servlet.ServletContextEvent;
&lt;span style=' color: Blue;'&gt;import&lt;/span&gt; javax.servlet.ServletContextListener;
&lt;span style=' color: Blue;'&gt;import&lt;/span&gt; org.apache.log4j.PropertyConfigurator;

&lt;span style=' color: Blue;'&gt;public&lt;/span&gt; &lt;span style=' color: Blue;'&gt;class&lt;/span&gt; ServletContextListenerImpl &lt;span style=' color: Blue;'&gt;implements&lt;/span&gt; ServletContextListener {
    &lt;span style=' color: Blue;'&gt;public&lt;/span&gt; &lt;span style=' color: Blue;'&gt;void&lt;/span&gt; contextDestroyed(ServletContextEvent sce) {

    }

    &lt;span style=' color: Blue;'&gt;public&lt;/span&gt; &lt;span style=' color: Blue;'&gt;void&lt;/span&gt; contextInitialized(ServletContextEvent sce) {
        String path=&lt;span style=' color: Maroon;'&gt;"WEB-INF/classes/log4j.properties"&lt;/span&gt;;
        ServletContext context = sce.getServletContext();
        PropertyConfigurator.configure(context.getRealPath(path));
    }
}&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Our Log4j properties file should now be successfully loaded when the webapp is initialized.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-9015991912903361297?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/9015991912903361297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=9015991912903361297' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/9015991912903361297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/9015991912903361297'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2007/04/loading-log4j-properties-in-webapps-on.html' title='Loading Log4j Properties in Webapps on Tomcat'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-8969793660950055187</id><published>2007-03-30T10:29:00.001+01:00</published><updated>2008-03-20T17:29:28.719Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='Email'/><category scheme='http://www.blogger.com/atom/ns#' term='TrueCrypt'/><title type='text'>Secure Email Attachments with TrueCrypt</title><content type='html'>&lt;p&gt;Digital documents have finally come of age. We now increasingly receive our bank statements, insurance quotes and receipts as digital files such as Word or PDF. Also, there is often a need to attach these documents to an email. Securing these attachments in transit over the Internet is an immediate concern. There are a number of solutions available such as &lt;a href="http://www.hushmail.com/" target="_blank"&gt;Hushmail&lt;/a&gt;, a secure free email provider and &lt;a href="http://www.pgp.com/products/desktop_email/index.html" target="_blank"&gt;PGP Desktop Email&lt;/a&gt;, a commercial email encryption product. The solution that I discuss here is based on a free, open-source encryption software called &lt;a href="http://www.truecrypt.org/" target="_blank"&gt;Truecrypt&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Truecrypt makes using bullet-proof encryption really easy through the concept of  &lt;i&gt;virtual encrypted disks&lt;/i&gt;. Each disk is stored as a single encrypted file and can be mounted as a real disk. Once mounted, it can be used as a local drive on the system. Entire hard-drives or USB memory sticks can be encrypted as well. Volumes can be protected using a password or through &lt;i&gt;key files&lt;/i&gt;. Any file on the system can be used as a key file as an alternative or in addition to using a password. The key file or sequence of key files is required to encrypt and decrypt the disk.&lt;/p&gt;&lt;p&gt;The concept of key files makes using Truecrypt really valuable while sending sensitive attachments over email. In addition to using a password, if the sender and the receiver agree on a common file or a sequence of files that are uniquely present on both systems such as digital photographs or video clips, the encryption can be made highly secure. Hence the encrypted attachments are useless if intercepted during transit without the key files.&lt;/p&gt;&lt;p&gt;Truecrypt is extremely simple to use and hence there is just no excuse for not securing confidential files on storage or in transit.&lt;/p&gt;&lt;p&gt;&lt;img src='http://www.techvj.com/misc/blog_images/secure_attachments/secureattachment.jpg' /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-8969793660950055187?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/8969793660950055187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=8969793660950055187' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/8969793660950055187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/8969793660950055187'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2007/03/secure-email-attachments-with-truecrypt.html' title='Secure Email Attachments with TrueCrypt'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-6692908258759838235</id><published>2006-11-18T14:21:00.000Z</published><updated>2007-06-04T14:31:17.560+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='WindowsVista'/><title type='text'>Windows Vista - Features Under the Hood</title><content type='html'>&lt;a href="http://www.microsoft.com/windowsvista/" target="_blank"&gt;&lt;img src="http://www.techvj.com/misc/blog_images/common/vista_logo.jpg" class='image01' style="margin-top:15px;" /&gt;&lt;/a&gt;&lt;p&gt;&lt;a href="http://www.microsoft.com/windowsvista/" target="_blank"&gt;Windows Vista&lt;/a&gt; introduces some promising new features that aim to take desktop computing to the next level. Apart from all the &lt;span style="font-style:italic;"&gt;eye-candy&lt;/span&gt; that is provided by the new &lt;span style="font-style:italic;"&gt;Aero&lt;/span&gt; interface, gadgets and &lt;span style="font-style:italic;"&gt;flip&lt;/span&gt; effects, there are some pretty neat features on offer under the hood. Some of these add improvements to the performance, security and productivity of the system.&lt;p&gt; Below are some of the features that I am really looking forward to in Vista.&lt;/p&gt;&lt;p&gt;&lt;b&gt;ReadyBoost&lt;/b&gt;&lt;br/&gt;Memory is usually one of the bottlenecks that affects system performance. As applications and background processes like anti-virus scans and drive indexing run concurrently, processor cycles and memory space are increasingly consumed. The result can be a drastic degradation in system performance. It would be great if memory could be added on the fly, providing extra space to ease the burden. Vista's ReadyBoost does just that.&lt;/p&gt;&lt;p&gt;With ReadyBoost, a USB memory drive with at least 512 MB of space can be plugged into the system and used by Vista as memory. The drive can be plugged out at any time without affecting or corrupting the system. Even more, all data on the drive is encrypted and hence is of no use to a malicious attack. With 2GB+ memory drives available today, this seems like a very promising technology.&lt;/p&gt;&lt;p&gt;&lt;b&gt;BitLocker&lt;/b&gt;&lt;br/&gt;Security of data is a primary concern these days to businesses and individuals alike. Regular reports of data theft, especially from notebook computers being stolen fuels our concerns. BitLocker is a technology that adds real-time data encryption to the Operating System volume. Hence lost or decommissioned computers are protected from data theft.&lt;/p&gt;&lt;p&gt;BitLocker which is available in the higher-end versions of Vista has some system prerequisites. A TPM (Trusted Platform Module), a cryptographic hardware chip needs to be present in the system. In the absence of a TPM, a USB stick that contains a startup key must be inserted at boot time.&lt;/p&gt;&lt;p&gt;&lt;b&gt;ReadyDrive&lt;/b&gt;&lt;br/&gt;Another new feature that exploits the latest developments in hardware is ReadyDrive. ReadyDrive makes use of hybrid hard drives, the latest hard drives that integrate non-volatile flash memory with traditional drives. This helps Windows to boot faster, resume from hibernation quicker and save on battery power. Finally the long wait for the &lt;span style="font-style:italic;"&gt;boot&lt;/span&gt; process will be rather short!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-6692908258759838235?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/6692908258759838235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=6692908258759838235' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/6692908258759838235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/6692908258759838235'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2006/11/windows-vista-features-under-hood.html' title='Windows Vista - Features Under the Hood'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-3574242955832443518</id><published>2006-11-07T13:19:00.000Z</published><updated>2007-06-04T14:55:29.512+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>100% CPU!</title><content type='html'>&lt;p&gt;I have been doing some &lt;span style="font-style: italic;"&gt;heavy-duty&lt;/span&gt; image processing on my computer at work this morning and it's pushing my machine to the max! Looking at the performance graph, I was amazed to see my CPU crunching away going steadily at 100%. Looks like it's time to convince my boss to get me one of those shiny new &lt;a href="http://www.intel.com/products/processor/core2XE/index.htm" target="_blank"&gt;quad-core&lt;/a&gt; chips from Intel...&lt;/p&gt;&lt;p align='center'&gt;&lt;img src='http://www.techvj.com/misc/blog_images/100_cpu/100cpu.jpg' class='image01' /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-3574242955832443518?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/3574242955832443518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=3574242955832443518' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/3574242955832443518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/3574242955832443518'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2006/11/100-cpu.html' title='100% CPU!'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-1798449720865389352</id><published>2006-09-26T16:01:00.000+01:00</published><updated>2007-06-04T14:59:14.050+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SyncToy'/><category scheme='http://www.blogger.com/atom/ns#' term='Backups'/><title type='text'>Backup for a Rainy Day!</title><content type='html'>&lt;p&gt;We all know that backups are important! However, most users realize the importance of backups only after lightning strikes. We need to protect our data from the usual suspects such as hard disk crashes, fire, floods, theft etc. I have been using a free tool from Microsoft called &lt;a href="http://www.microsoft.com/windowsxp/using/digitalphotography/prophoto/synctoy.mspx" target="_blank"&gt;SyncToy&lt;/a&gt; that makes running backups an ease. This post describes the backup procedure using SyncToy.&lt;/p&gt;&lt;p&gt;Note: Windows XP Professional comes with an out-of-the-box Backup utility. This utility produces a single backup file (.bkf) that could be later used to restore data and system settings. I prefer using SyncToy as it creates an exact replica of the directory and file structure. Thus the backed-up copy can also be used as a read-only reference when away from the source computer.&lt;/p&gt;&lt;p&gt;Steps to Getting Backups Up and Running
1. Centrally arrange data for easy backups.
2. Get an external USB hard drive.
3. Download and install Microsoft SyncToy.
4. Run SyncToy to backup your data.
5. Create a backup schedule.
6. Store the external hard drive safely.&lt;/p&gt;&lt;p&gt;1. Centrally arrange data for easy backups.&lt;br/&gt;The first thing to do is to arrange our data centrally, preferably in a single &lt;a href="http://en.wikipedia.org/wiki/Partition_%28computing%29" target="_blank"&gt;hard drive partition&lt;/a&gt; or folder to facilitate easy backups.&lt;/p&gt;&lt;p&gt;2. Get an external USB hard drive.&lt;br/&gt;There are a number of options available to store backed up data. These range from CD-Rs, DVD-Rs, USB sticks, external USB hard drives, SAN drives etc. I personally prefer USB hard drives as they are fairly inexpensive, easy to use, mobile and have significant storage capacities.&lt;/p&gt;&lt;p&gt;3. Download and install Microsoft &lt;a href="http://www.microsoft.com/windowsxp/using/digitalphotography/prophoto/synctoy.mspx" target="_blank"&gt;SyncToy&lt;/a&gt;.&lt;br/&gt;Once installed, setting up a backup job is pretty straightforward. Start by creating a 'New Folder Pair' &lt;a href="http://www.techvj.com/misc/blog_images/backup_rainyday/synctoy_01.jpg" target="_new" class="screenshot"&gt;(Screenshot)&lt;/a&gt;. After specifying the source and destination folders we need to specify the synchronization action. This needs to be 'Echo' in our case &lt;a href="http://www.techvj.com/misc/blog_images/backup_rainyday/synctoy_02.jpg" target="_new" class="screenshot"&gt;(Screenshot)&lt;/a&gt;. Using Echo, new and updated files are copied across and renames and deletes are repeated on the backup. One point to note is that Echo does not delete directories on the backup. Our backup job is now ready to run!&lt;/p&gt;&lt;p&gt;4. Run SyncToy to backup your data.&lt;br/&gt;Running the SyncToy backup is an easy process. Select the relevent folder pair from the list at the left side of the main window and then click 'Run' &lt;a href="http://www.techvj.com/misc/blog_images/backup_rainyday/synctoy_03.jpg" target="_new" class="screenshot"&gt;(Screenshot)&lt;/a&gt;. A progress bar apprears showing the advancement of the process.&lt;/p&gt;&lt;p&gt;5. Create a backup schedule.&lt;br/&gt;Backups are valuable only when they are run regularly! We can automate this process by creating a Scheduled Task in Windows. This can be accessed at Start -&amp;gt; All Programs -&amp;gt; Accessories -&amp;gt; System Tools -&amp;gt; Scheduled Tasks. The wizard is simple to follow &lt;a href="http://www.techvj.com/misc/blog_images/backup_rainyday/scheduledtask.jpg" target="_new" class="screenshot"&gt;(Screenshot)&lt;/a&gt;. To run our backup job, add -R "&amp;lt;folder-pair_name&amp;gt;" to the end of the Run command. To run all folder pairs just add -R.&lt;/p&gt;&lt;p&gt;6. Store the external hard drive safely.&lt;br/&gt;Once we have a backup schedule in place it makes sense to store the backup drive at a separate geographic location to the source. This proves essential in times of natural calamities such as fire, floods, theft etc.&lt;/p&gt;&lt;p&gt;Thanks to SyncToy we now have a backup procedure in place!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-1798449720865389352?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/1798449720865389352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=1798449720865389352' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/1798449720865389352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/1798449720865389352'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2006/09/backup-for-rainy-day_26.html' title='Backup for a Rainy Day!'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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-5369017427302932931.post-3061139966579595095</id><published>2006-09-13T14:06:00.001+01:00</published><updated>2008-12-08T23:17:36.462Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='JSON'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='SpringFramework'/><title type='text'>Spring MVC and AJAX with JSON</title><content type='html'>&lt;p&gt;One of the main decisions to be taken while developing AJAX applications is the format of messages passed by the server to the client browser. There are many options to choose from including plain text, XML, CSV etc. One of the more popular choices today is the &lt;a href="http://www.json.org/" target="_blank"&gt;JavaScript Object Notation (JSON)&lt;/a&gt;. JSON provides a nice name-value pair data format that is easy to generate and parse. This is especially true when using an AJAX toolkit like &lt;a href="http://www.dojotoolkit.org/" target="_blank"&gt;Dojo&lt;/a&gt; that provides built-in functionality to parse JSON messages at the client. If you are using Spring MVC as your web framework, generation of these JSON messages is very straight-forward as well. Below we understand how to produce JSON messages while using Spring MVC.&lt;/p&gt;&lt;p&gt;Spring MVC defines the &lt;a href="http://www.springframework.org/docs/api/org/springframework/web/servlet/View.html" target="_blank"&gt;&lt;code&gt;&lt;strong&gt;View&lt;/strong&gt;&lt;/code&gt;&lt;/a&gt; interface to render views to the client. The framework provides a number of implementations including &lt;a href="http://www.springframework.org/docs/api/org/springframework/web/servlet/view/JstlView.html" target="_blank"&gt;&lt;code&gt;JstlView&lt;/code&gt;&lt;/a&gt;, &lt;a href="http://www.springframework.org/docs/api/org/springframework/web/servlet/view/RedirectView.html" target="_blank"&gt;&lt;code&gt;RedirectView&lt;/code&gt;&lt;/a&gt;, &lt;a href="http://www.springframework.org/docs/api/org/springframework/web/servlet/view/tiles/TilesView.html" target="_blank"&gt;&lt;code&gt;TilesView&lt;/code&gt;&lt;/a&gt; etc. In order to return JSON messages we implement the &lt;code&gt;View&lt;/code&gt; interface to create a new class that returns data formatted using the JSON notation. We shall call this class &lt;code&gt;&lt;strong&gt;JSONView&lt;/strong&gt;&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;The method that we need to implement is &lt;code&gt;&lt;a href="http://www.springframework.org/docs/api/org/springframework/web/servlet/View.html#render%28java.util.Map,%20javax.servlet.http.HttpServletRequest,%20javax.servlet.http.HttpServletResponse%29" target="_blank"&gt;&lt;strong&gt;render&lt;/strong&gt;&lt;/a&gt;(&lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Map.html" target="_blank"&gt;Map&lt;/a&gt; model, &lt;a href="http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequest.html" target="_blank"&gt;HttpServletRequest&lt;/a&gt; request, &lt;a href="http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletResponse.html" target="_blank"&gt;HttpServletResponse&lt;/a&gt; response).&lt;/code&gt; The render method accepts a &lt;code&gt;Map&lt;/code&gt; as it's first parameter and produces the output. We could manually iterate through the &lt;code&gt;Map&lt;/code&gt;, process and produce the JSON output. However, there is a Java library called &lt;a href="http://json-lib.sourceforge.net/" target="_blank"&gt;JSON-lib&lt;/a&gt; that produces the JSON notation. The code below shows our &lt;code&gt;JSONView&lt;/code&gt; class that can be used as a Spring MVC &lt;code&gt;View &lt;/code&gt;to return JSON output to the client.&lt;/p&gt;&lt;div class="codeBlock"&gt;&lt;pre&gt;&lt;span style=' color: Blue;'&gt;import&lt;/span&gt; java.io.PrintWriter;
&lt;span style=' color: Blue;'&gt;import&lt;/span&gt; java.util.Map;
&lt;span style=' color: Blue;'&gt;import&lt;/span&gt; javax.servlet.http.HttpServletRequest;
&lt;span style=' color: Blue;'&gt;import&lt;/span&gt; javax.servlet.http.HttpServletResponse;
&lt;span style=' color: Blue;'&gt;import&lt;/span&gt; net.sf.json.JSONObject;
&lt;span style=' color: Blue;'&gt;import&lt;/span&gt; org.springframework.web.servlet.View;
 
&lt;span style=' color: Blue;'&gt;public&lt;/span&gt; &lt;span style=' color: Blue;'&gt;class&lt;/span&gt; JSONView &lt;span style=' color: Blue;'&gt;implements&lt;/span&gt; View {
    &lt;span style=' color: Blue;'&gt;public&lt;/span&gt; &lt;span style=' color: Blue;'&gt;void&lt;/span&gt; render(Map map, HttpServletRequest request,
    HttpServletResponse response) &lt;span style=' color: Blue;'&gt;throws&lt;/span&gt; Exception {
        JSONObject jsonObject = JSONObject.fromMap(map);
        PrintWriter writer = response.getWriter();
        writer.write(jsonObject.toString());
    }
 
    ...
}&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As can be seen from the code above, Spring exploits MVC to it's full potential and  provides the flexibility to tailor the view to exactly suit our needs.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-3061139966579595095?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/3061139966579595095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=3061139966579595095' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/3061139966579595095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/3061139966579595095'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2006/09/one-of-main-decisions-to-be-taken-while.html' title='Spring MVC and AJAX with JSON'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5369017427302932931.post-3465597174455474446</id><published>2006-09-09T10:37:00.000+01:00</published><updated>2007-06-04T15:01:08.173+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Hello World!</title><content type='html'>&lt;p&gt;Hello World! Well, I finally had to bite the bullet and start my very own blog. Starting off with modest ambitions, I primarily hope to blog about my experiences with software, programming, technology and also general topics that I find interesting…&lt;/p&gt;&lt;p&gt;I am a software developer by profession, primarily focusing on Java Enterprise and Open Source technologies. You can access my personal website at &lt;a href="http://www.techvj.com/" title="techVJ.com" target="_blank"&gt;www.techvj.com&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Now, with the short introduction out of the way, get ready for the &lt;b&gt;Blog Attack&lt;/b&gt;…&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5369017427302932931-3465597174455474446?l=techvj.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techvj.blogspot.com/feeds/3465597174455474446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5369017427302932931&amp;postID=3465597174455474446' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/3465597174455474446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5369017427302932931/posts/default/3465597174455474446'/><link rel='alternate' type='text/html' href='http://techvj.blogspot.com/2006/09/hello-world.html' title='Hello World!'/><author><name>Vijay Albuquerque</name><uri>http://www.blogger.com/profile/05244840746628593078</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>
