|
From: Brian Z. <bz...@ig...> - 2001-02-13 15:21:10
|
Robert,
I'm +1 for adding the destroy() on destroy() and reset().
brian
-----Original Message-----
From: jyt...@li...
[mailto:jyt...@li...]On Behalf Of Robert W.
Bill
Sent: Tuesday, February 13, 2001 1:47 PM
To: jyt...@li...
Subject: [Jython-dev] PyServlet destroy, ns
Hi all,
Just curious- is it reasonable to add a destroy() for the PyServlets.
Something like:
public void destroy()
{
Enumeration e =3D cache.keys();
while (e.hasMoreElements()) {
CacheEntry ce =3D e.getNext();
HttpServlet pyServlet =3D (HttpServlet)ce.servlet;
pyServlet.destroy();
}
}
Not this code, it's just the quickest example, but a destroy
would be nice if a PyServlet wants to do something specific when
unloaded.
If this is something good, should reset() call destroy() on PyServlets
as
part of the reset, in case they do something important in destroy()?
On an unrelated note, module global variables are common in the Jython
world. Is there an advantage to PyServlet if each servlet has it's own
namespace to accomodate this? It would mean a PyDict for each servlet,
is
that wasteful for just module globals? Also, is it possible to use the
Py
methods directly so you can use things like:
Py.exec(PyObject o, PyObject globals, PyObject locals)
instead of interp.exec("code in ns")?
Thanks,
-Robert
_______________________________________________
Jython-dev mailing list
Jyt...@li...
http://lists.sourceforge.net/lists/listinfo/jython-dev
|