We don't want to put the contributors in the javadoc section? -Mark
> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, November 22, 2002 3:03 AM > To: [EMAIL PROTECTED] > Subject: cvs commit: jakarta-log4j/src/java/org/apache/log4j/spi > LoggerEventListener.java LoggerRepository.java > > > ceki 2002/11/22 03:03:29 > > Modified: src/java/org/apache/log4j Category.java Hierarchy.java > src/java/org/apache/log4j/helpers OptionConverter.java > src/java/org/apache/log4j/jmx HierarchyDynamicMBean.java > src/java/org/apache/log4j/spi LoggerEventListener.java > LoggerRepository.java > Log: > - I removed HierarchyEventListener since it has been replaced with > LoggerEventListener. I also cleaned up dependent code in o.a.l.jmx > package. > > - Removed the allAppendersRemovedEvent from the LoggerEventListener > interface because from the listener's point of view it is simpler to > consider the removal of *all* appenders as a succession of single > appender removes. Moreover, since the number of appenders attached to > any given logger is usually small, the potential performance gains in > doing wholesale treatment is low. > > - Added Mark Womack as author in Hierarchy.java and > LoggerRepository.java. In Hierarchy.java, moved the list of > contributors out of the javadocs back to the top of the file. > > - Made a number of indentation changes, using the pattern: > > public > static > void foo() {... > > changed to > > public static void foo() {... > > Revision Changes Path > 1.71 +1 -1 > jakarta-log4j/src/java/org/apache/log4j/Category.java > > Index: Category.java > =================================================================== > RCS file: > /home/cvs/jakarta-log4j/src/java/org/apache/log4j/Category.java,v > retrieving revision 1.70 > retrieving revision 1.71 > diff -u -r1.70 -r1.71 > --- Category.java 22 Nov 2002 10:27:23 -0000 1.70 > +++ Category.java 22 Nov 2002 11:03:28 -0000 1.71 > @@ -143,7 +143,7 @@ > aai = new AppenderAttachableImpl(); > } > aai.addAppender(newAppender); > - repository.fireAddAppenderEvent(this, newAppender); > + repository.fireAddAppenderEvent((Logger)this, newAppender); > } > > /** > > > > 1.43 +24 -124 > jakarta-log4j/src/java/org/apache/log4j/Hierarchy.java > > Index: Hierarchy.java > =================================================================== > RCS file: > /home/cvs/jakarta-log4j/src/java/org/apache/log4j/Hierarchy.java,v > retrieving revision 1.42 > retrieving revision 1.43 > diff -u -r1.42 -r1.43 > --- Hierarchy.java 22 Nov 2002 10:27:23 -0000 1.42 > +++ Hierarchy.java 22 Nov 2002 11:03:28 -0000 1.43 > @@ -27,6 +27,11 @@ > import org.apache.log4j.or.ObjectRenderer; > import org.apache.log4j.helpers.LogLog; > > +// Contributors: Luke Blanshard <[EMAIL PROTECTED]> > +// Mario Schomburg - IBM Global Services/Germany > +// Anders Kristensen > +// Igor Poteryaev > + > /** > This class is specialized in retrieving loggers by name and also > maintaining the logger hierarchy. > @@ -45,19 +50,13 @@ > to the provision node. Other descendants of the same ancestor add > themselves to the previously created provision node. > > - Contributors: > - Luke Blanshard <[EMAIL PROTECTED]> > - Mario Schomburg - IBM Global Services/Germany > - Anders Kristensen > - Igor Poteryaev > - > @author Ceki Gülcü > + @author Mark Womack > > */ > public class Hierarchy implements LoggerRepository, RendererSupport { > > private LoggerFactory defaultFactory; > - private Vector listeners; > private Vector repositoryEventListeners; > private Vector loggerEventListeners; > > @@ -80,7 +79,6 @@ > public > Hierarchy(Logger root) { > ht = new Hashtable(); > - listeners = new Vector(1); > repositoryEventListeners = new Vector(1); > loggerEventListeners = new Vector(1); > this.root = root; > @@ -94,24 +92,11 @@ > /** > Add an object renderer for a specific class. > */ > - public > - void addRenderer(Class classToRender, ObjectRenderer or) { > + public void addRenderer(Class classToRender, ObjectRenderer or) { > rendererMap.put(classToRender, or); > } > > /** > - @deprecated As of v1.3, use {@link > #addLoggerRepositoryEventListener} > - and {@link #addLoggerEventListener} methods instead. */ > - public > - void addHierarchyEventListener(HierarchyEventListener listener) { > - if(listeners.contains(listener)) { > - LogLog.warn("Ignoring attempt to add an existent listener."); > - } else { > - listeners.addElement(listener); > - } > - } > - > - /** > Add a {@link LoggerRepositoryEventListener} to the repository. The > listener will be called when repository events occur. > @since 1.3*/ > @@ -175,14 +160,12 @@ > invoking this method. > > @since 0.9.0 */ > - public > - void clear() { > + public void clear() { > //System.out.println("\n\nAbout to clear internal hash table."); > ht.clear(); > } > > - public > - void emitNoAppenderWarning(Category cat) { > + public void emitNoAppenderWarning(Category cat) { > // No appenders in hierarchy, warn user only once. > if(!this.emittedNoAppenderWarning) { > LogLog.warn("No appenders could be found for logger (" + > @@ -197,10 +180,8 @@ > its reference, otherwise returns <code>null</code>. > > @param name The name of the logger to search for. > - > */ > - public > - Logger exists(String name) { > + public Logger exists(String name) { > Object o = ht.get(new CategoryKey(name)); > if(o instanceof Logger) { > return (Logger) o; > @@ -212,8 +193,7 @@ > /** > The string form of {@link #setThreshold(Level)}. > */ > - public > - void setThreshold(String levelStr) { > + public void setThreshold(String levelStr) { > Level l = Level.toLevel(levelStr, null); > if(l != null) { > setThreshold(l); > @@ -229,8 +209,7 @@ > > @param l The minimum level for which logging requests are sent to > their appenders. */ > - public > - void setThreshold(Level l) { > + public void setThreshold(Level l) { > if(l != null) { > thresholdInt = l.level; > threshold = l; > @@ -238,31 +217,12 @@ > } > > /** > - @deprecated As of 1.3 use fireAddAppenderEvent(Logger,Appender) > - instead. */ > - public void fireAddAppenderEvent(Category logger, Appender > appender) { > - fireAddAppenderEvent((Logger)logger, appender); > - } > - > - /** > Requests that a appender added event be sent to any registered > {@link LoggerEventListener}. > @param logger The logger to which the appender was added. > @param appender The appender added to the logger. > @since 1.3*/ > public void fireAddAppenderEvent(Logger logger, Appender appender) { > - > - // when deprecated fireAddAppenderEvent(Category,Appender) > is removed, > - // so should this block > - if(listeners != null) { > - int size = listeners.size(); > - HierarchyEventListener listener; > - for(int i = 0; i < size; i++) { > - listener = (HierarchyEventListener)listeners.elementAt(i); > - listener.addAppenderEvent(logger, appender); > - } > - } > - > if(loggerEventListeners != null) { > int size = loggerEventListeners.size(); > LoggerEventListener listener; > @@ -280,15 +240,6 @@ > @param appender The appender removed from the logger. > @since 1.3*/ > public void fireRemoveAppenderEvent(Logger logger, Appender > appender) { > - if(listeners != null) { > - int size = listeners.size(); > - HierarchyEventListener listener; > - for(int i = 0; i < size; i++) { > - listener = (HierarchyEventListener)listeners.elementAt(i); > - listener.removeAppenderEvent(logger, appender); > - } > - } > - > if(loggerEventListeners != null) { > int size = loggerEventListeners.size(); > LoggerEventListener listener; > @@ -300,22 +251,6 @@ > } > > /** > - Requests that an all appenders removed event be sent to > any registered > - {@link LoggerEventListener}. > - @param logger The logger from which all appenders were removed. > - @since 1.3*/ > - public void fireRemoveAllAppendersEvent(Logger logger) { > - if(loggerEventListeners != null) { > - int size = loggerEventListeners.size(); > - LoggerEventListener listener; > - for(int i = 0; i < size; i++) { > - listener = > (LoggerEventListener)loggerEventListeners.elementAt(i); > - listener.allAppendersRemovedEvent(logger); > - } > - } > - } > - > - /** > Requests that a level changed event be sent to any registered > {@link LoggerEventListener}. > @param logger The logger which changed levels. > @@ -352,8 +287,7 @@ > state. > > @since 1.2 */ > - public > - Level getThreshold() { > + public Level getThreshold() { > return threshold; > } > > @@ -379,8 +313,7 @@ > @param name The name of the logger to retrieve. > > */ > - public > - Logger getLogger(String name) { > + public Logger getLogger(String name) { > return getLogger(name, defaultFactory); > } > > @@ -397,8 +330,7 @@ > @param factory The factory that will make the new logger instance. > > */ > - public > - Logger getLogger(String name, LoggerFactory factory) { > + public Logger getLogger(String name, LoggerFactory factory) { > //System.out.println("getInstance("+name+") called."); > CategoryKey key = new CategoryKey(name); > // Synchronize to prevent write conflicts. Read conflicts (in > @@ -438,8 +370,7 @@ > > <p>The root logger is <em>not</em> included in the returned > {@link Enumeration}. */ > - public > - Enumeration getCurrentLoggers() { > + public Enumeration getCurrentLoggers() { > // The accumlation in v is necessary because not all elements in > // ht are Logger objects as there might be some ProvisionNodes > // as well. > @@ -458,8 +389,7 @@ > /** > @deprecated Please use {@link #getCurrentLoggers} instead. > */ > - public > - Enumeration getCurrentCategories() { > + public Enumeration getCurrentCategories() { > return getCurrentLoggers(); > } > > @@ -467,8 +397,7 @@ > /** > Get the renderer map for this hierarchy. > */ > - public > - RendererMap getRendererMap() { > + public RendererMap getRendererMap() { > return rendererMap; > } > > @@ -478,8 +407,7 @@ > > @since 0.9.0 > */ > - public > - Logger getRootLogger() { > + public Logger getRootLogger() { > return root; > } > > @@ -488,20 +416,11 @@ > disabled for <code>level</code> object passed as parameter and > <code>false</code> otherwise. See also the {@link > #setThreshold(Level) threshold} emthod. */ > - public > - boolean isDisabled(int level) { > + public boolean isDisabled(int level) { > return thresholdInt > level; > } > > /** > - @deprecated Deprecated with no replacement. > - */ > - public > - void overrideAsNeeded(String override) { > - LogLog.warn("The Hiearchy.overrideAsNeeded method has been > deprecated."); > - } > - > - /** > Reset all values contained in this hierarchy instance to their > default. This removes all appenders from all categories, sets > the level of all non-root categories to <code>null</code>, > @@ -515,8 +434,7 @@ > block all logging until it is completed.</p> > > @since 0.8.5 */ > - public > - void resetConfiguration() { > + public void resetConfiguration() { > > getRootLogger().setLevel(Level.DEBUG); > root.setResourceBundle(null); > @@ -550,26 +468,12 @@ > } > > /** > - Does nothing. > - > - @deprecated Deprecated with no replacement. > - */ > - public > - void setDisableOverride(String override) { > - LogLog.warn("The Hiearchy.setDisableOverride method has > been deprecated."); > - } > - > - > - > - /** > Used by subclasses to add a renderer to the hierarchy > passed as parameter. > */ > - public > - void setRenderer(Class renderedClass, ObjectRenderer renderer) { > + public void setRenderer(Class renderedClass, ObjectRenderer > renderer) { > rendererMap.put(renderedClass, renderer); > } > > - > /** > Shutting down a hierarchy will <em>safely</em> close and remove > all appenders in all categories including the root logger. > @@ -647,9 +551,7 @@ > > We add 'cat' to the list of children for this potential parent. > */ > - final > - private > - void updateParents(Logger cat) { > + final private void updateParents(Logger cat) { > String name = cat.name; > int length = name.length(); > boolean parentFound = false; > @@ -702,9 +604,7 @@ > c's parent field to cat. > > */ > - final > - private > - void updateChildren(ProvisionNode pn, Logger logger) { > + final private void updateChildren(ProvisionNode pn, Logger logger) { > //System.out.println("updateChildren called for " + logger.name); > final int last = pn.size(); > > > > > 1.38 +2 -6 > jakarta-log4j/src/java/org/apache/log4j/helpers/OptionConverter.java > > Index: OptionConverter.java > =================================================================== > RCS file: > /home/cvs/jakarta-log4j/src/java/org/apache/log4j/helpers/OptionCo > nverter.java,v > retrieving revision 1.37 > retrieving revision 1.38 > diff -u -r1.37 -r1.38 > --- OptionConverter.java 9 Oct 2002 22:50:03 -0000 1.37 > +++ OptionConverter.java 22 Nov 2002 11:03:29 -0000 1.38 > @@ -120,9 +120,7 @@ > returned. > > <p>Case of value is unimportant. */ > - public > - static > - boolean toBoolean(String value, boolean dEfault) { > + public static boolean toBoolean(String value, boolean dEfault) { > if(value == null) > return dEfault; > String trimmedVal = value.trim(); > @@ -169,9 +167,7 @@ > significant for the class name part, if present. > > @since 1.1 */ > - public > - static > - Level toLevel(String value, Level defaultValue) { > + public static Level toLevel(String value, Level defaultValue) { > if(value == null) > return defaultValue; > > > > > 1.7 +11 -8 > jakarta-log4j/src/java/org/apache/log4j/jmx/HierarchyDynamicMBean.java > > Index: HierarchyDynamicMBean.java > =================================================================== > RCS file: > /home/cvs/jakarta-log4j/src/java/org/apache/log4j/jmx/HierarchyDyn > amicMBean.java,v > retrieving revision 1.6 > retrieving revision 1.7 > diff -u -r1.6 -r1.7 > --- HierarchyDynamicMBean.java 22 Oct 2002 21:19:39 -0000 1.6 > +++ HierarchyDynamicMBean.java 22 Nov 2002 11:03:29 -0000 1.7 > @@ -11,7 +11,7 @@ > import java.lang.reflect.Constructor; > import org.apache.log4j.*; > > -import org.apache.log4j.spi.HierarchyEventListener; > +import org.apache.log4j.spi.LoggerEventListener; > import org.apache.log4j.spi.LoggerRepository; > import org.apache.log4j.helpers.OptionConverter; > > @@ -40,7 +40,7 @@ > import javax.management.ListenerNotFoundException; > > public class HierarchyDynamicMBean extends AbstractDynamicMBean > - implements HierarchyEventListener, > + implements LoggerEventListener, > NotificationBroadcaster { > > static final String ADD_APPENDER = "addAppender."; > @@ -227,8 +227,7 @@ > } > > > - public > - void addAppenderEvent(Category logger, Appender appender) { > + public void appenderAddedEvent(Logger logger, Appender appender) { > log.debug("addAppenderEvent called: logger="+logger.getName()+ > ", appender="+appender.getName()); > Notification n = new > Notification(ADD_APPENDER+logger.getName(), this, 0); > @@ -237,16 +236,20 @@ > nbs.sendNotification(n); > } > > - public > - void removeAppenderEvent(Category cat, Appender appender) { > - log.debug("removeAppenderCalled: logger="+cat.getName()+ > + public void appenderRemovedEvent(Logger logger, Appender appender) { > + log.debug("removeAppenderCalled: logger="+logger.getName()+ > ", appender="+appender.getName()); > } > > + public void levelChangedEvent(Logger logger) { > + // FIX ME > + // FIX ME > + } > + > public > void postRegister(java.lang.Boolean registrationDone) { > log.debug("postRegister is called."); > - hierarchy.addHierarchyEventListener(this); > + hierarchy.addLoggerEventListener(this); > Logger root = hierarchy.getRootLogger(); > addLoggerMBean(root); > } > > > > 1.2 +1 -7 > jakarta-log4j/src/java/org/apache/log4j/spi/LoggerEventListener.java > > Index: LoggerEventListener.java > =================================================================== > RCS file: > /home/cvs/jakarta-log4j/src/java/org/apache/log4j/spi/LoggerEventL > istener.java,v > retrieving revision 1.1 > retrieving revision 1.2 > diff -u -r1.1 -r1.2 > --- LoggerEventListener.java 13 Nov 2002 05:52:39 -0000 1.1 > +++ LoggerEventListener.java 22 Nov 2002 11:03:29 -0000 1.2 > @@ -43,14 +43,8 @@ > public void appenderRemovedEvent(Logger logger, Appender appender); > > /** > - Called when all appenders are removed from the logger. > - > - @param logger The logger from which the appenders were removed. */ > - public void allAppendersRemovedEvent(Logger logger); > - > - /** > Called when level changed on the logger. > > @param logger The logger that changed levels. */ > public void levelChangedEvent(Logger logger); > -} > \ No newline at end of file > +} > > > > 1.11 +3 -21 > jakarta-log4j/src/java/org/apache/log4j/spi/LoggerRepository.java > > Index: LoggerRepository.java > =================================================================== > RCS file: > /home/cvs/jakarta-log4j/src/java/org/apache/log4j/spi/LoggerReposi > tory.java,v > retrieving revision 1.10 > retrieving revision 1.11 > diff -u -r1.10 -r1.11 > --- LoggerRepository.java 22 Nov 2002 04:49:13 -0000 1.10 > +++ LoggerRepository.java 22 Nov 2002 11:03:29 -0000 1.11 > @@ -21,17 +21,11 @@ > can act as a point of registry for events related to loggers. > > @author Ceki Gülcü > + @author Mark Womack > @since 1.2 */ > public interface LoggerRepository { > > /** > - Add a {@link HierarchyEventListener} event to the repository. > - @deprecated As of v1.3, use {@link > #addLoggerRepositoryEventListener} > - and {@link addLoggerEventListener} methods instead. > - */ > - public void addHierarchyEventListener(HierarchyEventListener > listener); > - > - /** > Add a {@link LoggerRepositoryEventListener} to the repository. The > listener will be called when repository events occur. > @since 1.3*/ > @@ -98,18 +92,13 @@ > public abstract void resetConfiguration(); > > /** > - @deprecated As of 1.3, please use > fireAddAppenderEvent(Logger,Appender).*/ > - public abstract void fireAddAppenderEvent(Category logger, > - Appender appender); > - > - /** > Requests that a appender added event be sent to any registered > {@link LoggerEventListener}. > @param logger The logger to which the appender was added. > @param appender The appender added to the logger. > @since 1.3*/ > public abstract void fireAddAppenderEvent(Logger logger, > - Appender appender); > + Appender appender); > > /** > Requests that a appender removed event be sent to any registered > @@ -118,14 +107,7 @@ > @param appender The appender removed from the logger. > @since 1.3*/ > public abstract void fireRemoveAppenderEvent(Logger logger, > - Appender appender); > - > - /** > - Requests that an all appenders removed event be sent to > any registered > - {@link LoggerEventListener}. > - @param logger The logger from which all appenders were removed. > - @since 1.3*/ > - public abstract void fireRemoveAllAppendersEvent(Logger logger); > + Appender appender); > > /** > Requests that a level changed event be sent to any registered > > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>