On Thu, 2007-08-16 at 09:12 -0500, David M. Lloyd wrote:
On Thu, 16 Aug 2007 14:51:44 +0200
Adrian <abrock(a)redhat.com> wrote:
>
http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/microcontaine...
> 41 : private Logger log;
Bleah - loggers really ought to be static. Creating a zillion loggers caused
significant performance problems in vfs one time already.
There are only 5 structure deployers and each is a singleton.
You're correct that it is wrong to have a non-static logger
for things that are not singletons.
I remember when org.jboss.tm.TransactionImpl had a non-static
logger, because I fixed it. ;-)
If you *really* want the logger to map to the instantiating class,
just make
the logger field protected, and have the subclass constructor assign their
(static) logger to the protected field. Or something.
It's the same number of loggers and your solution is both
more complicated and introduces an implementation/debug detail into
an integration api where it does NOT belong.
i.e. A StructureDeployer does not have to extend
AbstractStructureDeployer, but we still want the trace
in the wrapper to show what is going on
because we can't trust the user written structure
to do any reasonable logging.
Alos, we don't want to see
[StructureDeployerWrapper] - unregonised x.jar
5 times!
Finally, you can't simply enable TRACE for
org.jboss.deployment.EARStructure
and see the useful StructureDeployerWrapper logging
if it is static.
- DML
--
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Adrian Brock
Chief Scientist
JBoss, a division of Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx