From 4d3d2016c4d494720443b4e04611cfbb5512eec2 Mon Sep 17 00:00:00 2001 From: "denghui.ddh" Date: Wed, 19 Jan 2022 10:14:13 +0800 Subject: [PATCH] refactor: move ProgressListener to common module --- .../jifa/common/listener}/DefaultProgressListener.java | 4 ++-- .../jifa/common/listener}/NoOpProgressListener.java | 4 ++-- .../eclipse/jifa/common/listener}/ProgressListener.java | 4 ++-- .../org/eclipse/jifa/hda/api/FilterProgressListener.java | 4 +++- .../java/org/eclipse/jifa/hda/api/HeapDumpAnalyzer.java | 3 ++- .../org/eclipse/jifa/hda/impl/HeapDumpAnalyzerImpl.java | 6 +++--- .../org/eclipse/jifa/hda/impl/ProgressListenerImpl.java | 4 ++-- .../java/org/eclipse/jifa/hdp/provider/MATProvider.java | 5 +++-- .../eclipse/jifa/worker/route/heapdump/HeapBaseRoute.java | 4 ++-- .../java/org/eclipse/jifa/worker/support/Analyzer.java | 7 +++---- 10 files changed, 24 insertions(+), 21 deletions(-) rename backend/{heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api => common/src/main/java/org/eclipse/jifa/common/listener}/DefaultProgressListener.java (95%) rename backend/{heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api => common/src/main/java/org/eclipse/jifa/common/listener}/NoOpProgressListener.java (89%) rename backend/{heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api => common/src/main/java/org/eclipse/jifa/common/listener}/ProgressListener.java (89%) diff --git a/backend/heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api/DefaultProgressListener.java b/backend/common/src/main/java/org/eclipse/jifa/common/listener/DefaultProgressListener.java similarity index 95% rename from backend/heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api/DefaultProgressListener.java rename to backend/common/src/main/java/org/eclipse/jifa/common/listener/DefaultProgressListener.java index 22328f7a..c9a91e69 100644 --- a/backend/heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api/DefaultProgressListener.java +++ b/backend/common/src/main/java/org/eclipse/jifa/common/listener/DefaultProgressListener.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2021 Contributors to the Eclipse Foundation + * Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: EPL-2.0 ********************************************************************************/ -package org.eclipse.jifa.hda.api; +package org.eclipse.jifa.common.listener; import java.io.PrintWriter; import java.io.StringWriter; diff --git a/backend/heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api/NoOpProgressListener.java b/backend/common/src/main/java/org/eclipse/jifa/common/listener/NoOpProgressListener.java similarity index 89% rename from backend/heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api/NoOpProgressListener.java rename to backend/common/src/main/java/org/eclipse/jifa/common/listener/NoOpProgressListener.java index 09ac4dcf..f5ab5074 100644 --- a/backend/heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api/NoOpProgressListener.java +++ b/backend/common/src/main/java/org/eclipse/jifa/common/listener/NoOpProgressListener.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2021 Contributors to the Eclipse Foundation + * Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: EPL-2.0 ********************************************************************************/ -package org.eclipse.jifa.hda.api; +package org.eclipse.jifa.common.listener; class NoOpProgressListener implements ProgressListener { diff --git a/backend/heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api/ProgressListener.java b/backend/common/src/main/java/org/eclipse/jifa/common/listener/ProgressListener.java similarity index 89% rename from backend/heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api/ProgressListener.java rename to backend/common/src/main/java/org/eclipse/jifa/common/listener/ProgressListener.java index 132def3a..9eb61e07 100644 --- a/backend/heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api/ProgressListener.java +++ b/backend/common/src/main/java/org/eclipse/jifa/common/listener/ProgressListener.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2021 Contributors to the Eclipse Foundation + * Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: EPL-2.0 ********************************************************************************/ -package org.eclipse.jifa.hda.api; +package org.eclipse.jifa.common.listener; public interface ProgressListener { diff --git a/backend/heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api/FilterProgressListener.java b/backend/heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api/FilterProgressListener.java index 27429644..56d50ca8 100644 --- a/backend/heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api/FilterProgressListener.java +++ b/backend/heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api/FilterProgressListener.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2021 Contributors to the Eclipse Foundation + * Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -13,6 +13,8 @@ package org.eclipse.jifa.hda.api; +import org.eclipse.jifa.common.listener.ProgressListener; + public class FilterProgressListener implements ProgressListener { ProgressListener listener; diff --git a/backend/heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api/HeapDumpAnalyzer.java b/backend/heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api/HeapDumpAnalyzer.java index 2c860c48..b723f904 100644 --- a/backend/heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api/HeapDumpAnalyzer.java +++ b/backend/heap-dump-analyzer/api/src/main/java/org/eclipse/jifa/hda/api/HeapDumpAnalyzer.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2021 Contributors to the Eclipse Foundation + * Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -12,6 +12,7 @@ ********************************************************************************/ package org.eclipse.jifa.hda.api; +import org.eclipse.jifa.common.listener.ProgressListener; import org.eclipse.jifa.common.vo.PageView; import org.eclipse.jifa.common.vo.support.SearchType; diff --git a/backend/heap-dump-analyzer/impl/src/main/java/org/eclipse/jifa/hda/impl/HeapDumpAnalyzerImpl.java b/backend/heap-dump-analyzer/impl/src/main/java/org/eclipse/jifa/hda/impl/HeapDumpAnalyzerImpl.java index fd15277f..61e5cc95 100644 --- a/backend/heap-dump-analyzer/impl/src/main/java/org/eclipse/jifa/hda/impl/HeapDumpAnalyzerImpl.java +++ b/backend/heap-dump-analyzer/impl/src/main/java/org/eclipse/jifa/hda/impl/HeapDumpAnalyzerImpl.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2021 Contributors to the Eclipse Foundation + * Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -25,7 +25,7 @@ import org.eclipse.jifa.hda.api.AnalysisException; import org.eclipse.jifa.hda.api.HeapDumpAnalyzer; import org.eclipse.jifa.hda.api.Model; -import org.eclipse.jifa.hda.api.ProgressListener; +import org.eclipse.jifa.common.listener.ProgressListener; import org.eclipse.mat.SnapshotException; import org.eclipse.mat.internal.snapshot.SnapshotQueryContext; import org.eclipse.mat.parser.model.ClassImpl; @@ -88,7 +88,7 @@ import static org.eclipse.jifa.common.vo.support.SearchPredicate.createPredicate; import static org.eclipse.jifa.hda.api.Model.*; -import static org.eclipse.jifa.hda.api.ProgressListener.NoOpProgressListener; +import static org.eclipse.jifa.common.listener.ProgressListener.NoOpProgressListener; import static org.eclipse.jifa.hda.impl.AnalysisContext.ClassLoaderExplorerData; import static org.eclipse.jifa.hda.impl.AnalysisContext.DirectByteBufferData; diff --git a/backend/heap-dump-analyzer/impl/src/main/java/org/eclipse/jifa/hda/impl/ProgressListenerImpl.java b/backend/heap-dump-analyzer/impl/src/main/java/org/eclipse/jifa/hda/impl/ProgressListenerImpl.java index 83e1e58b..c8462a6b 100644 --- a/backend/heap-dump-analyzer/impl/src/main/java/org/eclipse/jifa/hda/impl/ProgressListenerImpl.java +++ b/backend/heap-dump-analyzer/impl/src/main/java/org/eclipse/jifa/hda/impl/ProgressListenerImpl.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2021 Contributors to the Eclipse Foundation + * Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -14,7 +14,7 @@ package org.eclipse.jifa.hda.impl; import org.eclipse.jifa.hda.api.FilterProgressListener; -import org.eclipse.jifa.hda.api.ProgressListener; +import org.eclipse.jifa.common.listener.ProgressListener; import org.eclipse.mat.util.IProgressListener; public class ProgressListenerImpl extends FilterProgressListener implements IProgressListener { diff --git a/backend/heap-dump-analyzer/provider/src/main/java/org/eclipse/jifa/hdp/provider/MATProvider.java b/backend/heap-dump-analyzer/provider/src/main/java/org/eclipse/jifa/hdp/provider/MATProvider.java index 9a66c9dd..8fab0cca 100644 --- a/backend/heap-dump-analyzer/provider/src/main/java/org/eclipse/jifa/hdp/provider/MATProvider.java +++ b/backend/heap-dump-analyzer/provider/src/main/java/org/eclipse/jifa/hdp/provider/MATProvider.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2021 Contributors to the Eclipse Foundation + * Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -15,7 +15,7 @@ import org.eclipse.jifa.common.JifaException; import org.eclipse.jifa.hda.api.HeapDumpAnalyzer; -import org.eclipse.jifa.hda.api.ProgressListener; +import org.eclipse.jifa.common.listener.ProgressListener; import org.osgi.framework.Bundle; import org.osgi.framework.BundleException; import org.osgi.framework.Constants; @@ -60,6 +60,7 @@ private void init() { commonBase + ".cache", commonBase + ".vo", commonBase + ".vo.support", + commonBase + ".listener", "net.sf.cglib.beans", "net.sf.cglib.core", "net.sf.cglib.core.internal", diff --git a/backend/worker/src/main/java/org/eclipse/jifa/worker/route/heapdump/HeapBaseRoute.java b/backend/worker/src/main/java/org/eclipse/jifa/worker/route/heapdump/HeapBaseRoute.java index d68af502..d8d75f6a 100644 --- a/backend/worker/src/main/java/org/eclipse/jifa/worker/route/heapdump/HeapBaseRoute.java +++ b/backend/worker/src/main/java/org/eclipse/jifa/worker/route/heapdump/HeapBaseRoute.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2020, 2021 Contributors to the Eclipse Foundation + * Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -13,7 +13,7 @@ package org.eclipse.jifa.worker.route.heapdump; import org.eclipse.jifa.hda.api.HeapDumpAnalyzer; -import org.eclipse.jifa.hda.api.ProgressListener; +import org.eclipse.jifa.common.listener.ProgressListener; import org.eclipse.jifa.worker.route.BaseRoute; import org.eclipse.jifa.worker.route.MappingPrefix; import org.eclipse.jifa.worker.support.Analyzer; diff --git a/backend/worker/src/main/java/org/eclipse/jifa/worker/support/Analyzer.java b/backend/worker/src/main/java/org/eclipse/jifa/worker/support/Analyzer.java index ad51787b..b83a5cbe 100644 --- a/backend/worker/src/main/java/org/eclipse/jifa/worker/support/Analyzer.java +++ b/backend/worker/src/main/java/org/eclipse/jifa/worker/support/Analyzer.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2020, 2021 Contributors to the Eclipse Foundation + * Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -20,10 +20,9 @@ import org.eclipse.jifa.common.enums.ProgressState; import org.eclipse.jifa.common.util.ErrorUtil; import org.eclipse.jifa.common.util.FileUtil; -import org.eclipse.jifa.hda.api.DefaultProgressListener; +import org.eclipse.jifa.common.listener.DefaultProgressListener; import org.eclipse.jifa.hda.api.HeapDumpAnalyzer; -import org.eclipse.jifa.hda.api.ProgressListener; -import org.eclipse.jifa.worker.Constant; +import org.eclipse.jifa.common.listener.ProgressListener; import org.eclipse.jifa.worker.Worker; import org.eclipse.jifa.worker.WorkerGlobal; import org.slf4j.Logger;