INT-2413 <int-jmx:mbean-export/> And <control-bus>
When an AbstractMappingMessageRouter is included in an ApplicationContext that also has an <int-jmx:mbean-exporter/>, the @ManagedOperations (set and remove mapping) are no longer visible to the <control-bus/>. Adds these methods to a new interface MappingMessageRouterManagement, thus making them available on the proxy that the MBean exporter creates.
This commit is contained in:
committed by
Mark Fisher
parent
e39a40581d
commit
b899595e01
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -45,7 +45,7 @@ import org.springframework.util.StringUtils;
|
||||
* @author Gary Russell
|
||||
* @since 2.1
|
||||
*/
|
||||
public abstract class AbstractMappingMessageRouter extends AbstractMessageRouter {
|
||||
public abstract class AbstractMappingMessageRouter extends AbstractMessageRouter implements MappingMessageRouterManagement {
|
||||
|
||||
private volatile Map<String, String> channelMappings = new ConcurrentHashMap<String, String>();
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed 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.springframework.integration.router;
|
||||
|
||||
import org.springframework.jmx.export.annotation.ManagedOperation;
|
||||
|
||||
/**
|
||||
* @author Gary Russell
|
||||
* @since 2.1
|
||||
*
|
||||
*/
|
||||
public interface MappingMessageRouterManagement {
|
||||
|
||||
/**
|
||||
* Add a channel mapping from the provided key to channel name.
|
||||
*/
|
||||
@ManagedOperation
|
||||
public abstract void setChannelMapping(String key, String channelName);
|
||||
|
||||
/**
|
||||
* Remove a channel mapping for the given key if present.
|
||||
*/
|
||||
@ManagedOperation
|
||||
public abstract void removeChannelMapping(String key);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user