ruanwenjun commented on a change in pull request #1530:
URL:
https://github.com/apache/incubator-seatunnel/pull/1530#discussion_r832106407
##########
File path:
seatunnel-apis/seatunnel-api-base/src/main/java/org/apache/seatunnel/plugin/Plugin.java
##########
@@ -39,7 +51,24 @@ default CheckResult checkConfig() {
return CheckResult.success();
}
- default void prepare(T prepareEnv) {
+ /**
+ * This is a lifecycle method, this method will be executed after Plugin
created.
+ *
+ * @param env environment
+ */
+ default void prepare(T env) {
+
+ }
+
+ /**
+ * This is a lifecycle method, this method will be executed before Plugin
destroy.
+ * It's used to release some resource. We will have multiple plugin, if
the former plugin throw exception when close,
+ * The follow plugins will not be close.
+ *
+ * @throws Exception when close failed.
+ */
+ default void close() throws Exception {
Review comment:
Thanks for your suggestion, this make sense to me. I have changed the
code, now the close method will always be invoked.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]