-
Task
-
Resolution: Won't Do
-
Major
-
None
-
17.0.0.Final
-
None
-
None
Currently some codepoints do a manual safe close without a util library, some code points have custom util methods. Some projects have dependencies to more than one util and use more than one. Some custom utils log the failure, some not. Some standard libraries have a trace on the attempt to close and on the failure, some not. Some close statements lack of proper error handling, some do not free the closed resource.
Goal: Standardize the closing of resources, close all relevant resources and free them, properly reporting errors. Gain the possibility to trace potential resource leaks.
java.io.Closeable requires a idempotent behaviour, java.lang.AutoCloseable recommends it.
Current utilities in use:
- https://github.com/jbossas/jboss-vfs/blob/jboss-vfs-3.2.12.Final/src/main/java/org/jboss/vfs/VFSUtils.java#L592
- https://github.com/xnio/xnio/blob/3.8.4.Final/api/src/main/java/org/xnio/IoUtils.java#L131
- https://github.com/wildfly/wildfly-core/blob/17.0.0.Final/protocol/src/main/java/org/jboss/as/protocol/StreamUtils.java#L72
- https://github.com/wildfly/wildfly-core/blob/17.0.1.Final/process-controller/src/main/java/org/jboss/as/process/protocol/StreamUtils.java#L286
org.xnio.IoUtils.safeClose offers the most complete set of features:
- Closeable, Closeable..., AutoCloseable
- null check
- trace the attempt to close
- trace the error, if one occurs
- relates to
-
WFCORE-5614 Refactor resource closing (cli)
- Closed
-
WFCORE-5615 Refactor resource closing (controller)
- Closed
-
WFCORE-5616 Refactor resource closing (deployment)
- Closed
-
WFCORE-5617 Refactor resource closing (domain)
- Closed
-
WFCORE-5618 Refactor resource closing (elytron)
- Closed
-
WFCORE-5619 Refactor resource closing (host-controller)
- Closed
-
WFCORE-5620 Refactor resource closing (logging)
- Closed
-
WFCORE-5621 Refactor resource closing (management-client-content)
- Closed
-
WFCORE-5622 Refactor resource closing (model-test)
- Closed
-
WFCORE-5623 Refactor resource closing (patching)
- Closed
-
WFCORE-5624 Refactor resource closing (process-controller)
- Closed
-
WFCORE-5625 Refactor resource closing (protocol)
- Closed
-
WFCORE-5626 Refactor resource closing (security-manager)
- Closed
-
WFCORE-5627 Refactor resource closing (server)
- Closed