Remove Legacy Metrics
- Simplify MBeans - instead of wrapping to expose lifecycle methods, implement `ManageableLifecycle`. Register an additional MBean for polled endpoints to control the lifecycle. * Polishing - Move `QueueChannel` `@ManagedAttribute`s to `QueueChannelOperations` - Make all `AbstractEndpoints` `IntegrationManagedResource`s and remove `ManagedEndpoint` to allow exposure of any `@Managed*` methods (including those on `Pausable`) - Revert to `Lifecycle` for classes that are not related to endpoints - Remove legacy metrics from docs
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
@@ -47,6 +47,7 @@ import org.springframework.integration.file.filters.DiscardAwareFileListFilter;
|
||||
import org.springframework.integration.file.filters.FileListFilter;
|
||||
import org.springframework.integration.file.filters.ResettableFileListFilter;
|
||||
import org.springframework.integration.support.AbstractIntegrationMessageBuilder;
|
||||
import org.springframework.integration.support.management.ManageableLifecycle;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -91,7 +92,7 @@ import org.springframework.util.Assert;
|
||||
* @author Steven Pearce
|
||||
*/
|
||||
public class FileReadingMessageSource extends AbstractMessageSource<File>
|
||||
implements Lifecycle {
|
||||
implements ManageableLifecycle {
|
||||
|
||||
private static final int DEFAULT_INTERNAL_QUEUE_CAPACITY = 5;
|
||||
|
||||
@@ -416,7 +417,7 @@ public class FileReadingMessageSource extends AbstractMessageSource<File>
|
||||
|
||||
}
|
||||
|
||||
private class WatchServiceDirectoryScanner extends DefaultDirectoryScanner implements Lifecycle {
|
||||
private class WatchServiceDirectoryScanner extends DefaultDirectoryScanner implements ManageableLifecycle {
|
||||
|
||||
private final ConcurrentMap<Path, WatchKey> pathKeys = new ConcurrentHashMap<>();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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,6 @@ import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.context.Lifecycle;
|
||||
import org.springframework.expression.Expression;
|
||||
import org.springframework.expression.common.LiteralExpression;
|
||||
import org.springframework.expression.spel.support.StandardEvaluationContext;
|
||||
@@ -58,6 +57,7 @@ import org.springframework.integration.handler.MessageTriggerAction;
|
||||
import org.springframework.integration.support.locks.DefaultLockRegistry;
|
||||
import org.springframework.integration.support.locks.LockRegistry;
|
||||
import org.springframework.integration.support.locks.PassThruLockRegistry;
|
||||
import org.springframework.integration.support.management.ManageableLifecycle;
|
||||
import org.springframework.integration.support.utils.IntegrationUtils;
|
||||
import org.springframework.integration.util.WhileLockedProcessor;
|
||||
import org.springframework.messaging.Message;
|
||||
@@ -109,7 +109,7 @@ import org.springframework.util.StringUtils;
|
||||
* @author Alen Turkovic
|
||||
*/
|
||||
public class FileWritingMessageHandler extends AbstractReplyProducingMessageHandler
|
||||
implements Lifecycle, MessageTriggerAction {
|
||||
implements ManageableLifecycle, MessageTriggerAction {
|
||||
|
||||
private static final int DEFAULT_BUFFER_SIZE = 8192;
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.springframework.context.Lifecycle;
|
||||
import org.springframework.expression.Expression;
|
||||
import org.springframework.expression.common.LiteralExpression;
|
||||
import org.springframework.integration.IntegrationMessageHeaderAccessor;
|
||||
@@ -40,6 +39,7 @@ import org.springframework.integration.file.filters.ResettableFileListFilter;
|
||||
import org.springframework.integration.file.filters.ReversibleFileListFilter;
|
||||
import org.springframework.integration.file.remote.session.Session;
|
||||
import org.springframework.integration.file.support.FileUtils;
|
||||
import org.springframework.integration.support.management.ManageableLifecycle;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
@@ -56,7 +56,7 @@ import org.springframework.util.ObjectUtils;
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractRemoteFileStreamingMessageSource<F>
|
||||
extends AbstractFetchLimitingMessageSource<InputStream> implements Lifecycle {
|
||||
extends AbstractFetchLimitingMessageSource<InputStream> implements ManageableLifecycle {
|
||||
|
||||
private final RemoteFileTemplate<F> remoteFileTemplate;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
@@ -25,7 +25,6 @@ import java.util.Comparator;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.springframework.beans.factory.BeanInitializationException;
|
||||
import org.springframework.context.Lifecycle;
|
||||
import org.springframework.integration.endpoint.AbstractFetchLimitingMessageSource;
|
||||
import org.springframework.integration.file.DefaultDirectoryScanner;
|
||||
import org.springframework.integration.file.DirectoryScanner;
|
||||
@@ -37,6 +36,7 @@ import org.springframework.integration.file.filters.FileSystemPersistentAcceptOn
|
||||
import org.springframework.integration.file.filters.RegexPatternFileListFilter;
|
||||
import org.springframework.integration.metadata.SimpleMetadataStore;
|
||||
import org.springframework.integration.support.AbstractIntegrationMessageBuilder;
|
||||
import org.springframework.integration.support.management.ManageableLifecycle;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -65,7 +65,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public abstract class AbstractInboundFileSynchronizingMessageSource<F>
|
||||
extends AbstractFetchLimitingMessageSource<File>
|
||||
implements Lifecycle {
|
||||
implements ManageableLifecycle {
|
||||
|
||||
/**
|
||||
* An implementation that will handle the chores of actually connecting to and synchronizing
|
||||
|
||||
Reference in New Issue
Block a user