Annotation Interface AutoClose


@Target({TYPE,METHOD,FIELD}) @Retention(RUNTIME) @Documented public @interface AutoClose
Marks the annotated bean as auto-closeable. May be applied to a bean class, producer method or field or stereotype.

Auto-closeable beans may implement the AutoCloseable interface. If they do, the AutoCloseable.close() method is called during bean destruction. Note that bean destruction (Contextual.destroy(Object, CreationalContext)) may not throw, so exceptions thrown by AutoCloseable.close() are swallowed.

Since:
5.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Supports inline instantiation of the AutoClose annotation.