Bug 40251 - Hard coded JMX domain name for MBean instances
Summary: Hard coded JMX domain name for MBean instances
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.2
Hardware: Other other
: P2 minor
Target Milestone: ---
Assignee: log4j-dev
Depends on:
Reported: 2006-08-14 14:30 UTC by wing tung Leung
Modified: 2007-02-01 14:26 UTC (History)
0 users

Extended JMX MBean classes to allow alternate domain name (5.20 KB, patch)
2006-08-14 14:31 UTC, wing tung Leung
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description wing tung Leung 2006-08-14 14:30:06 UTC
(based on log4j-1.2.13)

Current JMX implementation has an hard coded domain name ("log4j") for
registering the MBean instances. This is not flexible enough when you need to
configure multiple log4j repositories, all in different applications running on
a J2EE server.

I made some minor changes which extends the current interface and adds the
option to specify your own domain name.

All comments are welcome.
Comment 1 wing tung Leung 2006-08-14 14:31:40 UTC
Created attachment 18716 [details]
Extended JMX MBean classes to allow alternate domain name

This patch allows you to chose your own domain name. All comments welcome.
Comment 2 Elias Ross 2007-01-26 22:54:48 UTC
Better would be for an MBean to create child MBeans within the same domain.

I fixed this for 1.3 (SVN head) and added a test demonstrating it works.
Comment 3 Curt Arnold 2007-01-30 14:03:44 UTC
Elias committed changes against log4j/trunk in rev 500491
Comment 4 Curt Arnold 2007-02-01 14:11:52 UTC
Previous commit caused Gump failure on unit tests since build.jmx was not a precondition for building 
the newly added unit test.  The newly added unit test is still not run, but rev 502375 at least fixes the 
build failure.

The previous change also resulted in the following compatibility issues with log4j 1.2.8:

   Removed org.apache.log4j.spi.HierarchyEventListener from the set of implemented interfaces
   Method 'public void addAppenderEvent(org.apache.log4j.Category, org.apache.log4j.Appender)' has 
been removed
  Method 'public void removeAppenderEvent(org.apache.log4j.Category, org.apache.log4j.Appender)' 
has been removed

Reopening bug until unit tests are integrated into tests/build.xml.
Comment 5 Curt Arnold 2007-02-01 14:26:21 UTC
Well except on JDK 1.3 and 1.4 since HierarchyMBeanTest depends on classes introduced in JDK 1.5.  Rev 
502381 suppresses compilation of that class for now.