r500768 | eross | 2007-01-28 04:05:11 -0600 (Sun, 28 Jan 2007) | 2 lines

Bug 26435 - Add repository parameter in Hierarchy constructor
the other issues in the bug were addressed already or cannot fix


Index: src/java/org/apache/log4j/jmx/HierarchyDynamicMBean.java
===================================================================
63c63
< private MBeanConstructorInfo[] dConstructors = new MBeanConstructorInfo[1];
---
> private MBeanConstructorInfo[] dConstructors = new MBeanConstructorInfo[2];
72c72
<   private LoggerRepository hierarchy;
---
>   private LoggerRepository repository;
73a74,76
>   /**
>    * Construct with a default repository.
>    */
75c78,88
<     hierarchy = LogManager.getLoggerRepository();
---
>     this(LogManager.getLoggerRepository());
>   }
>
>   /**
>    * Construct with a logger repository.
>    * @param repository cannot be null
>    */
>   public HierarchyDynamicMBean(LoggerRepository repository) {
>     if (repository == null)
>       throw new NullPointerException();
>     this.repository = repository;
81a95
>     String cdesc = "Constructs a HierarchyDynamicMBean instance";
83c97
< "HierarchyDynamicMBean(): Constructs a HierarchyDynamicMBean instance",
---
>          cdesc,
84a99,101
>     dConstructors[1] = new MBeanConstructorInfo(
>          cdesc,
>          constructors[1]);
115c132
<     Logger log = LogManager.exists(name);
---
>     Logger log = repository.exists(name);
128c145
<     Enumeration e = hierarchy.getCurrentLoggers();
---
>     Enumeration e = repository.getCurrentLoggers();
243c260
<       return hierarchy.getThreshold();
---
>       return repository.getThreshold();
290,291c307,308
<     ((LoggerRepositoryEx)hierarchy).addLoggerEventListener(this);
<     Logger root = hierarchy.getRootLogger();
---
>     ((LoggerRepositoryEx)repository).addLoggerEventListener(this);
>     Logger root = repository.getRootLogger();
325,326c342,343
<                                       hierarchy.getThreshold());
<       hierarchy.setThreshold(l);
---
>                                       repository.getThreshold());
>       repository.setThreshold(l);
Index: src/java/org/apache/log4j/jmx/LoggerDynamicMBean.java
===================================================================
171c171
<     } else if(attributeName.startsWith("appender=")) {
---
>     } else if(attributeName.startsWith("appender_")) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to