diff options
author | Decebal Suiu <decebal.suiu@gmail.com> | 2024-02-13 20:54:32 +0200 |
---|---|---|
committer | Decebal Suiu <decebal.suiu@gmail.com> | 2024-02-13 20:54:32 +0200 |
commit | a53a86dec50973d7995525ae5442904aeb6023fa (patch) | |
tree | 613f5531da72f275ec13cdbc4df5ec6a2191df7f | |
parent | 3abd43570e1bc9690587e085edd98aecd6bfeb91 (diff) | |
download | pf4j-resolve_recovery_strategy.tar.gz pf4j-resolve_recovery_strategy.zip |
Changes according to code reviewresolve_recovery_strategy
-rw-r--r-- | pf4j/src/main/java/org/pf4j/AbstractPluginManager.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java b/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java index 1d9f35e..d85bbec 100644 --- a/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java +++ b/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java @@ -31,6 +31,7 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; @@ -305,6 +306,7 @@ public abstract class AbstractPluginManager implements PluginManager { log.info("Unload plugin '{}'", getPluginLabel(pluginWrapper.getDescriptor())); } catch (Exception e) { + log.error("Cannot stop plugin '{}'", getPluginLabel(pluginWrapper.getDescriptor()), e); pluginState = PluginState.FAILED; } @@ -1092,7 +1094,7 @@ public abstract class AbstractPluginManager implements PluginManager { * * @return the strategy */ - protected ResolveRecoveryStrategy getResolveRecoveryStrategy() { + protected final ResolveRecoveryStrategy getResolveRecoveryStrategy() { return resolveRecoveryStrategy; } @@ -1102,6 +1104,7 @@ public abstract class AbstractPluginManager implements PluginManager { * @param resolveRecoveryStrategy the strategy */ protected void setResolveRecoveryStrategy(ResolveRecoveryStrategy resolveRecoveryStrategy) { + Objects.requireNonNull(resolveRecoveryStrategy, "resolveRecoveryStrategy cannot be null"); this.resolveRecoveryStrategy = resolveRecoveryStrategy; } @@ -1109,7 +1112,7 @@ public abstract class AbstractPluginManager implements PluginManager { * Strategy for handling the recovery of a plugin that could not be resolved * (loaded) due to a dependency problem. */ - enum ResolveRecoveryStrategy { + public enum ResolveRecoveryStrategy { /** * Throw an exception when a resolve (load) failure occurs. |