Re: can java tell which environment it is running in?

Nic Ferrier <[email protected]> Wed, 19 Jan 2005 22:18:02 +0000
Newsgroups gmane.comp.java.advanced-servlets
Message-ID <[email protected]>
luca <[email protected]> writes:

> Nic Ferrier wrote:
>
>> 
>> Stack Traces would be the only way unless you provide some application
>> logic for it.
>
> not sure what you mean here.
>
>> For example, use a Java property or a singleton to establish what the
>> current environment is.
>
> it is very interesting that you say this, because the problem that
> I am trying to work around is about singletones.
> I have one holy singleton that I would like to see alive
> throughtout the life of my web application, but it gets
> garbage collected anyway :(

Maybe you should keep a reference to it in a servlet (or even better,
in a context lifecycle listener). Then it wouldn't get GC'ed.


-- 
Nic Ferrier
http://www.tapsellferrier.co.uk


Before posting a question, try to find your answer here: 
<http://www.egroups.com/links/advanced-servlets>
Announcements should go to: [email protected]
To Post a message, send it to: [email protected]
To Unsubscribe, send a blank message to: [email protected] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/advanced-servlets/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/