Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: Aspect questions? Date: Sun, 26 Feb 2012 16:04:20 -0800 Organization: A noiseless patient Spider Lines: 26 Message-ID: References: <4f4ac1ea$0$291$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Mon, 27 Feb 2012 00:04:24 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="15541"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+bG75ZJx625XvwwuLm3GSKU7w6eYOcY9s=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 In-Reply-To: <4f4ac1ea$0$291$14726298@news.sunsite.dk> Cancel-Lock: sha1:1hrdXHyZDS5wLKHCHMbiq9ntFKU= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:12397 On 2/26/2012 3:36 PM, Arne Vajhøj wrote: > On 2/26/2012 1:10 PM, markspace wrote: >> >> >> This section points out that it's more efficient to use "static" for the >> logger. In desktop apps, that's what I'm used to seeing. However it also >> says that "static" interacts poorly with JEE classloaders, so using >> instance variables is the norm in JEE (and w/ Tomcat too). > What does "interacts poorly with JEE classloaders" mean?? Did anybody read the link? "Note that for application code, declaring the log member as "static" is more efficient as one Log object is created per class, and is recommended. However this is not safe to do for a class which may be deployed via a "shared" classloader in a servlet or j2ee container or similar environment. If the class may end up invoked with different thread-context-classloader values set then the member must not be declared static. The use of "static" should therefore be avoided in code within any "library" type project. "