RE: Loading Singleton Classes
That's true enough, and the latter part is also true. --mikej -=- mike jackson [EMAIL PROTECTED] > -Original Message- > From: Erik Price [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 20, 2003 1:00 PM > To: Tomcat Users List > Subject: Re: Loading Singleton Classes > > > If someone wanted to override the security of your class by subclassing > your singleton (so the new subclass qualifies as being of your > singleton's type) but with different, potentially malicious, logic inside. > > Probably not an issue if you are not exposing your code. > > > Erik > > > > Felipe Schnack wrote: > > You could give me practical exemple of why I would do that? > > On Thu, 2003-02-20 at 17:49, Mike Jackson wrote: > > > >>You could use final if you didn't want inherited versions to be > able to have > >>themselves be returned. > >> > >>--mikej > >>-=- > >>mike jackson > >>[EMAIL PROTECTED] > >> > >> > >>>-Original Message- > >>>From: Felipe Schnack [mailto:[EMAIL PROTECTED]] > >>>Sent: Thursday, February 20, 2003 12:44 PM > >>>To: Tomcat Users List > >>>Subject: Re: Loading Singleton Classes > >>> > >>> > >>> Or even > >>> public static final Singleton s = new Singleton(); > >>> :-) > >>> > >>>On Thu, 2003-02-20 at 17:43, Tim Funk wrote: > >>> > >>>>Actually you'll want to make > >>>> public static Singleton s = new Singleton(); > >>>>be > >>>> private static Singleton s = new Singleton(); > >>>> > >>>>So a wise guy doesn't do this: > >>>>Singleton.s = null; > >>>> > >>>>-Tim > >>>> > >>>>Mike Jackson wrote: > >>>> > >>>>>To code it correctly follow the pattern. :) > >>>>> > >>>>> > >>>>>Should look something like this: > >>>>> > >>>>> class Singleton { > >>>>> public static Singleton s = new Singleton(); > >>>>> > >>>>> protected Singleton() { > >>>>> super(); > >>>>> } > >>>>> public static Singleton getHandle() { > >>>>> return s; > >>>>> } > >>>>> } > >>>>> > >>>>>--mikej > >>>>>-=- > >>>>>mike jackson > >>>>>[EMAIL PROTECTED] > >>>>> > >>>>> > >>>>> > >>>>>>-Original Message- > >>>>>>From: Luc Foisy [mailto:[EMAIL PROTECTED]] > >>>>>>Sent: Thursday, February 20, 2003 11:35 AM > >>>>>>To: Tomcat Users List > >>>>>>Subject: RE: Loading Singleton Classes > >>>>>> > >>>>>> > >>>>>>Ok. How do I code it incorrectly then? :) > >>>>>>I want it to be unique to each session. Is there anyway I > can do that? > >>>>>> > >>>>>> > >>>>>> > >>>>>>>-Original Message- > >>>>>>>From: Mike Jackson [mailto:[EMAIL PROTECTED]] > >>>>>>>Sent: Thursday, February 20, 2003 2:31 PM > >>>>>>>To: Tomcat Users List > >>>>>>>Subject: RE: Loading Singleton Classes > >>>>>>> > >>>>>>> > >>>>>>>Same, if you code it correctly. > >>>>>>> > >>>>>>>--mikej > >>>>>>>-=- > >>>>>>>mike jackson > >>>>>>>[EMAIL PROTECTED] > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>>>-Original Message- > >>>>>>>>From: Luc Foisy [mailto:[EMAIL PROTECTED]] > >>>>>>>>Sent: Thursday, February 20, 2003 11:26 AM > >>>>>>>>To: Tomcat Users List > >>>>>>>>Subject: RE: Loading Singleton Classes > >>>>>>>> > >>>>>>>> > >>>>>>>>Hmmm > >>>>>>>> > >>>>&
Re: Loading Singleton Classes
If someone wanted to override the security of your class by subclassing your singleton (so the new subclass qualifies as being of your singleton's type) but with different, potentially malicious, logic inside. Probably not an issue if you are not exposing your code. Erik Felipe Schnack wrote: You could give me practical exemple of why I would do that? On Thu, 2003-02-20 at 17:49, Mike Jackson wrote: You could use final if you didn't want inherited versions to be able to have themselves be returned. --mikej -=- mike jackson [EMAIL PROTECTED] -Original Message- From: Felipe Schnack [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 12:44 PM To: Tomcat Users List Subject: Re: Loading Singleton Classes Or even public static final Singleton s = new Singleton(); :-) On Thu, 2003-02-20 at 17:43, Tim Funk wrote: Actually you'll want to make public static Singleton s = new Singleton(); be private static Singleton s = new Singleton(); So a wise guy doesn't do this: Singleton.s = null; -Tim Mike Jackson wrote: To code it correctly follow the pattern. :) Should look something like this: class Singleton { public static Singleton s = new Singleton(); protected Singleton() { super(); } public static Singleton getHandle() { return s; } } --mikej -=- mike jackson [EMAIL PROTECTED] -Original Message- From: Luc Foisy [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 11:35 AM To: Tomcat Users List Subject: RE: Loading Singleton Classes Ok. How do I code it incorrectly then? :) I want it to be unique to each session. Is there anyway I can do that? -Original Message- From: Mike Jackson [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 2:31 PM To: Tomcat Users List Subject: RE: Loading Singleton Classes Same, if you code it correctly. --mikej -=- mike jackson [EMAIL PROTECTED] -Original Message- From: Luc Foisy [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 11:26 AM To: Tomcat Users List Subject: RE: Loading Singleton Classes Hmmm My jar is located in web-inf/lib Perhaps I should rephrase that question. When I load the singleton class, will it be the same singleton called from all sessions or will it be unique to each session? -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 2:15 PM To: Tomcat Users List Subject: RE: Loading Singleton Classes it doesn't become a variable at all. but to answer your question, if you load a singleton class it all depends on where the class is in the classloader hierarchy. if you put the class in a jar in common/lib, the singleton will be for your entire tomcat server. if you put it in a jar in web-inf/lib it becomes a singleton class for your webapp only. Filip -Original Message- From: Luc Foisy [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 11:14 AM To: Tomcat User List (E-mail) Subject: Loading Singleton Classes If I load a singleton class, does it become a session variable or an application variable - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Felipe Schnack Analista de Sistemas [EMAIL PROTECTED] Cel.: (51)91287530 Linux Counter #281893 Centro Universitário Ritter dos Reis http://www.ritterdosreis.br [EMAIL PROTECTED] Fone/Fax.: (51)32303341 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] F
RE: Loading Singleton Classes
No, just saying that you might not want to limit yourself. --mikej -=- mike jackson [EMAIL PROTECTED] > -Original Message- > From: Felipe Schnack [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 20, 2003 12:50 PM > To: Tomcat Users List > Subject: RE: Loading Singleton Classes > > > You could give me practical exemple of why I would do that? > On Thu, 2003-02-20 at 17:49, Mike Jackson wrote: > > You could use final if you didn't want inherited versions to be > able to have > > themselves be returned. > > > > --mikej > > -=- > > mike jackson > > [EMAIL PROTECTED] > > > > > -Original Message- > > > From: Felipe Schnack [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, February 20, 2003 12:44 PM > > > To: Tomcat Users List > > > Subject: Re: Loading Singleton Classes > > > > > > > > > Or even > > > public static final Singleton s = new Singleton(); > > > :-) > > > > > > On Thu, 2003-02-20 at 17:43, Tim Funk wrote: > > > > Actually you'll want to make > > > >public static Singleton s = new Singleton(); > > > > be > > > >private static Singleton s = new Singleton(); > > > > > > > > So a wise guy doesn't do this: > > > > Singleton.s = null; > > > > > > > > -Tim > > > > > > > > Mike Jackson wrote: > > > > > To code it correctly follow the pattern. :) > > > > > > > > > > > > > > > Should look something like this: > > > > > > > > > > class Singleton { > > > > > public static Singleton s = new Singleton(); > > > > > > > > > > protected Singleton() { > > > > > super(); > > > > > } > > > > > public static Singleton getHandle() { > > > > > return s; > > > > > } > > > > > } > > > > > > > > > > --mikej > > > > > -=- > > > > > mike jackson > > > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > >>-Original Message- > > > > >>From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > > > >>Sent: Thursday, February 20, 2003 11:35 AM > > > > >>To: Tomcat Users List > > > > >>Subject: RE: Loading Singleton Classes > > > > >> > > > > >> > > > > >>Ok. How do I code it incorrectly then? :) > > > > >>I want it to be unique to each session. Is there anyway I > can do that? > > > > >> > > > > >> > > > > >>>-Original Message- > > > > >>>From: Mike Jackson [mailto:[EMAIL PROTECTED]] > > > > >>>Sent: Thursday, February 20, 2003 2:31 PM > > > > >>>To: Tomcat Users List > > > > >>>Subject: RE: Loading Singleton Classes > > > > >>> > > > > >>> > > > > >>>Same, if you code it correctly. > > > > >>> > > > > >>>--mikej > > > > >>>-=- > > > > >>>mike jackson > > > > >>>[EMAIL PROTECTED] > > > > >>> > > > > >>> > > > > >>>>-Original Message- > > > > >>>>From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > > > >>>>Sent: Thursday, February 20, 2003 11:26 AM > > > > >>>>To: Tomcat Users List > > > > >>>>Subject: RE: Loading Singleton Classes > > > > >>>> > > > > >>>> > > > > >>>>Hmmm > > > > >>>> > > > > >>>>My jar is located in web-inf/lib > > > > >>>> > > > > >>>>Perhaps I should rephrase that question. > > > > >>>>When I load the singleton class, will it be the same singleton > > > > >>>>called from all sessions or will it be unique to each session? > > > > >>>> > > > > >>>> > > > > >>>>>-Original Message- > > > > >>>>>From: Filip Hanik [mail
RE: Loading Singleton Classes
You could give me practical exemple of why I would do that? On Thu, 2003-02-20 at 17:49, Mike Jackson wrote: > You could use final if you didn't want inherited versions to be able to have > themselves be returned. > > --mikej > -=- > mike jackson > [EMAIL PROTECTED] > > > -Original Message- > > From: Felipe Schnack [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, February 20, 2003 12:44 PM > > To: Tomcat Users List > > Subject: Re: Loading Singleton Classes > > > > > > Or even > > public static final Singleton s = new Singleton(); > > :-) > > > > On Thu, 2003-02-20 at 17:43, Tim Funk wrote: > > > Actually you'll want to make > > >public static Singleton s = new Singleton(); > > > be > > >private static Singleton s = new Singleton(); > > > > > > So a wise guy doesn't do this: > > > Singleton.s = null; > > > > > > -Tim > > > > > > Mike Jackson wrote: > > > > To code it correctly follow the pattern. :) > > > > > > > > > > > > Should look something like this: > > > > > > > > class Singleton { > > > > public static Singleton s = new Singleton(); > > > > > > > > protected Singleton() { > > > > super(); > > > > } > > > > public static Singleton getHandle() { > > > > return s; > > > > } > > > > } > > > > > > > > --mikej > > > > -=- > > > > mike jackson > > > > [EMAIL PROTECTED] > > > > > > > > > > > >>-Original Message- > > > >>From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > > >>Sent: Thursday, February 20, 2003 11:35 AM > > > >>To: Tomcat Users List > > > >>Subject: RE: Loading Singleton Classes > > > >> > > > >> > > > >>Ok. How do I code it incorrectly then? :) > > > >>I want it to be unique to each session. Is there anyway I can do that? > > > >> > > > >> > > > >>>-Original Message- > > > >>>From: Mike Jackson [mailto:[EMAIL PROTECTED]] > > > >>>Sent: Thursday, February 20, 2003 2:31 PM > > > >>>To: Tomcat Users List > > > >>>Subject: RE: Loading Singleton Classes > > > >>> > > > >>> > > > >>>Same, if you code it correctly. > > > >>> > > > >>>--mikej > > > >>>-=- > > > >>>mike jackson > > > >>>[EMAIL PROTECTED] > > > >>> > > > >>> > > > >>>>-Original Message- > > > >>>>From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > > >>>>Sent: Thursday, February 20, 2003 11:26 AM > > > >>>>To: Tomcat Users List > > > >>>>Subject: RE: Loading Singleton Classes > > > >>>> > > > >>>> > > > >>>>Hmmm > > > >>>> > > > >>>>My jar is located in web-inf/lib > > > >>>> > > > >>>>Perhaps I should rephrase that question. > > > >>>>When I load the singleton class, will it be the same singleton > > > >>>>called from all sessions or will it be unique to each session? > > > >>>> > > > >>>> > > > >>>>>-Original Message- > > > >>>>>From: Filip Hanik [mailto:[EMAIL PROTECTED]] > > > >>>>>Sent: Thursday, February 20, 2003 2:15 PM > > > >>>>>To: Tomcat Users List > > > >>>>>Subject: RE: Loading Singleton Classes > > > >>>>> > > > >>>>> > > > >>>>>it doesn't become a variable at all. > > > >>>>> > > > >>>>>but to answer your question, if you load a singleton class it > > > >>>>>all depends on where the class is in the classloader hierarchy. > > > >>>>> > > > >>>>>if you put the class in a jar in common/l
RE: Loading Singleton Classes
You could use final if you didn't want inherited versions to be able to have themselves be returned. --mikej -=- mike jackson [EMAIL PROTECTED] > -Original Message- > From: Felipe Schnack [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 20, 2003 12:44 PM > To: Tomcat Users List > Subject: Re: Loading Singleton Classes > > > Or even > public static final Singleton s = new Singleton(); > :-) > > On Thu, 2003-02-20 at 17:43, Tim Funk wrote: > > Actually you'll want to make > >public static Singleton s = new Singleton(); > > be > >private static Singleton s = new Singleton(); > > > > So a wise guy doesn't do this: > > Singleton.s = null; > > > > -Tim > > > > Mike Jackson wrote: > > > To code it correctly follow the pattern. :) > > > > > > > > > Should look something like this: > > > > > > class Singleton { > > > public static Singleton s = new Singleton(); > > > > > > protected Singleton() { > > > super(); > > > } > > > public static Singleton getHandle() { > > > return s; > > > } > > > } > > > > > > --mikej > > > -=- > > > mike jackson > > > [EMAIL PROTECTED] > > > > > > > > >>-Original Message- > > >>From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > >>Sent: Thursday, February 20, 2003 11:35 AM > > >>To: Tomcat Users List > > >>Subject: RE: Loading Singleton Classes > > >> > > >> > > >>Ok. How do I code it incorrectly then? :) > > >>I want it to be unique to each session. Is there anyway I can do that? > > >> > > >> > > >>>-Original Message- > > >>>From: Mike Jackson [mailto:[EMAIL PROTECTED]] > > >>>Sent: Thursday, February 20, 2003 2:31 PM > > >>>To: Tomcat Users List > > >>>Subject: RE: Loading Singleton Classes > > >>> > > >>> > > >>>Same, if you code it correctly. > > >>> > > >>>--mikej > > >>>-=- > > >>>mike jackson > > >>>[EMAIL PROTECTED] > > >>> > > >>> > > >>>>-Original Message- > > >>>>From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > >>>>Sent: Thursday, February 20, 2003 11:26 AM > > >>>>To: Tomcat Users List > > >>>>Subject: RE: Loading Singleton Classes > > >>>> > > >>>> > > >>>>Hmmm > > >>>> > > >>>>My jar is located in web-inf/lib > > >>>> > > >>>>Perhaps I should rephrase that question. > > >>>>When I load the singleton class, will it be the same singleton > > >>>>called from all sessions or will it be unique to each session? > > >>>> > > >>>> > > >>>>>-Original Message- > > >>>>>From: Filip Hanik [mailto:[EMAIL PROTECTED]] > > >>>>>Sent: Thursday, February 20, 2003 2:15 PM > > >>>>>To: Tomcat Users List > > >>>>>Subject: RE: Loading Singleton Classes > > >>>>> > > >>>>> > > >>>>>it doesn't become a variable at all. > > >>>>> > > >>>>>but to answer your question, if you load a singleton class it > > >>>>>all depends on where the class is in the classloader hierarchy. > > >>>>> > > >>>>>if you put the class in a jar in common/lib, the singleton > > >>>>>will be for your entire tomcat server. if you put it in a jar > > >>>>>in web-inf/lib it becomes a singleton class for your webapp only. > > >>>>> > > >>>>>Filip > > >>>>> > > >>>>>-Original Message- > > >>>>>From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > >>>>>Sent: Thursday, February 20, 2003 11:14 AM > > >>>>>To: Tomcat User List (E-mail) > > >>>>>Subject: Loading Singleton Classes > > >>>>> > > >>>>> > > >>>>> > > >>>>>If I load a singleton class, does it become a s
RE: Loading Singleton Classes
Oops. Although I wouldn't implement it a private, I'd use protected, that way a class that inherits can override the class returned. --mikej -=- mike jackson [EMAIL PROTECTED] > -Original Message- > From: Tim Funk [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 20, 2003 12:43 PM > To: Tomcat Users List > Subject: Re: Loading Singleton Classes > > > Actually you'll want to make >public static Singleton s = new Singleton(); > be >private static Singleton s = new Singleton(); > > So a wise guy doesn't do this: > Singleton.s = null; > > -Tim > > Mike Jackson wrote: > > To code it correctly follow the pattern. :) > > > > > > Should look something like this: > > > > class Singleton { > > public static Singleton s = new Singleton(); > > > > protected Singleton() { > > super(); > > } > > public static Singleton getHandle() { > > return s; > > } > > } > > > > --mikej > > -=- > > mike jackson > > [EMAIL PROTECTED] > > > > > >>-Original Message- > >>From: Luc Foisy [mailto:[EMAIL PROTECTED]] > >>Sent: Thursday, February 20, 2003 11:35 AM > >>To: Tomcat Users List > >>Subject: RE: Loading Singleton Classes > >> > >> > >>Ok. How do I code it incorrectly then? :) > >>I want it to be unique to each session. Is there anyway I can do that? > >> > >> > >>>-Original Message- > >>>From: Mike Jackson [mailto:[EMAIL PROTECTED]] > >>>Sent: Thursday, February 20, 2003 2:31 PM > >>>To: Tomcat Users List > >>>Subject: RE: Loading Singleton Classes > >>> > >>> > >>>Same, if you code it correctly. > >>> > >>>--mikej > >>>-=- > >>>mike jackson > >>>[EMAIL PROTECTED] > >>> > >>> > >>>>-Original Message- > >>>>From: Luc Foisy [mailto:[EMAIL PROTECTED]] > >>>>Sent: Thursday, February 20, 2003 11:26 AM > >>>>To: Tomcat Users List > >>>>Subject: RE: Loading Singleton Classes > >>>> > >>>> > >>>>Hmmm > >>>> > >>>>My jar is located in web-inf/lib > >>>> > >>>>Perhaps I should rephrase that question. > >>>>When I load the singleton class, will it be the same singleton > >>>>called from all sessions or will it be unique to each session? > >>>> > >>>> > >>>>>-Original Message- > >>>>>From: Filip Hanik [mailto:[EMAIL PROTECTED]] > >>>>>Sent: Thursday, February 20, 2003 2:15 PM > >>>>>To: Tomcat Users List > >>>>>Subject: RE: Loading Singleton Classes > >>>>> > >>>>> > >>>>>it doesn't become a variable at all. > >>>>> > >>>>>but to answer your question, if you load a singleton class it > >>>>>all depends on where the class is in the classloader hierarchy. > >>>>> > >>>>>if you put the class in a jar in common/lib, the singleton > >>>>>will be for your entire tomcat server. if you put it in a jar > >>>>>in web-inf/lib it becomes a singleton class for your webapp only. > >>>>> > >>>>>Filip > >>>>> > >>>>>-Original Message- > >>>>>From: Luc Foisy [mailto:[EMAIL PROTECTED]] > >>>>>Sent: Thursday, February 20, 2003 11:14 AM > >>>>>To: Tomcat User List (E-mail) > >>>>>Subject: Loading Singleton Classes > >>>>> > >>>>> > >>>>> > >>>>>If I load a singleton class, does it become a session > >>>>>variable or an application variable > >>>>> > >>>>> > >>> > >>>- > >>> > >>>>>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>>>For additional commands, e-mail: > >>> > >>>[EMAIL PROTECTED] > >>> > >>>>> > >>>>> > >>>- > >>> > >>>>>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>>>For additional commands, e-mail: > >>> > >>>[EMAIL PROTECTED] > >>> > >>>>> > >>>> > >>>- > >>> > >>>>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>>For additional commands, e-mail: [EMAIL PROTECTED] > >>>> > >>> > >>> > >>>- > >>>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>For additional commands, e-mail: [EMAIL PROTECTED] > >>> > >>> > >> > >>- > >>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>For additional commands, e-mail: [EMAIL PROTECTED] > >> > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Loading Singleton Classes
Or even public static final Singleton s = new Singleton(); :-) On Thu, 2003-02-20 at 17:43, Tim Funk wrote: > Actually you'll want to make >public static Singleton s = new Singleton(); > be >private static Singleton s = new Singleton(); > > So a wise guy doesn't do this: > Singleton.s = null; > > -Tim > > Mike Jackson wrote: > > To code it correctly follow the pattern. :) > > > > > > Should look something like this: > > > > class Singleton { > > public static Singleton s = new Singleton(); > > > > protected Singleton() { > > super(); > > } > > public static Singleton getHandle() { > > return s; > > } > > } > > > > --mikej > > -=- > > mike jackson > > [EMAIL PROTECTED] > > > > > >>-Original Message- > >>From: Luc Foisy [mailto:[EMAIL PROTECTED]] > >>Sent: Thursday, February 20, 2003 11:35 AM > >>To: Tomcat Users List > >>Subject: RE: Loading Singleton Classes > >> > >> > >>Ok. How do I code it incorrectly then? :) > >>I want it to be unique to each session. Is there anyway I can do that? > >> > >> > >>>-Original Message- > >>>From: Mike Jackson [mailto:[EMAIL PROTECTED]] > >>>Sent: Thursday, February 20, 2003 2:31 PM > >>>To: Tomcat Users List > >>>Subject: RE: Loading Singleton Classes > >>> > >>> > >>>Same, if you code it correctly. > >>> > >>>--mikej > >>>-=- > >>>mike jackson > >>>[EMAIL PROTECTED] > >>> > >>> > >>>>-Original Message- > >>>>From: Luc Foisy [mailto:[EMAIL PROTECTED]] > >>>>Sent: Thursday, February 20, 2003 11:26 AM > >>>>To: Tomcat Users List > >>>>Subject: RE: Loading Singleton Classes > >>>> > >>>> > >>>>Hmmm > >>>> > >>>>My jar is located in web-inf/lib > >>>> > >>>>Perhaps I should rephrase that question. > >>>>When I load the singleton class, will it be the same singleton > >>>>called from all sessions or will it be unique to each session? > >>>> > >>>> > >>>>>-Original Message- > >>>>>From: Filip Hanik [mailto:[EMAIL PROTECTED]] > >>>>>Sent: Thursday, February 20, 2003 2:15 PM > >>>>>To: Tomcat Users List > >>>>>Subject: RE: Loading Singleton Classes > >>>>> > >>>>> > >>>>>it doesn't become a variable at all. > >>>>> > >>>>>but to answer your question, if you load a singleton class it > >>>>>all depends on where the class is in the classloader hierarchy. > >>>>> > >>>>>if you put the class in a jar in common/lib, the singleton > >>>>>will be for your entire tomcat server. if you put it in a jar > >>>>>in web-inf/lib it becomes a singleton class for your webapp only. > >>>>> > >>>>>Filip > >>>>> > >>>>>-Original Message- > >>>>>From: Luc Foisy [mailto:[EMAIL PROTECTED]] > >>>>>Sent: Thursday, February 20, 2003 11:14 AM > >>>>>To: Tomcat User List (E-mail) > >>>>>Subject: Loading Singleton Classes > >>>>> > >>>>> > >>>>> > >>>>>If I load a singleton class, does it become a session > >>>>>variable or an application variable > >>>>> > >>>>> > >>> > >>>- > >>> > >>>>>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>>>For additional commands, e-mail: > >>> > >>>[EMAIL PROTECTED] > >>> > >>>>> > >>>>> > >>>- > >>> > >>>>>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>>>For additional commands, e-mail: > >>> > >>>[EMAIL PROTECTED] > >>> > >>>>> > >>>> > >>>- > >>> > >>>>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>>For additional commands, e-mail: [EMAIL PROTECTED] > >>>> > >>> > >>> > >>>- > >>>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>For additional commands, e-mail: [EMAIL PROTECTED] > >>> > >>> > >> > >>- > >>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>For additional commands, e-mail: [EMAIL PROTECTED] > >> > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Felipe Schnack Analista de Sistemas [EMAIL PROTECTED] Cel.: (51)91287530 Linux Counter #281893 Centro Universitário Ritter dos Reis http://www.ritterdosreis.br [EMAIL PROTECTED] Fone/Fax.: (51)32303341 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Loading Singleton Classes
Then again if it's a singleton there's no need to put a reference to it in the session, that's just a needless use of memory. --mikej -=- mike jackson [EMAIL PROTECTED] > -Original Message- > From: Mike Jackson [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 20, 2003 12:41 PM > To: Tomcat Users List > Subject: RE: Loading Singleton Classes > > > What if he actually needs a singleton? That wouldn't help any. > > --mikej > -=- > mike jackson > [EMAIL PROTECTED] > > > -Original Message- > > From: Filip Hanik [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, February 20, 2003 11:37 AM > > To: Tomcat Users List > > Subject: RE: Loading Singleton Classes > > > > > > yes, don't make it a singleton :)) > > > > just give each session an individual object instead of a > singleton object. > > > > Filip > > > > -Original Message- > > From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, February 20, 2003 11:35 AM > > To: Tomcat Users List > > Subject: RE: Loading Singleton Classes > > > > > > Ok. How do I code it incorrectly then? :) > > I want it to be unique to each session. Is there anyway I can do that? > > > > > -Original Message- > > > From: Mike Jackson [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, February 20, 2003 2:31 PM > > > To: Tomcat Users List > > > Subject: RE: Loading Singleton Classes > > > > > > > > > Same, if you code it correctly. > > > > > > --mikej > > > -=- > > > mike jackson > > > [EMAIL PROTECTED] > > > > > > > -Original Message- > > > > From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > > > Sent: Thursday, February 20, 2003 11:26 AM > > > > To: Tomcat Users List > > > > Subject: RE: Loading Singleton Classes > > > > > > > > > > > > Hmmm > > > > > > > > My jar is located in web-inf/lib > > > > > > > > Perhaps I should rephrase that question. > > > > When I load the singleton class, will it be the same singleton > > > > called from all sessions or will it be unique to each session? > > > > > > > > > -Original Message- > > > > > From: Filip Hanik [mailto:[EMAIL PROTECTED]] > > > > > Sent: Thursday, February 20, 2003 2:15 PM > > > > > To: Tomcat Users List > > > > > Subject: RE: Loading Singleton Classes > > > > > > > > > > > > > > > it doesn't become a variable at all. > > > > > > > > > > but to answer your question, if you load a singleton class it > > > > > all depends on where the class is in the classloader hierarchy. > > > > > > > > > > if you put the class in a jar in common/lib, the singleton > > > > > will be for your entire tomcat server. if you put it in a jar > > > > > in web-inf/lib it becomes a singleton class for your webapp only. > > > > > > > > > > Filip > > > > > > > > > > -Original Message- > > > > > From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > > > > Sent: Thursday, February 20, 2003 11:14 AM > > > > > To: Tomcat User List (E-mail) > > > > > Subject: Loading Singleton Classes > > > > > > > > > > > > > > > > > > > > If I load a singleton class, does it become a session > > > > > variable or an application variable > > > > > > > > > > > > > - > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > For additional commands, e-mail: > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > - > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > > For additional commands, e-mail: > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > - > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Loading Singleton Classes
Actually you'll want to make public static Singleton s = new Singleton(); be private static Singleton s = new Singleton(); So a wise guy doesn't do this: Singleton.s = null; -Tim Mike Jackson wrote: To code it correctly follow the pattern. :) Should look something like this: class Singleton { public static Singleton s = new Singleton(); protected Singleton() { super(); } public static Singleton getHandle() { return s; } } --mikej -=- mike jackson [EMAIL PROTECTED] -Original Message- From: Luc Foisy [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 11:35 AM To: Tomcat Users List Subject: RE: Loading Singleton Classes Ok. How do I code it incorrectly then? :) I want it to be unique to each session. Is there anyway I can do that? -Original Message- From: Mike Jackson [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 2:31 PM To: Tomcat Users List Subject: RE: Loading Singleton Classes Same, if you code it correctly. --mikej -=- mike jackson [EMAIL PROTECTED] -Original Message- From: Luc Foisy [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 11:26 AM To: Tomcat Users List Subject: RE: Loading Singleton Classes Hmmm My jar is located in web-inf/lib Perhaps I should rephrase that question. When I load the singleton class, will it be the same singleton called from all sessions or will it be unique to each session? -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 2:15 PM To: Tomcat Users List Subject: RE: Loading Singleton Classes it doesn't become a variable at all. but to answer your question, if you load a singleton class it all depends on where the class is in the classloader hierarchy. if you put the class in a jar in common/lib, the singleton will be for your entire tomcat server. if you put it in a jar in web-inf/lib it becomes a singleton class for your webapp only. Filip -Original Message- From: Luc Foisy [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 11:14 AM To: Tomcat User List (E-mail) Subject: Loading Singleton Classes If I load a singleton class, does it become a session variable or an application variable - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Loading Singleton Classes
What if he actually needs a singleton? That wouldn't help any. --mikej -=- mike jackson [EMAIL PROTECTED] > -Original Message- > From: Filip Hanik [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 20, 2003 11:37 AM > To: Tomcat Users List > Subject: RE: Loading Singleton Classes > > > yes, don't make it a singleton :)) > > just give each session an individual object instead of a singleton object. > > Filip > > -Original Message- > From: Luc Foisy [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 20, 2003 11:35 AM > To: Tomcat Users List > Subject: RE: Loading Singleton Classes > > > Ok. How do I code it incorrectly then? :) > I want it to be unique to each session. Is there anyway I can do that? > > > -Original Message- > > From: Mike Jackson [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, February 20, 2003 2:31 PM > > To: Tomcat Users List > > Subject: RE: Loading Singleton Classes > > > > > > Same, if you code it correctly. > > > > --mikej > > -=- > > mike jackson > > [EMAIL PROTECTED] > > > > > -Original Message- > > > From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, February 20, 2003 11:26 AM > > > To: Tomcat Users List > > > Subject: RE: Loading Singleton Classes > > > > > > > > > Hmmm > > > > > > My jar is located in web-inf/lib > > > > > > Perhaps I should rephrase that question. > > > When I load the singleton class, will it be the same singleton > > > called from all sessions or will it be unique to each session? > > > > > > > -Original Message- > > > > From: Filip Hanik [mailto:[EMAIL PROTECTED]] > > > > Sent: Thursday, February 20, 2003 2:15 PM > > > > To: Tomcat Users List > > > > Subject: RE: Loading Singleton Classes > > > > > > > > > > > > it doesn't become a variable at all. > > > > > > > > but to answer your question, if you load a singleton class it > > > > all depends on where the class is in the classloader hierarchy. > > > > > > > > if you put the class in a jar in common/lib, the singleton > > > > will be for your entire tomcat server. if you put it in a jar > > > > in web-inf/lib it becomes a singleton class for your webapp only. > > > > > > > > Filip > > > > > > > > -Original Message- > > > > From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > > > Sent: Thursday, February 20, 2003 11:14 AM > > > > To: Tomcat User List (E-mail) > > > > Subject: Loading Singleton Classes > > > > > > > > > > > > > > > > If I load a singleton class, does it become a session > > > > variable or an application variable > > > > > > > > > > - > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > > > > > > - > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Loading Singleton Classes
To code it correctly follow the pattern. :) Should look something like this: class Singleton { public static Singleton s = new Singleton(); protected Singleton() { super(); } public static Singleton getHandle() { return s; } } --mikej -=- mike jackson [EMAIL PROTECTED] > -Original Message- > From: Luc Foisy [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 20, 2003 11:35 AM > To: Tomcat Users List > Subject: RE: Loading Singleton Classes > > > Ok. How do I code it incorrectly then? :) > I want it to be unique to each session. Is there anyway I can do that? > > > -Original Message- > > From: Mike Jackson [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, February 20, 2003 2:31 PM > > To: Tomcat Users List > > Subject: RE: Loading Singleton Classes > > > > > > Same, if you code it correctly. > > > > --mikej > > -=- > > mike jackson > > [EMAIL PROTECTED] > > > > > -Original Message- > > > From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, February 20, 2003 11:26 AM > > > To: Tomcat Users List > > > Subject: RE: Loading Singleton Classes > > > > > > > > > Hmmm > > > > > > My jar is located in web-inf/lib > > > > > > Perhaps I should rephrase that question. > > > When I load the singleton class, will it be the same singleton > > > called from all sessions or will it be unique to each session? > > > > > > > -Original Message- > > > > From: Filip Hanik [mailto:[EMAIL PROTECTED]] > > > > Sent: Thursday, February 20, 2003 2:15 PM > > > > To: Tomcat Users List > > > > Subject: RE: Loading Singleton Classes > > > > > > > > > > > > it doesn't become a variable at all. > > > > > > > > but to answer your question, if you load a singleton class it > > > > all depends on where the class is in the classloader hierarchy. > > > > > > > > if you put the class in a jar in common/lib, the singleton > > > > will be for your entire tomcat server. if you put it in a jar > > > > in web-inf/lib it becomes a singleton class for your webapp only. > > > > > > > > Filip > > > > > > > > -Original Message- > > > > From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > > > Sent: Thursday, February 20, 2003 11:14 AM > > > > To: Tomcat User List (E-mail) > > > > Subject: Loading Singleton Classes > > > > > > > > > > > > > > > > If I load a singleton class, does it become a session > > > > variable or an application variable > > > > > > > > > > - > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > > > > > > - > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Loading Singleton Classes
yes, don't make it a singleton :)) just give each session an individual object instead of a singleton object. Filip -Original Message- From: Luc Foisy [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 11:35 AM To: Tomcat Users List Subject: RE: Loading Singleton Classes Ok. How do I code it incorrectly then? :) I want it to be unique to each session. Is there anyway I can do that? > -Original Message- > From: Mike Jackson [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 20, 2003 2:31 PM > To: Tomcat Users List > Subject: RE: Loading Singleton Classes > > > Same, if you code it correctly. > > --mikej > -=- > mike jackson > [EMAIL PROTECTED] > > > -Original Message- > > From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, February 20, 2003 11:26 AM > > To: Tomcat Users List > > Subject: RE: Loading Singleton Classes > > > > > > Hmmm > > > > My jar is located in web-inf/lib > > > > Perhaps I should rephrase that question. > > When I load the singleton class, will it be the same singleton > > called from all sessions or will it be unique to each session? > > > > > -Original Message----- > > > From: Filip Hanik [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, February 20, 2003 2:15 PM > > > To: Tomcat Users List > > > Subject: RE: Loading Singleton Classes > > > > > > > > > it doesn't become a variable at all. > > > > > > but to answer your question, if you load a singleton class it > > > all depends on where the class is in the classloader hierarchy. > > > > > > if you put the class in a jar in common/lib, the singleton > > > will be for your entire tomcat server. if you put it in a jar > > > in web-inf/lib it becomes a singleton class for your webapp only. > > > > > > Filip > > > > > > -Original Message- > > > From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, February 20, 2003 11:14 AM > > > To: Tomcat User List (E-mail) > > > Subject: Loading Singleton Classes > > > > > > > > > > > > If I load a singleton class, does it become a session > > > variable or an application variable > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Loading Singleton Classes
Ok. How do I code it incorrectly then? :) I want it to be unique to each session. Is there anyway I can do that? > -Original Message- > From: Mike Jackson [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 20, 2003 2:31 PM > To: Tomcat Users List > Subject: RE: Loading Singleton Classes > > > Same, if you code it correctly. > > --mikej > -=- > mike jackson > [EMAIL PROTECTED] > > > -Original Message- > > From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, February 20, 2003 11:26 AM > > To: Tomcat Users List > > Subject: RE: Loading Singleton Classes > > > > > > Hmmm > > > > My jar is located in web-inf/lib > > > > Perhaps I should rephrase that question. > > When I load the singleton class, will it be the same singleton > > called from all sessions or will it be unique to each session? > > > > > -Original Message- > > > From: Filip Hanik [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, February 20, 2003 2:15 PM > > > To: Tomcat Users List > > > Subject: RE: Loading Singleton Classes > > > > > > > > > it doesn't become a variable at all. > > > > > > but to answer your question, if you load a singleton class it > > > all depends on where the class is in the classloader hierarchy. > > > > > > if you put the class in a jar in common/lib, the singleton > > > will be for your entire tomcat server. if you put it in a jar > > > in web-inf/lib it becomes a singleton class for your webapp only. > > > > > > Filip > > > > > > -Original Message- > > > From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, February 20, 2003 11:14 AM > > > To: Tomcat User List (E-mail) > > > Subject: Loading Singleton Classes > > > > > > > > > > > > If I load a singleton class, does it become a session > > > variable or an application variable > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Loading Singleton Classes
Same, if you code it correctly. --mikej -=- mike jackson [EMAIL PROTECTED] > -Original Message- > From: Luc Foisy [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 20, 2003 11:26 AM > To: Tomcat Users List > Subject: RE: Loading Singleton Classes > > > Hmmm > > My jar is located in web-inf/lib > > Perhaps I should rephrase that question. > When I load the singleton class, will it be the same singleton > called from all sessions or will it be unique to each session? > > > -Original Message- > > From: Filip Hanik [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, February 20, 2003 2:15 PM > > To: Tomcat Users List > > Subject: RE: Loading Singleton Classes > > > > > > it doesn't become a variable at all. > > > > but to answer your question, if you load a singleton class it > > all depends on where the class is in the classloader hierarchy. > > > > if you put the class in a jar in common/lib, the singleton > > will be for your entire tomcat server. if you put it in a jar > > in web-inf/lib it becomes a singleton class for your webapp only. > > > > Filip > > > > -Original Message- > > From: Luc Foisy [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, February 20, 2003 11:14 AM > > To: Tomcat User List (E-mail) > > Subject: Loading Singleton Classes > > > > > > > > If I load a singleton class, does it become a session > > variable or an application variable > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Loading Singleton Classes
Hmmm My jar is located in web-inf/lib Perhaps I should rephrase that question. When I load the singleton class, will it be the same singleton called from all sessions or will it be unique to each session? > -Original Message- > From: Filip Hanik [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 20, 2003 2:15 PM > To: Tomcat Users List > Subject: RE: Loading Singleton Classes > > > it doesn't become a variable at all. > > but to answer your question, if you load a singleton class it > all depends on where the class is in the classloader hierarchy. > > if you put the class in a jar in common/lib, the singleton > will be for your entire tomcat server. if you put it in a jar > in web-inf/lib it becomes a singleton class for your webapp only. > > Filip > > -Original Message- > From: Luc Foisy [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 20, 2003 11:14 AM > To: Tomcat User List (E-mail) > Subject: Loading Singleton Classes > > > > If I load a singleton class, does it become a session > variable or an application variable > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Loading Singleton Classes
it doesn't become a variable at all. but to answer your question, if you load a singleton class it all depends on where the class is in the classloader hierarchy. if you put the class in a jar in common/lib, the singleton will be for your entire tomcat server. if you put it in a jar in web-inf/lib it becomes a singleton class for your webapp only. Filip -Original Message- From: Luc Foisy [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 20, 2003 11:14 AM To: Tomcat User List (E-mail) Subject: Loading Singleton Classes If I load a singleton class, does it become a session variable or an application variable - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]