[ 
https://issues.apache.org/jira/browse/OAK-6375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16055642#comment-16055642
 ] 

Tomek Rękawek commented on OAK-6375:
------------------------------------

Maybe we can modify the WhiteboardUtils#registerMBean() method, so it adds all 
the passed attributes to {{jmx.objectname}} AND uses them for the whiteboard 
register() method as well?

{noformat}
diff --git 
a/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/spi/whiteboard/WhiteboardUtils.java
 
b/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/spi/whiteboard/WhiteboardUtils.java
index 7ec0bc7..6a5e6b2 100644
--- 
a/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/spi/whiteboard/WhiteboardUtils.java
+++ 
b/oak-core-spi/src/main/java/org/apache/jackrabbit/oak/spi/whiteboard/WhiteboardUtils.java
@@ -86,9 +86,12 @@ public class WhiteboardUtils {
             Hashtable<String, String> table = new Hashtable<String, 
String>(attrs);
             table.put("type", JmxUtil.quoteValueIfRequired(type));
             table.put("name", JmxUtil.quoteValueIfRequired(name));
-            return whiteboard.register(iface, bean, ImmutableMap.of(
-                    "jmx.objectname",
-                    new ObjectName(JMX_OAK_DOMAIN, table)));
+
+            ImmutableMap.Builder properties = ImmutableMap.builder();
+            properties.put("jmx.objectname", new ObjectName(JMX_OAK_DOMAIN, 
table));
+            properties.putAll(attrs);
+
+            return whiteboard.register(iface, bean, properties.build());
         } catch (MalformedObjectNameException e) {
             throw new IllegalArgumentException(e);
         }
{noformat}

> RevisionGCMbeans are not filtered correctly in the RepositoryManagement
> -----------------------------------------------------------------------
>
>                 Key: OAK-6375
>                 URL: https://issues.apache.org/jira/browse/OAK-6375
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.7.3
>            Reporter: Tomek Rękawek
>            Assignee: Tomek Rękawek
>             Fix For: 1.8, 1.7.4
>
>
> The RepositoryManagement uses the new Whiteboard#track(Class,Map) method to 
> get services with given role. When the OSGi implementation of the whiteboard 
> is being used, the filter is transformed into OSGi filter expression. 
> Particularly, the {{role}} property is being used to get the RevisionGCMBean 
> of the right type.
> However, the RevisionGCMBean role is being set as a part of the 
> {{jmx.objectname}} property, not a separate property. The {{jmx.objectname}} 
> property has following form:
> {noformat}
> org.apache.jackrabbit.oak:name=Revision garbage collection - 
> secondary,type=RevisionGarbageCollection,role=secondary
> {noformat}
> Because of that, an attempt to call the 
> RepositoryManagement#startRevisionGC() method (or its parametrized version) 
> fails.
> //cc: [~chetanm], [~mduerig]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to