Hi,


I still have a question about  Servlet+SingleTon :-)

0
If in the "Initialization" of myServlet class, I make a
instance of mySingleTon class, for example:

public class myServlet extends HttpServlet
{
...
//static mySingleTon st=mySingleTon.getInstance();
//or :-)
//mySingleTon st=mySingleTon.getInstance();

...
}


1 --  then when the first time I acess myServlet:
  a    myServlet will be loaded by one
        ClassLoader -- ClassLoaderX :-)

   b   and I suppose I already find a way to let this Servlet engine
        will Always_Only use one special ClassLoader  -- for example,
        ExtClassLoader -- to load the class mySingleTon :-) so now,
        mySingleTon also has been loaded by ExtClassLoader

2    now my questions are :-)

     a   how long mySingleTon will be "active" before
          it is "removed" by ExtClassLoader?  for example,
          after the first time I acess myServlet  with a Browser,
          then the second time will be after one day -- the "business"
          of my WEB site is very_not_Great, so I have to visit it
          BY MYSELF:-) :-) ,  now I guess
          ExtClassLoader will "remove" mySingleTon during this one
          day :-)

      b  With what codition ExtClassLoader will decide to remove
          mySingleTon?  by time or other ? :-)  What is the relation
           of ClassLoaderX and ExtClassLoader? does ClassLoaderX
          send some infomation to  ExtClassLoader about mySingleTon?

      c  I suppose someone put a "static counter" in mySingleTon,
          now I guess after every time that mySingleTon is loaded_
          and_remove, this "static counter" will be reset :-)  or if
          someone put a "DB connection pool" in mySingleTon,
          then such connection will be opened again.

       d  so I want to know how to control the "active interval"
           of mySingleTon even if there is not new "client accessing"
           to myServlet.

Please correct me if I am wrong :-)   Thanks in advance!


Bo
Oct.24, 2000

___________________________________________________________________________
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

Reply via email to