INT-1552 doc polishing, and added @ManagedResource/@ManagedOperation on the AbstractMessageRouter (for dynamic control over mappings)

This commit is contained in:
Mark Fisher
2010-11-22 15:10:40 -05:00
parent 5dc6763735
commit a3c4099c6c
2 changed files with 55 additions and 46 deletions

View File

@@ -36,6 +36,8 @@ import org.springframework.integration.support.MessageBuilder;
import org.springframework.integration.support.channel.BeanFactoryChannelResolver;
import org.springframework.integration.support.channel.ChannelResolutionException;
import org.springframework.integration.support.channel.ChannelResolver;
import org.springframework.jmx.export.annotation.ManagedOperation;
import org.springframework.jmx.export.annotation.ManagedResource;
import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
@@ -46,6 +48,7 @@ import org.springframework.util.StringUtils;
* @author Mark Fisher
* @author Oleg Zhurakousky
*/
@ManagedResource
public abstract class AbstractMessageRouter extends AbstractMessageHandler {
private volatile MessageChannel defaultOutputChannel;
@@ -102,7 +105,8 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler {
this.channelIdentifierMap.putAll(channelIdentifierMap);
}
public void setChannelMapping(String channelIdentifier, String channelName){
@ManagedOperation
public void setChannelMapping(String channelIdentifier, String channelName) {
this.channelIdentifierMap.put(channelIdentifier, channelName);
}
@@ -110,7 +114,8 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler {
* Removes channel mapping for a give channel identifier
* @param channelIdentifier
*/
public void removeChannelMapping(String channelIdentifier){
@ManagedOperation
public void removeChannelMapping(String channelIdentifier) {
this.channelIdentifierMap.remove(channelIdentifier);
}