Bug 1294010 - [GSS](6.4.z) There is no query filter implementation in MBeanServerConnection
Summary: [GSS](6.4.z) There is no query filter implementation in MBeanServerConnection
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JMX
Version: 6.4.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: CR1
: EAP 6.4.11
Assignee: Chao Wang
QA Contact: Peter Mackay
URL:
Whiteboard:
Depends On:
Blocks: eap6411-payload
TreeView+ depends on / blocked
 
Reported: 2015-12-24 01:54 UTC by Eiichi Nagai
Modified: 2019-10-10 10:47 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-01-17 13:08:03 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
reproducer (1.26 KB, application/zip)
2015-12-24 01:54 UTC, Eiichi Nagai
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker WFCORE-1257 0 Major Resolved support query filter implementation in MBeanServerConnection 2019-07-19 05:27:42 UTC

Description Eiichi Nagai 2015-12-24 01:54:58 UTC
Created attachment 1109124 [details]
reproducer

Description of problem:
The query argument does not work with MBeanServerConnection#queryNames( https://docs.oracle.com/javase/7/docs/api/javax/management/MBeanServerConnection.html#queryNames%28javax.management.ObjectName,%20javax.management.QueryExp%29).

Version-Release number of selected component (if applicable):
EAP 6.4.5.

How reproducible:
Using MBeanServerConnection on EAP 6.

Steps to Reproduce:
1. Deploye test.war.
2. Execute "http://localhost:8080/test/test.jsp".

Actual results:
You can get all object by MBeanServerConnection#queryNames(null, query) even if it is set a QueryExp object as query argument.

- test.jsp.
~~
      QueryExp exp = Query.eq(Query.attr("test-attr"), Query.value("1234"));
      Set<ObjectName> names = mbsc.queryNames(null, exp);
~~

Expected results:
The query argument should have to be available in MBeanServerConnection.

Additional info:
As long as I checked source code of org.jboss.as.jmx.model.ModelControllerMBeanHelper.queryNames(ObjectName, QueryExp), there was no implementation for the query argument(It was TODO on source code).

- ModelControllerMBeanHelper#queryNames
~~~
    Set<ObjectName> queryNames(final ObjectName name, final QueryExp query) {
        return new RootResourceIterator<Set<ObjectName>>(accessControlUtil, getRootResourceAndRegistration().getResource(),
                new ObjectNameMatchResourceAction<Set<ObjectName>>(name) {

            Set<ObjectName> set = new HashSet<ObjectName>();

            @Override
            public boolean onResource(ObjectName resourceName) {
                if (name == null || name.apply(resourceName)) {
                    //TODO check query
                    set.add(resourceName);
                }
                return true;
            }

            @Override
            public Set<ObjectName> getResult() {
                if (set.size() == 1 && set.contains(ModelControllerMBeanHelper.createRootObjectName(domain))) {
                  return Collections.emptySet();
                }
                return set;
            }
        }).iterate();
~~~

Comment 2 JBoss JIRA Server 2016-01-04 20:13:30 UTC
Brian Stansberry <brian.stansberry> updated the status of jira WFCORE-1257 to Coding In Progress

Comment 4 Mike McCune 2016-03-28 22:24:40 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 5 Peter Mackay 2016-10-03 15:39:37 UTC
Verified with EAP 6.4.11.CP.CR1

Comment 6 Petr Penicka 2017-01-17 13:08:03 UTC
Retroactively bulk-closing issues from released EAP 6.4 cummulative patches.


Note You need to log in before you can comment on or make changes to this bug.