>IMHO first you should ask whether this is needed for the production
version.
>Will it be used in production environment or is it just to ease your
>development? If the former is true then such functionality has no place in
the
>application.
>
STRONG disagreement here--administration of an application should always
play into what featureset goes into an application. Just because *we're* not
the ones to administer it doesn't mean it doesn't belong in there.
>I currently just restart the JRun engine. It seems the 'cleanest' way.
Also
>by adding an 'if' to see if some argument tells you to reload you have just
>lost a milisecond on doing that check. Multiplied by thousands of requests
>times thousands of users it adds up.
>
But that lost millisecond means nothing compared to the lost time in a
data-center that's trying to achieve "five-nine" reliability--that is, it's
up 99.999% of the time. The time spent stopping and restarting the servlet
engine *just* to reload configuration data eats away at that 9 hours of
allowable down time per year, and that's NOT going to make your
administrators happy with you and your development team.
A better approach, perhaps, is to either find a servlet engine that allows
for dynamic reconfiguration of your "active" servlets, or else to have your
servlets read configuration data from a file on disk; granted, it's a
file-I/O hit, but disk caching will usually keep that data close to the
forefront, and updating a file is a pretty well-known paradigm regarding
locking and such. Alternatively, have the servlets use JSDT or IBM's SDO to
access a shared-data object that contains the required configuration; it's a
bit more administrative headache, but your atomicity concerns can be much
stronger, and you can build a GUI, if you wish, to connect to the JSDT
objects and configure the data remotely.
>As to how to handle configuration data. (I hope you mean ServletContext
and
>not HttpSessionContext, otherwise we're not connecting and I'm going off on
a
>wrong track because you may want something else (user specific
configuration in
>HttpSession?)). I just use a properties text file to load a
>java.util.Properties object. Since I use one main servlet in delegation
model
>I have only one properties object. It's pretty straightforward.
>
The only suggestion I have beyond this is that one may wish to create a
type-safe version of Properties, with the get/set methods explicitly coded
to return the appropriate data per property; unfortunately, it's more
development, and *most* of the time you'll want to store your Properties as
Strings anyway, so it's usually not a necessary suggestion.
Ted Neward
Java Instructor, DevelopMentor ( http://www.develop.com )
Patterns/C++/Java/CORBA/EJB/COM-DCOM spoken here
http://www.javageeks.com/~tneward
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html