<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>Kedar Mhaswade&apos;s Blog</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/km/" />
<modified>2007-09-04T21:18:07Z</modified>
<tagline></tagline>
<id>tag:weblogs.java.net,2008:/blog/km/293</id>
<generator url="http://www.movabletype.org/" version="3.01D">Movable Type</generator>
<copyright>Copyright (c) 2007, km</copyright>
<entry>
<title>Effective Java - 1 Companion ...</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/km/archive/2007/09/effective_java_1.html" />
<modified>2007-09-04T21:18:07Z</modified>
<issued>2007-09-04T21:08:03Z</issued>
<id>tag:weblogs.java.net,2007:/blog/km/293.8176</id>
<created>2007-09-04T21:08:03Z</created>
<summary type="text/plain">I have created an Effective Java - 1 Companion (ready reckoner, if you will) at: GlassFish Wiki. I will be enhancing it in the days to come and invite you to participate in related Wiki to improve the correctness of...</summary>
<author>
<name>km</name>

<email>kedar.mhaswade@Sun.COM</email>
</author>
<dc:subject>Programming</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/km/">
<![CDATA[I have created an Effective Java - 1 Companion (ready reckoner, if you will) at: <a href="http://wiki.glassfish.java.net/attach/JavaProgramming/ej.html">GlassFish Wiki</a>.

I will be enhancing it in the days to come and invite you to participate in <a href="http://wiki.glassfish.java.net/Wiki.jsp?page=CommentsOnEffectiveJava1Companion">related Wiki</a> to improve the correctness of the text.

I hope you find it useful.]]>

</content>
</entry>
<entry>
<title>GlassFish Passwords ...</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/km/archive/2007/08/glassfish_passw.html" />
<modified>2007-08-23T17:08:32Z</modified>
<issued>2007-08-23T17:08:22Z</issued>
<id>tag:weblogs.java.net,2007:/blog/km/293.8093</id>
<created>2007-08-23T17:08:22Z</created>
<summary type="text/plain">Ryan de Laplante asked me to blog about this intricate issue of passwords for GlassFish administration. I had already written several articles about it and here is an attempt to collate several such articles: General Introduction to Administrative Credentials of...</summary>
<author>
<name>km</name>

<email>kedar.mhaswade@Sun.COM</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/km/">
<![CDATA[<a href="http://www.ryandelaplante.com/rdelaplante/">Ryan de Laplante</a> asked me to blog about this intricate issue of passwords for GlassFish administration. I had already written several articles about it and here is an attempt to collate several such articles:

<ul>
<li> <a href="http://wiki.glassfish.java.net/attach/GlassFishAdministrationPages/admincreds.html">General Introduction to Administrative Credentials of GlassFish.</a> </li>
<li> <a href="http://wiki.glassfish.java.net/attach/GlassFishAdministrationPages/aliased-passwords.html">Advanced Feature called "Password Aliasing" in GlassFish.</a> </li>
</ul>

Let me know if these are useful.


]]>

</content>
</entry>
<entry>
<title>How to Use JMX to Monitor JVM under GlassFish V1, V2 ...</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/km/archive/2007/08/how_to_use_jmx.html" />
<modified>2007-08-23T16:56:07Z</modified>
<issued>2007-08-23T16:53:48Z</issued>
<id>tag:weblogs.java.net,2007:/blog/km/293.8092</id>
<created>2007-08-23T16:53:48Z</created>
<summary type="text/plain"><![CDATA[In GlassFish V1 and V2, a JMX Connector Server is always available out of the box. This is how it looks like: &lt;jmx-connector accept-all="false" address="0.0.0.0" auth-realm-name="admin-realm" enabled="true" name="system" port="8686" protocol="rmi_jrmp" security-enabled="false"&gt; &lt;ssl cert-nickname="s1as" client-auth-enabled="false" ssl2-enabled="false" ssl3-enabled="true" tls-enabled="true" tls-rollback-enabled="true"/&gt; &lt;/jmx-connector&gt; What...]]></summary>
<author>
<name>km</name>

<email>kedar.mhaswade@Sun.COM</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/km/">
<![CDATA[In GlassFish V1 and V2, a JMX Connector Server is always available out of the box. This is how it looks like:

<div>   &lt;jmx-connector accept-all="false" address="0.0.0.0" auth-realm-name="admin-realm" enabled="true" name="system" port="<b>8686</b>" protocol="rmi_jrmp" security-enabled="<b>false</b>"&gt;         &lt;ssl cert-nickname="s1as" client-auth-enabled="false" ssl2-enabled="false" ssl3-enabled="true" tls-enabled="true" tls-rollback-enabled="true"/&gt;<BR>
        &lt;/jmx-connector&gt;</div>

What this means is:
<ul>
<li> There is an RMI Registry that's started in process. This acts as a naming service to download the RMI stub from. This is how the "standard" JMX RMI Connector Server (that's integrated into Java SE 5.0) works. </li>
<li> One does not have to pass the properties: <p>-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8004 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false</p>
to the VM.
<li> This is a non-secure RMI connection. You have to make sure yourself that you are connecting to the "right" server. </li>
</ul>

Here is the process (well, not really) to see the JVM MBeans in action:
<ul>
  <li> Start the server (asadmin start-domain).
  </li>
  <li> Start JConsole and connect to the server thus:
<div>
    <img src="http://weblogs.java.net/blog/km/jconsole-1.jpg" border="1" height="319" width="430" alt="jconsole-1.jpg" align="center" />
</div>
  </li> 
  <li> Browse to the MBeans tab and see all the JVM Monitoring MBeans yourself. <div>
    <img src="http://weblogs.java.net/blog/km/jconsole-2.jpg" border="1" height="424" width="843" alt="jconsole-2.jpg" align="center" /> </div>
  </li>
  <li> The same data is available in admin console and admin CLI (asadmin get command) when the VM monitoring level is turned to high.
  </li>
</ul>]]>

</content>
</entry>
<entry>
<title>GlassFish V2: On-the-fly upgrade of a developer domain ...</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/km/archive/2007/06/glassfish_v2_on.html" />
<modified>2007-06-04T19:05:48Z</modified>
<issued>2007-06-04T18:48:21Z</issued>
<id>tag:weblogs.java.net,2007:/blog/km/293.7557</id>
<created>2007-06-04T18:48:21Z</created>
<summary type="text/plain">I have created these two screen-casts explaining this feature. Please watch/listen to them at: Part 1 Part 2 You will need QuickTime Player installed. Here is the transcript: Hi, my name is Kedar and I am administration/management architect for GlassFish...</summary>
<author>
<name>km</name>

<email>kedar.mhaswade@Sun.COM</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/km/">
<![CDATA[I have created these two screen-casts explaining this feature.

Please watch/listen to them at:

<ul>
<li> <a href="http://weblogs.java.net/blog/km/archive/dev-cluster-1.mov"> Part 1 </a> </li>
<li> <a href="http://weblogs.java.net/blog/km/archive/dev-cluster-2.mov"> Part 2 </a></li>
</ul>

You will need QuickTime Player installed. Here is the transcript:

<P>Hi, my name is Kedar and I am administration/management architect for GlassFish V2. Welcome to this GlassFish V2 Screen-cast.
<P>
Owing to growing popularity of clustering features of GlassFish V2, from build b48 onwards, we have added a nice feature to dynamically add the clustering support to an existing domain. I expect it to ease migration of your applications to the enterprise, by helping you scale those applications.

<P>
First, some terminology -- A developer domain -- a domain where the domain = server.  There is a single VM that hosts user applications. The same VM has built-in support to manage applications including management of itself. Thus, in this case, the domain is same as server, and the so-called domain admin server (DAS) is the same as your server where you deploy your applications. Such a domain is characterized by a "developer" profile.

<P>
A cluster-aware domain -- a domain where the domain has support for standalone and "clustered" server instances. Every server instance is a separate Java EE engine (and VM) and those instances host your applications. In other words, they are your "deployment targets". The plain old domain in that case assumes the role of a manager of these clusters and instances. Of course, the manager itself can continue to be deployment target. But it is not the usual case. As you can imagine, in a production/enterprise scenario, you'd want to limit the manager to management and not expose it to users of your applications, isn't it? Such a domain is characterized by two profile names -- "cluster" and "enterprise" in GlassFish V2.

<P>
The usual way in which GlassFish V2 and Sun's Application Server solve this problem is by creating the domains with a create-time-profile. This profile determines whether a domain supports clusters to begin with. As you can imagine, clustering brings in some additional features and subsystems that won't be required in the developer case. Thus, the DAS for developer profile (which is of course the only server process in the domain) and that for cluster profile are slightly different entities. A developer domain, as you can imagine, would throw an error when asked to create a cluster for instance, because it is not equipped with all the bells and whistles needed to provide such a support.

<P>
So, developer domain is popular with developers. The NetBeans assisted develop+build+deploy+debug cycle is facilitated in that setup.

<P>
So, what do you do? Right -- you start with the developer
domain. Of course, you deploy and debug your applications.
Maybe you host an application like forums or bookstore etc. But it may so happen that the only server machine you have is shut down. The application/service you have is then unavailable.  That's where the cluster domain comes into picture. You can deploy your application to the cluster and bingo, if one of the machines goes down, your availability is affected only slightly!

<P>
But wait a minute. You have started with developer domain, deployed services and six months go by and the service is shut down for a while. Is the only way out to impart availability then to start all over? You'll say, "You mean I redo the entire configuration changes? I don't remember all those! Bummer".

<P>
Well, that is unfortunate if true.

<P>
That's where this feature comes in handy. Once you think that your domain needs availability, you just do it "on the fly".

<P>
Here's how you do it:

<P>
You have a developer domain.
This is shown in the start-domain output as shown here.
The output says -- this domain does not support the clusters and instances. Say you have deployed some applications. Now, logon to the powerful GlassFish V2 admin console. It shows the state of the domain and as you can see, it does not have any clusters/load-balancing configuration support. 

<P>
Owing to the previous discussion, you decide to provide clustering support. Here is the button that is available right on the "Application Server" tab. Just click here and it does all the magic. Now, this domain is "upgraded" to have the cluster management support!

<P>
You can continue to modify the configuration, but it is better that you restart the domain as the console shows.

<P>
Thus, when you start the domain, you'll see that it takes a little longer to start up and also displays that it now supports the clusters.

<P>
After you restart the domain, you will observe the subtle changes that happen to the domain's configuration and admin console appearance. For example, you'll see cluster and instance nodes that were not available before. You can now use targets for deployment. Thus the given application which is available on the DAS alone can easily be referred to from other targets.

<P>
What happens under the hood?

<P>
- The server is upgraded to have domain administration support. This requires few JVM parameters to be tweaked. These are internal GlassFish/Application Server VM parameters that turn on the clustering.

<P>
- The enabling factor here is that all distributions of GlassFish/Application Server have exactly same set of bits! This is a welcome change in the way we distributed the application server bits. In other words, the support was already available in the server's binaries, we only ensured that that it is instrumented through configuration.

<P>
How to impart availability to existing applications and resources?

<P>
Here are the (only) steps:

<P>
- Select the application deployed onto domain. At the moment, since this is only upgraded to be cluster-aware, it is available only on the domain. Go to admin console and make the changes to its configuration to say that its "availability-enabled" flag is turned on. Make sure that your web-application is distributable.

<P>
- Create clusters of your interest. Add server instances to it.

<P>
- Create and start the node-agents on the machines where your instances in your cluster are going to reside. Of course, you need to have GlassFish V2 installation on those machines.

<P>
- Create references to applications and resources that you deployed to the domain, from the cluster(s) of interest. Note, you don't have to redeploy!

<P>
- Start the cluster(s).

<P>
- The applications are available in all the server instances. You can then load balance these applications using a software load balancer (and/or h/w load balancer). Thus an application like bookstore that was available on http://das-machine:8080/bookstore would be available also on http://foo:38080/bookstore and http://bar:38080/bookstore. The only difference is that the applications available on machines "foo" and "bar" take part in availability. The one that is available on "das-machine" does not. But that's the way it should be, as you don't want to stress the "das-machine" to serve pages from your bookstore. Thus, once everything works, you can "de-reference" the bookstore application from the DAS!

<P>
That's it, no other changes needed.

<P>
What if something goes wrong?

<P>
The only file that is modified by this operation alone is domain's domain.xml. So, before you do this operation, it might be better to back domain.xml up.

<P>
Is there a way to go back?

<P>
Yes, only if domain.xml is backed up. Application Server software does not provide a way to do it. The reason we don't have it is because we think you'll never want to go back once you "upgrade" the domain this way. The reason is that the domain continues to work the way it was working and adds a clustering support on top!

<P>
That's about it. Thank you for listening.
]]>

</content>
</entry>
<entry>
<title>Java.net, community, GlassFish, OpenSearch Search Engines, Firefox ...</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/km/archive/2007/05/javanet_communi.html" />
<modified>2007-05-07T02:58:03Z</modified>
<issued>2007-05-07T02:53:02Z</issued>
<id>tag:weblogs.java.net,2007:/blog/km/293.7245</id>
<created>2007-05-07T02:53:02Z</created>
<summary type="text/plain">This post discusses how the Web (2.0) is burgeoning.</summary>
<author>
<name>km</name>

<email>kedar.mhaswade@Sun.COM</email>
</author>
<dc:subject>Community</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/km/">
<![CDATA[<font size="2">
<p>A while ago, I <a href="http://weblogs.java.net/blog/km/archive/2007/04/glassfish_issue.html">blogged</a> about OpenSearch plugin for Firefox-like browsers. I got interested in it and then the java.net Guru <a href="http://weblogs.java.net/blog/kohsuke/">Kohsuke</a> gave me some nice ideas about making it more generic. This post brings about little things that prove that the Web is burgenoning and community is  important.</p>
<h2>Problem</h2>
<p>Well, it is not really a problem. It is an improvement. You have seen the <a href="http://weblogs.java.net/blog/km/images/search-engine-box.png">Search Engine integration</a> for the Firefox browser. It simply adds a set of &quot;search engine&quot; in the top-right corner of the browser. In my <a href="http://weblogs.java.net/blog/km/archive/2007/04/glassfish_issue.html">first blog</a>, I added a customized GlassFish Issue Tracker Engine (and <a href="http://blogs.sun.com/nitya/entry/firefox_search_plugin_for_netbeans">Nitya enhanced it for NetBeans</a>).</p>

<p>But then Kohsuke gave me the idea that Firefox, when contacting a particular site, looks for a particular OpenSearch compliant XML file that corresponds to a particular mime type and automatically adds a menu item in the list of search engines available. This is how it looks. </p>
<p><a href="http://weblogs.java.net/blog/km/images/search-engine-box-java-net-contact.png">
  <img alt="search-engine-box-java-net-contact.png" src="http://weblogs.java.net/blog/km/images/search-engine-box-java-net-contact.png" width="552" height="158" /> </a></p>
<p><a name="image2" id="image2"></a>image-2: Search Engine: &quot;Add Java.net Issue Tracker&quot; Search Engine Menu Item! (Click to Enlarge) </p>
<p>When you simply click on that menu item, it adds the search engine to your list of search engines and is ready to go! </p>
<p>Then Kohsuke made changes to the templates of various java.net project and the search engine will be added to the list, <strong>when you connect to any one of the several key GlassFish-affiliated java.net projects</strong>. For example, if you go to <a href="http://jaxp.dev.java.net">http://jaxp.dev.java.net</a> or <a href="http://grizzly.dev.java.net">http://grizzly.dev.java.net</a>, you will see this menu item added! </p>
<p><a href="http://weblogs.java.net/blog/km/images/search-engine-example-project-all-my-bugs.png"> 
<img src="http://weblogs.java.net/blog/km/images/search-engine-example-project-all-my-bugs.png" alt="Click to Enlarge" width="552" height="158"  /></a></P>
<p><a name="image3" id="image3"></a>image-3: An Example Usage (Click to Enlarge) </P>
<p>What this enables is a cross-project issue tracker look-up in an intuitive manner. Suppose you are at <a href="http://glassfish.dev.java.net">http://glassfish.dev.java.net</a> home-page and you want to see how many grizzly bugs are assigned to Jeanfrancois (jfarcand is the java.net ID), then you simply type:</P>
<p><strong>grizzly jfarcand</strong> </P>
<p>in the search box and you will see all the bugs assigned to <em>jfarcand</em> for project <em>grizzly</em>. The following queries are supported:</P>
<ol>
  <li>Participating java.net project name (e.g. glassfish, jaxb, jaxp, grizzly, ...) followed by java.net id -- shows the issues assigned to this java.net id.</li>
  <li>Participating java.net project name (e.g. glassfish, jaxb, jaxp, grizzly, ...) followed by an issue id (an int) -- shows that issue in detail.</li>
  <li>Just the java.net id --  shows GlassFish issues assigned to this java.net id (degenerate case of 1).</li>
  <li>Just an issue id -- shows the GlassFish issue with given id in detail (degenerate case of 2).</li>
</ol>
<p>The real enabler of this is shown in the following picture. </p>
<p><a href="http://weblogs.java.net/blog/km/images/search-enabler.png"> <img alt="search-enabler.png" src="http://weblogs.java.net/blog/km/images/search-enabler.png" width="552" height="158" /> </a></p>
<p><a name="image4" id="image4"></a>image-4: The Real Enabler - HTML Head &lt;link&gt; (Click to Enlarge) </p>
<p>What Kohsuke just did is he changed the theme-engine for a number of java.net projects and that enables this seamless integration.</p>
<p>Let me know if you like it. Use it if yes.</p>
<p>I will check in the source code somewhere on the java.net project and then we can enhance this project ...   </p>
</font>
]]>

</content>
</entry>
<entry>
<title>NetBeans Open Project Dialog Woes ...</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/km/archive/2007/04/netbeans_open_p_1.html" />
<modified>2007-04-21T07:40:27Z</modified>
<issued>2007-04-21T07:40:23Z</issued>
<id>tag:weblogs.java.net,2007:/blog/km/293.7113</id>
<created>2007-04-21T07:40:23Z</created>
<summary type="text/plain">This post brings out a design flaw in NetBeans Open Project Dialog.</summary>
<author>
<name>km</name>

<email>kedar.mhaswade@Sun.COM</email>
</author>
<dc:subject>Community: Java Tools</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/km/">
<![CDATA[<p><font size="2"><br />
I use NetBeans. I like it. I encourage people to use it.</p>

<p>But I am not happy about their handling of "Open Project ..." Dialog. I have checked both NetBeans 5.5.1 RC1 and NetBeans 6.0 daily downloads.</p>

<p>The dialog looks like this (click to enlarge).<br />
<a href="http://weblogs.java.net/blog/km/archive/nb-open-project.jpg/nb-open-project.jpg"><br />
<img alt="NB Open Project ..." height="200" width="200" src="http://weblogs.java.net/blog/km/archive/nb-open-project.jpg/nb-open-project.jpg"/><br />
</a></p>

<p>I have seen several developers double-click a project folder expecting it to just open the project and finding that it just opens the folder because this widget is just a file chooser! </p>

<p>I mean it understands that the folder is a <i> NetBeans Project </i> Folder, but behaves like a normal folder. So, the only way to open the project is to click the "Open Project Folder" button. This is even worse when you have already double-clicked the folder, because you will have to go to the parent folder and then click the button.</p>

<p>Agreed, that there could be project folders inside project folders (and this is sort of (premature) optimization of using a simple File Chooser to do dual job), but that's a relatively rare case and I think it should certainly be discouraged or made hard to deal with. Instead of that we are making the usual case more difficult to deal with -- double clicking a <b> Project Folder </b> should just open the project in IDE, not open the folder.</p>

<p>Do you find it difficult too (i.e. if you use NetBeans Projects)?</p>

<p>You can suggest a work-around, but it needs to be intuitive enough.<br />
</font></p>]]>

</content>
</entry>
<entry>
<title>GlassFish Issue Tracker and OpenSearch Document ...</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/km/archive/2007/04/glassfish_issue.html" />
<modified>2007-04-19T15:18:50Z</modified>
<issued>2007-04-19T15:18:44Z</issued>
<id>tag:weblogs.java.net,2007:/blog/km/293.7092</id>
<created>2007-04-19T15:18:44Z</created>
<summary type="text/plain">Do you like Firefox and its support for OpenSearch specification? If yes, read on ...</summary>
<author>
<name>km</name>

<email>kedar.mhaswade@Sun.COM</email>
</author>
<dc:subject>J2EE</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/km/">
<![CDATA[<a href="http://www.opensearch.org/Specifications/OpenSearch/1.1">OpenSearch is a nice specification and Firefox 2.0 has a support for it. 
<P>
<a href="https://glassfish.dev.java.net">GlassFish </a> is an open source project I work on. I wrote a simple GlassFish Issue Tracker Search Plugin for Firefox. Get it
<a href="https://glassfish.dev.java.net/source/browse/*checkout*/glassfish/www/coolstuff/installffplugin.html">
here </a>.

<P>
Enjoy :)
]]>

</content>
</entry>
<entry>
<title>kill and kill -9</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/km/archive/2007/02/kill_and_kill_9_1.html" />
<modified>2007-02-08T06:15:41Z</modified>
<issued>2007-02-08T06:10:57Z</issued>
<id>tag:weblogs.java.net,2007:/blog/km/293.6504</id>
<created>2007-02-08T06:10:57Z</created>
<summary type="text/plain">I am trying to understand why  kill -9  is preferred over plain killby most developers. Is it just the case of impatience? I understand that there
might be cases where &quot;kill -9&quot; has to be done for process might misbehave by ignoring the other flavors of kill signal. But I believe
all modern server programs add a shutdown hook. In these cases, is it
better that developers favor &quot;kill&quot; over &quot;kill -9&quot; as that might give the process a chance to do minimally required cleanup?</summary>
<author>
<name>km</name>

<email>kedar.mhaswade@Sun.COM</email>
</author>

<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/km/">
<![CDATA[Java provides a way to add a shutdown hook that will be called during the VM's exit sequence and semantics of that are clearly defined in the Javadoc <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Runtime.html#addShutdownHook(java.lang.Thread)">here</a>.
<P>
The Javadoc clearly instructs <i>If the virtual machine aborts then no guarantee can be made about whether or not any shutdown hooks will be run.</i> </P>

<P>
I was just curious to test this out with <a href="http://glassfish.dev.java.net">GlassFish Application Server</a> on my MacBookPro. When the GlassFish server VM either aborts or shuts down, I observe the following:
<table BORDER="2" ALIGN="center" CELLPADDING="5" BORDERCOLOR="black"  FRAME="vsides" RULES="rows" WIDTH="75%">
<tr> <th>signal-id</th> <th>meaning according to manpage </th> <th> observation </th></tr>
<tr> <td>Default (no-id, 15) </td><td>TERM (software termination signal)</td><td>Shutdown hook called.</td></tr>
<tr> <td>1</td> <td> HUP (hang up)</td><td>Shutdown hook called, VM exits. </td></tr>
<tr> <td>2</td><td>INT (interrupt) </td><td>Shutdown hook called, VM exits. </td></tr>
<tr> <td>3</td><td>QUIT (quit)</td><td>Shutdown hook <b>NOT</b> called, VM continues to run. This is understandable as this should result in VM spitting the thread dump. In other words, this signal is handled at the VM level and Java code does not get a chance to do anything. :)</td></tr>
<tr> <td>6</td><td>ABRT (abort) </td><td>Shutdown hook <b>NOT</b> called, VM exits.</td></tr>
<tr> <td>9</td><td>KILL (thou shalt die NOW)</td><td>Shutdown hook <b>NOT</b> called, VM exits.</td></tr>
<tr> <td>14</td><td>ALRM (alarm clock)</td><td>Shutdown hook <b>NOT</b> called, VM exits.</td></tr>
<tr> <td>15 </td><td>See the default case above. </td><td>See default case above.</td></tr>
</table>

</P>]]>

</content>
</entry>
<entry>
<title>Should package-info.java be renamed?</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/km/archive/2006/12/should_packagei_1.html" />
<modified>2007-01-01T06:22:30Z</modified>
<issued>2007-01-01T03:39:45Z</issued>
<id>tag:weblogs.java.net,2006:/blog/km/293.6231</id>
<created>2007-01-01T03:39:45Z</created>
<summary type="text/plain">Names  should be chosen carefully. This is especially true with public API.</summary>
<author>
<name>km</name>

<email>kedar.mhaswade@Sun.COM</email>
</author>
<dc:subject>Community: JDK</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/km/">
<![CDATA[<P>
It is <a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html#packagecomment"> suggested </a> that the <i>preferrred </i> way of creating the 
information for a Java package, such that the <i>javadoc</i> tool recognizes it as such, while creating 
the javadoc documentation.
<P>

 I decided to take this advice and immediately landed into problem of inconsistency with it. I could not 
create this file as a Java source file, using the NetBeans IDE because it is not a proper java class name! So, I 
wonder why Java SE decided to take such a name. Wouldn't just <b> packageinfo.java </b> serve the 
purpose? 
<P>
Am I missing something obvious?]]>

</content>
</entry>
<entry>
<title>Static Imports -- not a clean job?</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/km/archive/2006/12/static_imports.html" />
<modified>2006-12-24T01:22:07Z</modified>
<issued>2006-12-24T01:22:01Z</issued>
<id>tag:weblogs.java.net,2006:/blog/km/293.6216</id>
<created>2006-12-24T01:22:01Z</created>
<summary type="text/plain">Well, we should use static imports sparingly. But why is the support in Java 5 and 6 not first class?</summary>
<author>
<name>km</name>

<email>kedar.mhaswade@Sun.COM</email>
</author>
<dc:subject>Community: JDK</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/km/">
<![CDATA[<p>We have been <a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/static-import.html">requested </a> to use static imports sparingly. I like that advice. Use your judgment to actually use this support.</p>

<p>But frankly, articles, presentations I have seen use the stdout, the "out" field of java.lang.System as imported statically. But, the following program does not compile:</p>

<p>class Format {<br />
	public static void main(final String[] args) {<br />
	    out.format("Hello, World!");<br />
	}<br />
}</p>

<p>Why?</p>

<p>Because I did not do: import static java.lang.System.out!</p>

<p>Why are all public members of the System classes not automatically<br />
statically imported, like the System classes are imported?</p>

<p>Is there a problem with this expectation? Would community like implicit static import of public members of java.lang.*?</p>]]>

</content>
</entry>
<entry>
<title>Extended Enterprise Application Platform and Java SE 6 together ...</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/km/archive/2006/12/extended_enterp_1.html" />
<modified>2006-12-16T07:03:13Z</modified>
<issued>2006-12-16T07:02:47Z</issued>
<id>tag:weblogs.java.net,2006:/blog/km/293.6184</id>
<created>2006-12-16T07:02:47Z</created>
<summary type="text/plain">Application Platform SDK Update 2 was just released by Sun and it has got not only a suite of integrated software but also a much improved performance. One of the interesting things is the bundled Java SE 6 ...</summary>
<author>
<name>km</name>

<email>kedar.mhaswade@Sun.COM</email>
</author>
<dc:subject>Community: Java Enterprise</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/km/">
<![CDATA[As Scott Oaks has <a href="http://weblogs.java.net/blog/sdo/archive/2006/12/new_specjappser.html">pointed out</a>, the Application Platform SDK (formerly known as Java EE SDK) has been released.

One of the things that quickly catches the eye is on-demand attach for JConsole that Java SE 6 has. The idea is that you can now avoid the non-intuitive Java System Properties (that were essential in Java SE 5) and still manage and monitor a Java SE 6 VM, <em>on-demand</em>.

So all you do is:
<li> Download the platform (which has a folder name of "SDK" for some reason). </li>
<li> Start the default domain by doing <b> asadmin start-domain </b> </li>

And when you start JConsole, you'll see the default application server domain VM right there as shown in <a href="http://weblogs.java.net/blog/km/archive/jconsole-11." onclick="window.open('http://weblogs.java.net/blog/km/archive/jconsole-11.','popup','width=450,height=450,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false">this graphic</a>.

When you click on "Connect", it connects to the application server VM
and you can monitor the entire application server VM. All the MBeans, threads, classes, memory, operating system is visible. ]]>

</content>
</entry>
<entry>
<title>A first blog: presenting the case for simpler Java EE samples ...</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/km/archive/2006/11/a_first_blog_1.html" />
<modified>2006-11-05T00:53:37Z</modified>
<issued>2006-11-05T00:53:34Z</issued>
<id>tag:weblogs.java.net,2006:/blog/km/293.5869</id>
<created>2006-11-05T00:53:34Z</created>
<summary type="text/plain">Key to technology accessibility is simplicity of trying things out. Yes, I am talking about developer ease of use. Trying out the technology samples with Java EE vendors is not easy now-a-days.</summary>
<author>
<name>km</name>

<email>kedar.mhaswade@Sun.COM</email>
</author>
<dc:subject>J2EE</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/km/">
<![CDATA[<font size="3"> OK. Here is a poll. How many developers feel that it is very easy to try simple examples out with a Java EE implementation like GlassFish? One caveat is that you must be "<b>absolutely not familiar</b>" with the technology. For example, how easy is it to try out a servlet sample that updates a database using a resource?
<br /> In my view, it is not as easy as I'd have liked, at least with GlassFish. There is a huge room for improvement. I am sure that's true with any application server vendor. And that, in part, is a reason for developers taking time to learn Java EE. The setup time is rather too much.
<br /> Last night, I was just trying to deploy an application like jdbc-simple.ear that shows how a servlet can greet a visitor and shows a record of how many visitors have already been greeted. Simple, huh? Here is what I ran into: </font>
<ul>
  <li><font size="3"> I had the servlet with a resource reference. But the resource was not created just by deploying the application. I was under the impression that I have to just do <i> asadmin deploy jdbc-simple.ear </i> and I am done. No, you've got to create the resources. </font>
  </li>
  <li><font size="3"> OK, perform a step like creation of resources, creation of jdbc connection pool and so on. </font>
  </li>
  <li><font size="3"> Remember to start the database! Even when the vendors come integrated with database, you've got to remember to start the database server. </font>
  </li>
  <li><font size="3"> You still have to create the schema for the database. For example, it asked me to create a table called DERBYPUBLIC with a specific schema. Whew, what a mess. I have to connect to the Database, use the Runtime tab of NetBeans IDE, create the schema. But wait a minute, I don't know the schema! I don't know what column names are, datatypes are and so on. </font>
  </li>
</ul> 
<font size=3>
May I just suggest having all the configuration/setup a part of the sample application itself? Deployment of the sample application should be all you need.]]>

</content>
</entry>

</feed>