Skip to content
This repository has been archived by the owner on Oct 3, 2022. It is now read-only.

JCacheManager.enableManagement spec violation #21

Closed
Mobe91 opened this issue Apr 23, 2014 · 2 comments
Closed

JCacheManager.enableManagement spec violation #21

Mobe91 opened this issue Apr 23, 2014 · 2 comments
Assignees
Labels
Milestone

Comments

@Mobe91
Copy link

Mobe91 commented Apr 23, 2014

The spec says:
"The platform MBeanServer is obtained using ManagementFactory.getPlatformMBeanServer()"

but the current enableManagement implementation uses registerObject which is implemented as follows

private void registerObject(final JCacheMXBean cacheMXBean) throws NotCompliantMBeanException,
        InstanceAlreadyExistsException, MBeanRegistrationException, MalformedObjectNameException {
        final ObjectName objectName = new ObjectName(cacheMXBean.getObjectName());
        if(mBeanServer.queryNames(objectName, null).isEmpty()) {
            mBeanServer.registerMBean(cacheMXBean, objectName);
        }
    }

mBeanServer is a newly created MBeanServer and is not obtained using ManagementFactory.getPlatformMBeanServer().

@alexsnaps alexsnaps added this to the 1.0.0 milestone Apr 24, 2014
@alexsnaps alexsnaps added the Bug label Apr 24, 2014
@alexsnaps alexsnaps self-assigned this Apr 24, 2014
@alexsnaps
Copy link
Member

We should make this configurable. Probably defaulting to the platform MBeanServer indeed.
It should be configurable because of how the TCK wants to test for this. Probably should try to get rid of the tck package from within the implementation as well.

@alexsnaps
Copy link
Member

Started a thread on the subject on our dev-mailing list https://groups.google.com/forum/#!topic/ehcache-dev/rCvdLPBzYFw
Not quite sure how we best fix this...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants