Index: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexMBeanRegistration.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexMBeanRegistration.java (revision 1806780) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexMBeanRegistration.java (working copy) @@ -41,7 +41,10 @@ public void registerAsyncIndexer(AsyncIndexUpdate task, long delayInSeconds) { task.setIndexMBeanRegistration(this); - Map config = ImmutableMap.of(AsyncIndexUpdate.PROP_ASYNC_NAME, task.getName()); + Map config = ImmutableMap.of( + AsyncIndexUpdate.PROP_ASYNC_NAME, task.getName(), + "scheduler.name", AsyncIndexUpdate.class.getName() + "-" + task.getName() + ); regs.add(scheduleWithFixedDelay(whiteboard, task, config, delayInSeconds, true, true)); regs.add(registerMBean(whiteboard, IndexStatsMBean.class, task.getIndexStats(), IndexStatsMBean.TYPE, task.getName())); Index: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/IndexMBeanRegistrationTest.java =================================================================== --- oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/IndexMBeanRegistrationTest.java (nonexistent) +++ oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/IndexMBeanRegistrationTest.java (working copy) @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.jackrabbit.oak.plugins.index; + +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; + +import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore; +import org.apache.jackrabbit.oak.spi.whiteboard.DefaultWhiteboard; +import org.apache.jackrabbit.oak.spi.whiteboard.Registration; +import org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +public class IndexMBeanRegistrationTest { + + @Test + public void jobName() throws Exception { + final AtomicReference> props = new AtomicReference>(); + Whiteboard wb = new DefaultWhiteboard(){ + @Override + public Registration register(Class type, T service, Map properties) { + if (service instanceof AsyncIndexUpdate) { + props.set(properties); + } + return super.register(type, service, properties); + } + }; + + AsyncIndexUpdate update = new AsyncIndexUpdate("async", + new MemoryNodeStore(), new CompositeIndexEditorProvider()); + IndexMBeanRegistration reg = new IndexMBeanRegistration(wb); + reg.registerAsyncIndexer(update, 5); + try { + Map map = props.get(); + assertNotNull(map); + assertEquals(AsyncIndexUpdate.class.getName() + "-async", + map.get("scheduler.name")); + } finally { + reg.unregister(); + } + } +} Property changes on: oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/IndexMBeanRegistrationTest.java ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property