wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes distributable DD - what does it do ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "distributable DD - what does it do ?" Watch "distributable DD - what does it do ?" New topic
Author

distributable DD - what does it do ?

Rama Raghavan
Ranch Hand

Joined: Aug 22, 2001
Posts: 116
Snippet from the spec:

The distributable element, by its presence in a web application deployment descriptor, indicates that this web application is programmed appropriately to be deployed into a distributed servlet container<!ELEMENT distributable EMPTY>

I believe the container should be responsible for supporting a distributable environment, and the app be programmed appropriately in order to be distributable.
1. How does the presence of this element in the web.xml force/guarantee the distributable nature of an app?
2. Assume that the app is programmed properly.
If this element is NOT specified in web.xml for the app, does it mean it cannot be deployed in a distributable environment ?
Really - what does the <distributable> tag do?
Rama
[ November 22, 2002: Message edited by: Rama Raghavan ]

Rama Raghavan<br />SCJP2<br />SCWCD
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Originally posted by Rama Raghavan:
1. How does the presence of this element in the web.xml force/guarantee the distributable nature of an app?
In its most basic form, it is no more than a flag to tell the container that this application should work with any distribution features that it has.
There are some intelligent things a container can do, though. In a distributable application, every session-bound object must be Serializable, so a container can enable some validation to check this even when it is not running in distributed mode.
2. Assume that the app is programmed properly.
If this element is NOT specified in web.xml for the app, does it mean it cannot be deployed in a distributable environment ?
Not as a distributed application in any case. You see, there is no automated way to find out whether an application is really fit to run in a distributed container. The Serializable check I described above is easy to do, but it is by no means enough. There are numerous other things that can bite you in a distributed application -- assumptions about Singletons, data consistency issues, transient fields, etc.
Only you, the developer, can decide whether the application can be distributed. And the distributable flag is how you make that decision known to the servlet container.
Does this help?
- Peter
Rama Raghavan
Ranch Hand

Joined: Aug 22, 2001
Posts: 116
Thanks for your quick response.
Agreed that application developer must ensure/program for distributability of the app. So reason enough that the container should not "care" if the app is in-fact "flagged" distributable or not.
I have developed/deployed apps in a distributed environment using Weblogic 6.X. The container does not STOP deployment to a cluster/multiple servers even though the web.xml does NOT have <distributable> tag, and the app works fine..session migrates on fail-over, to be specific.
If the app is distributed, and has non-serializable objects bound to session, Weblogic throws messages in the logs.
So - (absence of) tag in web.xml has had not impact to the behavior of the container or the app.
Rama
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Originally posted by Rama Raghavan:
I have developed/deployed apps in a distributed environment using Weblogic 6.X. The container does not STOP deployment to a cluster/multiple servers even though the web.xml does NOT have <distributable> tag
Yikes!
and the app works fine..session migrates on fail-over, to be specific.
Only because your session objects happened to be Serializable by sheer coincidence. In a non-distributable application, they do not have to be! I find this behaviour very dangerous. I'm willing to bet that over 90% of applications which were not specifically written to be distributable break in a distributed environment in subtle and not so subtle ways.
Heck, sometimes it seems that 90% of applications which were specifically written to be distributable break especially as load gets really high.
- Peter
 
GeeCON Prague 2014
 
subject: distributable DD - what does it do ?