<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DEUNQX87eip7ImA9WhRRFE4.&quot;"><id>tag:blogger.com,1999:blog-6966622285809403106</id><updated>2011-11-28T04:54:50.102+05:30</updated><category term="Tomcat 5" /><category term="Tomcat" /><category term="Mylyn" /><category term="JGlobusFX" /><category term="Java" /><category term="GSI" /><category term="Task Management" /><category term="Thread Pool" /><title>Rajiv Mayani</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://rajiv-mayani.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://rajiv-mayani.blogspot.com/" /><author><name>Rajiv Mayani</name><uri>http://www.blogger.com/profile/14509930012090744221</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>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/RajivMayani" /><feedburner:info uri="rajivmayani" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;C0YMQHc7eSp7ImA9WxJUFUw.&quot;"><id>tag:blogger.com,1999:blog-6966622285809403106.post-6409396646346607124</id><published>2009-06-30T02:15:00.012+05:30</published><updated>2009-07-14T00:23:01.901+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-14T00:23:01.901+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="GSI" /><category scheme="http://www.blogger.com/atom/ns#" term="JGlobusFX" /><category scheme="http://www.blogger.com/atom/ns#" term="Tomcat 5" /><category scheme="http://www.blogger.com/atom/ns#" term="Tomcat" /><title /><content type="html">&lt;span style="font-weight: bold;"&gt;GSI Security Configuration in Tomcat 5.5&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Download&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;To enable GSI security in Tomcat you will require download the J-Globus FX jars.
&lt;br /&gt;
&lt;br /&gt;&lt;a href="http://dev.globus.org/wiki/CoG_JGlobus_1.6.0"&gt;http://dev.globus.org/wiki/CoG_JGlobus_1.6.0&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;You will require following additional jars from
&lt;br /&gt;&lt;a href="http://www.bouncycastle.org/latest_releases.html"&gt;http://www.bouncycastle.org/latest_releases.html&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;1.bcprov-jdk16-143.jar
&lt;br /&gt;2.bcprov-ext-jdk14-143.jar
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Note:&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;The binary distribution does not consist of a required class file. For this purpose you need to make the jars from source code.
&lt;br /&gt;
&lt;br /&gt;Alternatively, you can download WS-Core binary distribution to obtain the required jar.
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Configuring Tomcat Server with GSI Security&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;Make the following changes in $TOMCAT_HOME/conf/server.xml
&lt;br /&gt;
&lt;br /&gt;(a) Add an HTTPS connector in the service tag.
&lt;br /&gt;&lt;!-- Define a GSI HTTPS/1.1 Connector on port 8443              Supported parameters include:             proxy         // proxy file for server to use               or              cert          // server certificate file in PEM format              key           // server key file in PEM format              cacertdir     // directory location containing trusted CA certs             encryption (true/false)   // enable/disable encryption     --&gt;&lt;meta equiv="CONTENT-TYPE" content="text/html; charset=utf-8"&gt;&lt;title&gt;&lt;/title&gt;&lt;meta name="GENERATOR" content="OpenOffice.org 3.0  (Win32)"&gt;&lt;style type="text/css"&gt; 	&lt;!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } 	--&gt; 	&lt;/style&gt; &lt;p style="margin-bottom: 0in;"&gt;&amp;lt;!-- Define a GSI HTTPS/1.1 Connector on port 8443  &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;            Supported parameters include:&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;            proxy         // proxy file for server to use&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;              or  &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;            cert          // server certificate file in PEM format  &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;            key           // server key file in PEM format&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;            cacertdir     // directory location containing trusted CA certs&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;            encryption (true/false)   // enable/disable encryption&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;    --&amp;gt;&lt;/p&gt;
&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;!-- Define a GSI HTTPS/1.1 Connector on port 8443  &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;            Supported parameters include:&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;            proxy         // proxy file for server to use&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;              or  &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;            cert          // server certificate file in PEM format  &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;            key           // server key file in PEM format&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;            cacertdir     // directory location containing trusted CA certs&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;            encryption (true/false)   // enable/disable encryption&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;    --&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;   &lt;connector&gt;&lt;/connector&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;connector classname="org.globus.tomcat.coyote.net.HTTPSConnector"&gt; &lt;/connector&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;        &amp;lt;Connector port="9005"&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;        maxThreads="150" minSpareThreads="25" maxSpareThreads="75"&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;        enableLookups="false" disableUploadTimeout="true"&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;        acceptCount="100" debug="0" scheme="https"  &lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;        autoFlush="true"&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;        protocolHandlerClassName="org.apache.coyote.http11.Http11Protocol"&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;        socketFactory="org.globus.tomcat.catalina.net.BaseHTTPSServerSocketFactory"&lt;/p&gt;  &lt;p style="margin-bottom: 0in;"&gt;        proxy="Path to your proxy file"
&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;        cert="path to containers cert file"
&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;        key="path to containers key file"
&lt;br /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;        cacertdir="path to certificates folder" /&gt;&lt;/p&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;
&lt;br /&gt;&lt;/p&gt; &lt;connector classname="org.globus.tomcat.coyote.net.HTTPSConnector" port="9005" maxthreads="150" minsparethreads="25" maxsparethreads="75" enablelookups="false" disableuploadtimeout="true" acceptcount="100" debug="0" scheme="https" autoflush="true" protocolhandlerclassname="org.apache.coyote.http11.Http11Protocol" socketfactory="org.globus.tomcat.catalina.net.BaseHTTPSServerSocketFactory" proxy="d:\\certs\x509up_u945" cert="d:\\certs\\usercert.pem" key="d:\\certs\\userkey.pem" cacertdir="d:\\certs\\certs"&gt;(b) Add a valve in the engine tag.
&lt;br /&gt;&lt;valve classname="org.globus.tomcat.coyote.valves.HTTPSValve55"&gt;&lt;/valve&gt;&lt;/connector&gt;&lt;meta equiv="CONTENT-TYPE" content="text/html; charset=utf-8"&gt;&lt;title&gt;&lt;/title&gt;&lt;meta name="GENERATOR" content="OpenOffice.org 3.0  (Win32)"&gt;&lt;style type="text/css"&gt; 	&lt;!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } 	--&gt; 	&lt;/style&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;valve classname="org.globus.tomcat.coyote.valves.HTTPSValve55"&gt;&lt;/valve&gt;&lt;/p&gt;&lt;meta equiv="CONTENT-TYPE" content="text/html; charset=utf-8"&gt;&lt;title&gt;&lt;/title&gt;&lt;meta name="GENERATOR" content="OpenOffice.org 3.0  (Win32)"&gt;&lt;style type="text/css"&gt; 	&lt;!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } 	--&gt; 	&lt;/style&gt; &lt;p style="margin-bottom: 0in;"&gt;&lt;valve classname="org.globus.tomcat.coyote.valves.HTTPSValve55"&gt;&lt;/valve&gt;&lt;/p&gt;&lt;meta equiv="CONTENT-TYPE" content="text/html; charset=utf-8"&gt;&lt;title&gt;&lt;/title&gt;&lt;meta name="GENERATOR" content="OpenOffice.org 3.0  (Win32)"&gt;&lt;style type="text/css"&gt; 	&lt;!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } 	--&gt; 	&lt;/style&gt; &lt;p style="margin-bottom: 0in;"&gt;&amp;lt; className="org.globus.tomcat.coyote.valves.HTTPSValve55"/&gt;&lt;/p&gt;
&lt;br /&gt;&lt;connector classname="org.globus.tomcat.coyote.net.HTTPSConnector" port="9005" maxthreads="150" minsparethreads="25" maxsparethreads="75" enablelookups="false" disableuploadtimeout="true" acceptcount="100" debug="0" scheme="https" autoflush="true" protocolhandlerclassname="org.apache.coyote.http11.Http11Protocol" socketfactory="org.globus.tomcat.catalina.net.BaseHTTPSServerSocketFactory" proxy="d:\\certs\x509up_u945" cert="d:\\certs\\usercert.pem" key="d:\\certs\\userkey.pem" cacertdir="d:\\certs\\certs"&gt;&lt;valve classname="org.globus.tomcat.coyote.valves.HTTPSValve55"&gt;(c) Tomcat Bug
&lt;br /&gt;
&lt;br /&gt;When using ChunkedInputStream tomcat stores a 0 in its buffer every time a connection is closed. However, when obtaining a new request it does no ignore preceding 0’s resulting in a 0&lt;http method=""&gt; 501 Not implemented error.
&lt;br /&gt;
&lt;br /&gt;This requires a minor change in tomcat’s source code.
&lt;br /&gt;
&lt;br /&gt;In the class org.apache.coyote.http11.InternalInputBuffer’s parseRequestLine method
&lt;br /&gt;
&lt;br /&gt;Replace the existing if block with the following while block.
&lt;br /&gt;
&lt;br /&gt;do
&lt;br /&gt;	{
&lt;br /&gt;	// Read new bytes if needed.
&lt;br /&gt;	if (pos &gt;= lastValid)
&lt;br /&gt;	{
&lt;br /&gt;		if (!fill ())
&lt;br /&gt;			throw new EOFException (sm.getString ("iib.eof.error"));
&lt;br /&gt;	}
&lt;br /&gt;	chr = buf [pos++];
&lt;br /&gt;	}
&lt;br /&gt;	while ((chr == Constants.CR) || (chr == Constants.LF) || chr == '0');
&lt;br /&gt;
&lt;br /&gt;Replace the class file in $TOMCAT_HOME/server/lib/tomcat-http.jar
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;OR&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;Download the altered jar from
&lt;br /&gt;
&lt;br /&gt;&lt;a href="https://pegasus.isi.edu/svn/mcs/trunk/lib/tomcat-http.jar"&gt;https://pegasus.isi.edu/svn/mcs/trunk/lib/tomcat-http.jar&lt;/a&gt; and replace it with $TOMCAT_HOME/server/lib/tomcat-http.jar
&lt;br /&gt;
&lt;br /&gt;Refer To - &lt;a href="http://mail-archives.apache.org/mod_mbox/tomcat-users/200904.mbox/%3C47CD64D7E22C3949A40CA4751EB20E811174077A70@boumail.infotrustgroup.com%3E"&gt;http://mail-archives.apache.org/mod_mbox/tomcat-users/200904.mbox/%3C47CD64D7E22C3949A40CA4751EB20E811174077A70@boumail.infotrustgroup.com%3E&lt;/a&gt;
&lt;br /&gt;Some additional steps may be required if Globus is not installed on your machine.
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Copying required JAR files&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;(a) Copy the following jars from the JGlobus FX distribution to $TOMCAT_HOME/common/lib
&lt;br /&gt;
&lt;br /&gt;1.cog-jglobus.jar.
&lt;br /&gt;2.log4j-xxx.jar.jar.
&lt;br /&gt;3.puretls.jar.
&lt;br /&gt;4.cryptix32.jar.
&lt;br /&gt;5. cryptix-asn1.jar
&lt;br /&gt;
&lt;br /&gt;(b) Copy the following jars from the JGlobus FX distribution If compile from source) OR from WS-Core Distribution to $TOMCAT_HOME/server/lib
&lt;br /&gt;
&lt;br /&gt;1.cog-tomcat.jar
&lt;br /&gt;
&lt;br /&gt;(c) Copy the following jar to $TOMCAT_HOME/common/lib
&lt;br /&gt;
&lt;br /&gt;1. bcprov-jdk16-143.jar
&lt;br /&gt;2. bcprov-ext-jdk14-143.jar
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Web Service (Axis 2) - Using GSI Security.&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Server Side Implementation&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;Authentication is completely handled by the GSI security jars deployed on the tomcat server.
&lt;br /&gt;
&lt;br /&gt;Obtaining the Authorized User DN can be accomplished with the following code snippet.
&lt;br /&gt;
&lt;br /&gt;private String getAuthorizedUserDn ()
&lt;br /&gt;	{
&lt;br /&gt;		MessageContext messageContext = MessageContext.getCurrentMessageContext ();
&lt;br /&gt;		HttpServletRequest httpRequest = (HttpServletRequest) messageContext.getProperty (HTTPConstants.MC_HTTP_SERVLETREQUEST);
&lt;br /&gt;		return (String) httpRequest.getAttribute ("org.globus.gsi.authorized.user.dn");
&lt;br /&gt;	}	
&lt;br /&gt;
&lt;br /&gt;The code snippet simply acquires the current HTTPServletRequest object from the message context of Axis2. Once the HTTPServletRequest object is obtained the authorized user DN can be obtained from the object using the getAttribute method of the object. The key o be passed to the getAttribute method is "org.globus.gsi.authorized.user.dn".
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Client Side Implementation&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;The client side implementation is a bit tricky.
&lt;br /&gt;
&lt;br /&gt;The JGlobus FX distribution provides an extended socket which handles GSI security. However, to be able to use this we need control over the socket that Tomcat server uses to send and receive SOAP messages.
&lt;br /&gt;
&lt;br /&gt;Tomcat uses commons-http library for sending and receiving of HTTP messages. This library provides a mechanism with which we can provide it a custom socket. Since we need socket specific to a protocol the library requires us to register the custom socket factory class with the associated protocol.
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Refer:&lt;/span&gt; &lt;a href="http://hc.apache.org/httpclient-3.x/sslguide.html"&gt;http://hc.apache.org/httpclient-3.x/sslguide.html&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Write the custom class to create a socket.&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;a href="https://pegasus.isi.edu/svn/mcs/trunk/src/edu/isi/pegasus/httpclient/socket/MCSGSISocketFactory.java"&gt;https://pegasus.isi.edu/svn/mcs/trunk/src/edu/isi/pegasus/httpclient/socket/MCSGSISocketFactory.java&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Register the custom socket factory class with a protocol.&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;import org.apache.commons.httpclient.protocol.Protocol;
&lt;br /&gt;import edu.isi.pegasus.httpclient.socket.MCSGSISocketFactory;
&lt;br /&gt;
&lt;br /&gt;Protocol protocol = new Protocol ("https", new MCSGSISocketFactory (), 8444);
&lt;br /&gt;Protocol.registerProtocol ("https", protocol);
&lt;br /&gt;
&lt;br /&gt;Now, whenever tomcat requires a new socket to communicate using the https protocol it will call tomcats create socket method to obtain one.
&lt;br /&gt;
&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;References&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;a href="http://dev.globus.org/wiki/CoG_JGlobus_1.6.0"&gt;http://dev.globus.org/wiki/CoG_JGlobus_1.6.0&lt;/a&gt;
&lt;br /&gt;&lt;a href="http://www.bouncycastle.org/latest_releases.html"&gt;
&lt;br /&gt;http://www.bouncycastle.org/latest_releases.html&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;a href="http://hc.apache.org/httpclient-3.x/sslguide.html"&gt;http://hc.apache.org/httpclient-3.x/sslguide.html&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;a href="https://pegasus.isi.edu/svn/mcs/trunk/src/edu/isi/pegasus/httpclient/socket/MCSGSISocketFactory.java"&gt;https://pegasus.isi.edu/svn/mcs/trunk/src/edu/isi/pegasus/httpclient/socket/MCSGSISocketFactory.java&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;a href="https://pegasus.isi.edu/svn/mcs/trunk/src/edu/isi/pegasus/mcs/service/restful/MCSServiceImpl.java"&gt;https://pegasus.isi.edu/svn/mcs/trunk/src/edu/isi/pegasus/mcs/service/restful/MCSServiceImpl.java&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;a href="http://mail-archives.apache.org/mod_mbox/tomcat-users/200904.mbox/%3C47CD64D7E22C3949A40CA4751EB20E811174077A70@boumail.infotrustgroup.com%3E"&gt;http://mail-archives.apache.org/mod_mbox/tomcat-users/200904.mbox/%3C47CD64D7E22C3949A40CA4751EB20E811174077A70@boumail.infotrustgroup.com%3E
&lt;br /&gt;&lt;/a&gt;
&lt;br /&gt;&lt;/http&gt;&lt;/valve&gt;&lt;/connector&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6966622285809403106-6409396646346607124?l=rajiv-mayani.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PoYGttXPs4j8diM2fjo-fNFdcIo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PoYGttXPs4j8diM2fjo-fNFdcIo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PoYGttXPs4j8diM2fjo-fNFdcIo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PoYGttXPs4j8diM2fjo-fNFdcIo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RajivMayani/~4/sTNuUphgMq4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://rajiv-mayani.blogspot.com/feeds/6409396646346607124/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6966622285809403106&amp;postID=6409396646346607124" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6966622285809403106/posts/default/6409396646346607124?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6966622285809403106/posts/default/6409396646346607124?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RajivMayani/~3/sTNuUphgMq4/gsi-security-configuration-in-tomcat-5.html" title="" /><author><name>Rajiv Mayani</name><uri>http://www.blogger.com/profile/14509930012090744221</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><feedburner:origLink>http://rajiv-mayani.blogspot.com/2009/06/gsi-security-configuration-in-tomcat-5.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkINR3oyeSp7ImA9WxVWF08.&quot;"><id>tag:blogger.com,1999:blog-6966622285809403106.post-8030964218044568161</id><published>2009-02-27T11:43:00.012+05:30</published><updated>2009-02-27T13:13:16.491+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-27T13:13:16.491+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><category scheme="http://www.blogger.com/atom/ns#" term="Thread Pool" /><title>Thread Pools</title><content type="html">&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CRAJIVM%7E1%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml"&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" latentstylecount="156"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt; &lt;!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0pt; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} @page Section1 	{size:612.0pt 792.0pt; 	margin:72.0pt 90.0pt 72.0pt 90.0pt; 	mso-header-margin:36.0pt; 	mso-footer-margin:36.0pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0pt 5.4pt 0pt 5.4pt; 	mso-para-margin:0pt; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]--&gt;    &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;b style=""&gt;&lt;span style="font-size:14;"&gt;Introduction&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;br /&gt;There are a variety of applications that provide services to clients. If the servers providing these services are to service one request at a time then the wait time to be serviced would be significantly high. One way to solve this problem is to use threads that could execute in parallel virtually. This leads to the ability to serve multiple requests simultaneously.&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;
&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size:14;"&gt;What are thread pools?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;
&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Thread pools are a collection of a certain number of threads that are created and destroyed dynamically as per the load on the server. The thread pool boasts of a minimum number of threads that are active at all times. When the load on the server increases beyond a certain point new threads are instantiated and added to the pool. Any incoming requests are served by threads in the pool that are idle.
&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;
&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size:14;"&gt;Why use thread pools?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt;            &lt;/span&gt;
&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;In most scenarios the service duration of a request is significantly small. Just imagine a HTTP server being requested to obtain a file. In this scenario all the server needs to do is place the file on the communication channel. Thread instantiation is an expensive operation, and if for each of these requests a thread is created and later on destroyed on completion of the service a significant cost is incurred in serving the request. To avoid this overhead a pool of threads is maintained.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size:14;"&gt;
&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size:14;"&gt;Thread pool advantages&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;
&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;It minimizes the overhead incurred by the server to instantiate new threads and terminating threads when they have serviced a request.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;
&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Thread pool maintain up to a maximum of n number of threads, this prevent a server from creating too many threads when the load on the server is very high.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size:14;"&gt;
&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size:14;"&gt;Thread pool disadvantages&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;
&lt;br /&gt;&lt;b style=""&gt;&lt;span style="font-size:14;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Deadlocks can occur when multiple threads are using objects that cannot be shared. In such cases a thread may acquire a lock on an object A, and issue a request for another object B, while another thread may have the lock to an object B while waiting to acquire a lock on object A. This results in both threads being unable to progress with their tasks.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;
&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;It is difficult to tune the thread properly to obtain the best performance.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;
&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Threads themselves require resources such as memory. If the thread pool size is too large the thread pool puts a load on the machine’s resources.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;
&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Active threads may work on shared resources, if these resources are accessed in an improper manner they can lead to the resources being inconsistent.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;
&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;If the threads themselves are not written in a proper fashion there are chances that a thread may never finish executing, such a a piece of code running in an infinite loop.&lt;/p&gt;&lt;p class="MsoNormal"&gt;
&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size:14;"&gt;Source Code&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;
&lt;br /&gt;&lt;b style=""&gt;&lt;span style="font-size:14;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;A rudimentary implementation of such a thread pool is hosted at &lt;span style="text-decoration: underline;"&gt;&lt;a href="http://rajiv-mayani.vndv.com/Articles/ThreadPool/index.html"&gt;Thread Pool Source Code&lt;/a&gt;&lt;/span&gt;.&lt;/p&gt;&lt;p class="MsoNormal"&gt;
&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;To be able to use thread pool all you need to do is follow these steps.&lt;/p&gt;&lt;p class="MsoNormal"&gt;
&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;1. Create a class that implements the Poolable interface.&lt;/p&gt;&lt;p class="MsoNormal"&gt;public class Request implements Poolable&lt;/p&gt;&lt;p class="MsoNormal"&gt;{
&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;       @Override
&lt;br /&gt;             public void process ()
&lt;br /&gt;             {&lt;/p&gt;&lt;p class="MsoNormal"&gt;                                    System.out.println ("Executing in thread.");
&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;                  }&lt;/p&gt;&lt;p class="MsoNormal"&gt;}&lt;/p&gt;&lt;p class="MsoNormal"&gt;
&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;2. Instantiate the thread pool in the class where you want to use it.&lt;/p&gt;&lt;p class="MsoNormal"&gt;ThreadPool &lt;request&gt; threadPool = new ThreadPool &lt;request&gt; ();&lt;/request&gt;&lt;/request&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;
&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;3. Add a request to be serviced to the queue.&lt;/p&gt;&lt;p class="MsoNormal"&gt;threadPool.submitJob (objRequest);&lt;/p&gt;&lt;p class="MsoNormal"&gt;
&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;4. Terminate the thread pool when exiting the server process.&lt;/p&gt;&lt;p class="MsoNormal"&gt;threadPool.stopThreadPool (true);
&lt;br /&gt;&lt;/p&gt;&lt;span style="text-decoration: underline;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6966622285809403106-8030964218044568161?l=rajiv-mayani.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3eCIqEwV-9UJc7sSTlH-YdRsfoA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3eCIqEwV-9UJc7sSTlH-YdRsfoA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3eCIqEwV-9UJc7sSTlH-YdRsfoA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3eCIqEwV-9UJc7sSTlH-YdRsfoA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RajivMayani/~4/J7DGY8Dtz1w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://rajiv-mayani.blogspot.com/feeds/8030964218044568161/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6966622285809403106&amp;postID=8030964218044568161" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6966622285809403106/posts/default/8030964218044568161?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6966622285809403106/posts/default/8030964218044568161?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RajivMayani/~3/J7DGY8Dtz1w/thread-pools.html" title="Thread Pools" /><author><name>Rajiv Mayani</name><uri>http://www.blogger.com/profile/14509930012090744221</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><feedburner:origLink>http://rajiv-mayani.blogspot.com/2009/02/thread-pools.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMBQXoyfCp7ImA9WxRbF0Q.&quot;"><id>tag:blogger.com,1999:blog-6966622285809403106.post-8674042696454581322</id><published>2008-06-22T14:59:00.023+05:30</published><updated>2008-12-09T08:10:50.494+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-09T08:10:50.494+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Task Management" /><category scheme="http://www.blogger.com/atom/ns#" term="Mylyn" /><title>Mylyn Unplugged - Part I</title><content type="html">&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Anyone involved in development of a software product are aware of the large number of projects present in their workspaces showing hundreds of errors and thousands of warnings. The thing to take notice of is that the developer requires only two or three of the projects at any given time depending on the build structure of the larger whole. With lightening fast searches most programmers are willing to accept the hassles of having n projects in a memory sucking IDE, but completely unaware of existence of the Mylyn thought process.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Mylyn or Mylar as it was formerly known is a task management system. To a programmer a task is probably an entry in a timesheet application, or a defect assigned to them in Issue tracker tool like Bugzilla, Trac or Jira. Mylyn provides an integrated form of task management allowing a programmer to keep track of time spent on tasks or update status of issues in an issue tracker system directly from the development environment. So far the ideation doesn’t seem appealing or relevant to anything mentioned yet, but what is to follow will make life much simpler for a programmer. There are three features that are the essence of Mylyn; Task Management, Task Context, and Task tracking.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Mylyn allows any one involved with a project to define task from an IDE or what is more commonly known as a Defect, Enhancement, etc. into an issue tracking system. All stag programmers need not loose interest as Mylyn still holds promise. Mylyn allows for tasks to be created locally without having to be associated with an issue tracking system.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Task Context is an innovative way to fashion your workspace. Context to one is relevance, and task context is relevance to a task. Question that would be popping is what is relevant to a programmer’s task. The answer is anything and everything that one would refer to or need to fulfill the task. It could be a tutorial that you refer to learn about syntax or a formal document depicting the requirements of the task, or the most basic thing the source code files that are created or altered or deleted while working on a task. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;What Mylyn manages for you is this context. The significance of this would be apparent when the feature is clubbed with a Rich UI. Mylyn keeps track of all material referred while a task is active and exposes only these files to the user. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Task tracking is a feature that is bound to please a Project Manager troubled with his employees not filling their timesheets and programmers who end up having to recollect time spent on tasks while filling up time sheets. Only a programmer involved with multiple tasks will realize the significance of this.&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;strong&gt;Why?&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Some one once told me that the most important question one can ask is why. The advantages are manifold. For one, you reduce the number of applications you use during development by a decent number. Now you need not contend with an issue tracker to locate and update work items assigned to you, or a mailbox with automated mails from issue trackers, or timesheet filling systems. Secondly, while a task is active Mylyn actively keeps track about the time you spend on the task freeing you from scratching your brains while filling those hideous timesheets. And last and by far the best is automated context management. Mylyn’s confluence of a Rich UI with the task context will literally clear your workspace clutter. Mylyn keeps track of all files that are used for any task and selectively displays only that very context. Effectively 95% of your workspace has been flushed out of your view. Mylyn goes a step further to keep track of elements within the source files you alter like methods, or variables. In a contrasting way Mylyn clears information from your view while at the same time overwhelming you with specifics that you refer to in a file, only difference being that all that what you see is what you need to see.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Programmers using it feel that their IDE has gone intelligent, but the fact is that Mylyn uses your intelligence by remembering what materials you have referred to.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;It’s time add some color to this article. Let say you have been assigned a task; to write your own collections API to mimic a java.util.ArrayList.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;First thing we do is create a task using Mylyn’s task management system.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_3Al5XxX8ZT8/SF4dlVzWiuI/AAAAAAAAAhw/a_--yqXHJ0M/s1600-h/Mylyn-1.JPG"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;img id="BLOGGER_PHOTO_ID_5214637945886509794" style="margin: 0px auto 10px; display: block; cursor: pointer; text-align: center;" alt="" src="http://4.bp.blogspot.com/_3Al5XxX8ZT8/SF4dlVzWiuI/AAAAAAAAAhw/a_--yqXHJ0M/s400/Mylyn-1.JPG" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_3Al5XxX8ZT8/SF4dlvYKQII/AAAAAAAAAh4/W7dnKvtV59c/s1600-h/Mylyn-2.JPG"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;img id="BLOGGER_PHOTO_ID_5214637952751779970" style="margin: 0px auto 10px; display: block; cursor: pointer; text-align: center;" alt="" src="http://1.bp.blogspot.com/_3Al5XxX8ZT8/SF4dlvYKQII/AAAAAAAAAh4/W7dnKvtV59c/s400/Mylyn-2.JPG" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(102, 102, 102);" align="justify"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;All you do is right click in the task list view and select New → Local Task and specify a name for the task and task particulars like its status, priority, an optional URL corresponding to a bug logged in a web based issue tracker, and your plan for the task, and your notes for the same.&lt;/p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;o:p&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;span style="font-size:0;"&gt;&lt;v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" preferrelative="t" spt="75" coordsize="21600,21600"&gt;&lt;v:stroke joinstyle="miter"&gt;&lt;v:formulas&gt;&lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;v:f eqn="sum @0 1 0"&gt;&lt;v:f eqn="sum 0 0 @1"&gt;&lt;v:f eqn="prod @2 1 2"&gt;&lt;v:f eqn="prod @3 21600 pixelWidth"&gt;&lt;v:f eqn="prod @3 21600 pixelHeight"&gt;&lt;v:f eqn="sum @0 0 1"&gt;&lt;v:f eqn="prod @6 1 2"&gt;&lt;v:f eqn="prod @7 21600 pixelWidth"&gt;&lt;v:f eqn="sum @8 21600 0"&gt;&lt;v:f eqn="prod @7 21600 pixelHeight"&gt;&lt;v:f eqn="sum @10 21600 0"&gt;&lt;/v:f&gt;&lt;v:path connecttype="rect" gradientshapeok="t" extrusionok="f"&gt;&lt;o:lock aspectratio="t" ext="edit"&gt;&lt;/o:lock&gt;&lt;v:shape id="_x0000_i1025" type="#_x0000_t75"&gt;&lt;v:imagedata title="" src="file:///C:%5CDOCUME%7E1%5CRAJIVG%7E1.MAY%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_image001.png"&gt;&lt;/v:imagedata&gt;&lt;/v:shape&gt;&lt;/v:path&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:f&gt;&lt;/v:formulas&gt;&lt;/v:stroke&gt;&lt;/v:shapetype&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_3Al5XxX8ZT8/SF4eZQw-gXI/AAAAAAAAAiA/TKCigzxZK84/s1600-h/Mylyn-3.JPG"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;img id="BLOGGER_PHOTO_ID_5214638837887566194" style="margin: 0px auto 10px; display: block; cursor: pointer; text-align: center;" alt="" src="http://4.bp.blogspot.com/_3Al5XxX8ZT8/SF4eZQw-gXI/AAAAAAAAAiA/TKCigzxZK84/s400/Mylyn-3.JPG" border="0" /&gt;&lt;/span&gt;&lt;/a&gt; &lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;The task content varies from issue tracker to issue tracker. Task definitions allow for adding your comments on a task, or attachments containing screenshots, or stack trace, etc.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;All you do is click the purple ball at the top right.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style=";font-family:'Times New Roman';font-size:12;"  &gt;&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;img id="BLOGGER_PHOTO_ID_5214638843905886130" style="margin: 0px auto 10px; display: block; cursor: pointer; text-align: center;" alt="" src="http://1.bp.blogspot.com/_3Al5XxX8ZT8/SF4eZnL2x7I/AAAAAAAAAiI/P9T94ZB9ftg/s400/Mylyn-4.JPG" border="0" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_3Al5XxX8ZT8/SF4eZnL2x7I/AAAAAAAAAiI/P9T94ZB9ftg/s1600-h/Mylyn-4.JPG"&gt;&lt;/a&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;And your workspace just vanishes.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Now all you do is go about your task creating, updating files and Mylyn remembers each of them.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_3Al5XxX8ZT8/SF4eaPN45vI/AAAAAAAAAiQ/QPliPwqSmYI/s1600-h/Mylyn-5.JPG"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;img id="BLOGGER_PHOTO_ID_5214638854651832050" style="margin: 0px auto 10px; display: block; cursor: pointer; text-align: center;" alt="" src="http://1.bp.blogspot.com/_3Al5XxX8ZT8/SF4eaPN45vI/AAAAAAAAAiQ/QPliPwqSmYI/s400/Mylyn-5.JPG" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="color: rgb(102, 102, 102);"&gt; &lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;If you take notice you would see that the outline for the class ICollections only shows capacity and size method, this is because these are the only methods that we have visited so far.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;As more and more files are captured in the context, Mylyn intelligently filters out files that are less relevant. But that is not to say that they are out of the context, it’s only that the files are blurred from your vision. You can reopen the file easily using search feature of the IDE or open in from the context tab seen during the task creation.&lt;/span&gt;&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_3Al5XxX8ZT8/SF4eadXdwSI/AAAAAAAAAiY/a1v8vFnFrWE/s1600-h/Mylyn-6.JPG"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;img id="BLOGGER_PHOTO_ID_5214638858450092322" style="margin: 0px auto 10px; display: block; cursor: pointer; text-align: center;" alt="" src="http://3.bp.blogspot.com/_3Al5XxX8ZT8/SF4eadXdwSI/AAAAAAAAAiY/a1v8vFnFrWE/s400/Mylyn-6.JPG" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="color: rgb(102, 102, 102);"&gt; &lt;/span&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;All one need to do is move the slider left or right to control the filtering of the context.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;All the while we have been chatting up on task Mylyn has actively kept track of the time spent on the task.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_3Al5XxX8ZT8/SF4eaYn54FI/AAAAAAAAAig/nmUaMDcbtVI/s1600-h/Mylyn-7.JPG"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;img id="BLOGGER_PHOTO_ID_5214638857176866898" style="margin: 0px auto 10px; display: block; cursor: pointer; text-align: center;" alt="" src="http://3.bp.blogspot.com/_3Al5XxX8ZT8/SF4eaYn54FI/AAAAAAAAAig/nmUaMDcbtVI/s400/Mylyn-7.JPG" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;span style="font-size:0;"&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;And saving the best for last is Repository synchronization.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Eclipse keeps track of change-sets. A change-set is a set of changes made during a session. Mylyn takes this a step further to keep track of a change-set relevant to a task. So you may refer to &lt;span style="font-style: italic;"&gt;100&lt;/span&gt; files for a task but alter only &lt;span style="font-style: italic;"&gt;5&lt;/span&gt; of them. So now while wanting to commit these changes to a version tracking system we need not explicitly select the altered files and say commit. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;All a programmer needs to do is select synchronize with repository on your project.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_3Al5XxX8ZT8/SF4fMpVX7dI/AAAAAAAAAio/O_Mf4Mb6ZnU/s1600-h/Mylyn-8.JPG"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;img id="BLOGGER_PHOTO_ID_5214639720656006610" style="margin: 0px auto 10px; display: block; cursor: pointer; text-align: center;" alt="" src="http://2.bp.blogspot.com/_3Al5XxX8ZT8/SF4fMpVX7dI/AAAAAAAAAio/O_Mf4Mb6ZnU/s400/Mylyn-8.JPG" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Now you are moved to a team synchronize view showing all changes made to the selected project. Just for demonstration we have added a Constants.java file outside of a task i.e. while the task is inactive.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_3Al5XxX8ZT8/SG9YK1cIeLI/AAAAAAAAAjU/cHcAtOWyirM/s1600-h/Mylyn-9.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_3Al5XxX8ZT8/SG9YK1cIeLI/AAAAAAAAAjU/cHcAtOWyirM/s400/Mylyn-9.JPG" alt="" id="BLOGGER_PHOTO_ID_5219487436312705202" border="0" /&gt;&lt;/a&gt;&lt;span style="color: rgb(102, 102, 102);"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Now when you click show change-sets you get the view the change-set corresponding to the task. As you see above there are two changes listed; one made as a part of the Collections API task and other outside of the task.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_3Al5XxX8ZT8/SG9bJwdMBDI/AAAAAAAAAjk/aCSdaE2gf2I/s1600-h/Mylyn-10.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_3Al5XxX8ZT8/SG9bJwdMBDI/AAAAAAAAAjk/aCSdaE2gf2I/s400/Mylyn-10.JPG" alt="" id="BLOGGER_PHOTO_ID_5219490716329968690" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;If you recollect we had two files in our context, but we altered only one of them and added a file while the task was inactive, so the team synchronize view shows a number of change-sets; one change-set for each task and one change-set for files that were altered at the project level  i.e. files that are not part of context of any task.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;o:p&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Not only does this feature make life easy for a programmer, but it makes is possible to rollback to a version without the committed changes. Real world task require working on hundreds of files, so if after committing a change-set one needs to rollback to a version without the change is move back one revision (incase of a version control with Atomic Commits).&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-indent: 36pt;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;In part II Mylyn Deep Dive we will explore task management using an issue tracker, and show some weakness in Mylyn’s implementation that becomes evident in real world situations.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6966622285809403106-8674042696454581322?l=rajiv-mayani.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/EKe9hANgY9749n1K_q_LfQXAqGM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EKe9hANgY9749n1K_q_LfQXAqGM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/EKe9hANgY9749n1K_q_LfQXAqGM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EKe9hANgY9749n1K_q_LfQXAqGM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/RajivMayani/~4/Y8HYjt2SjiE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://rajiv-mayani.blogspot.com/feeds/8674042696454581322/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6966622285809403106&amp;postID=8674042696454581322" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6966622285809403106/posts/default/8674042696454581322?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6966622285809403106/posts/default/8674042696454581322?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RajivMayani/~3/Y8HYjt2SjiE/mylyn-unplugged-part-i.html" title="Mylyn Unplugged - Part I" /><author><name>Rajiv Mayani</name><uri>http://www.blogger.com/profile/14509930012090744221</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_3Al5XxX8ZT8/SF4dlVzWiuI/AAAAAAAAAhw/a_--yqXHJ0M/s72-c/Mylyn-1.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://rajiv-mayani.blogspot.com/2008/06/mylyn-unplugged-part-i.html</feedburner:origLink></entry></feed>

