Annotation Interface Produces


@Documented @Retention(RUNTIME) @Target(METHOD) public @interface Produces
Declares a typed managed factory method. The factory receiver and parameters are graph dependencies. Owned returned AutoCloseable values are closed once by their owning scope; borrowed values remain the caller's responsibility. Lifecycle hooks are a separate hosting API.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Product ownership, independent of the factory receiver's ownership.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Returns an exact optional product name; Named's existing targets remain unchanged.
    Returns who disposes the produced value.
  • Element Details

    • name

      String name
      Returns an exact optional product name; Named's existing targets remain unchanged.
      Returns:
      the empty string for an unnamed product
      Default:
      ""
    • ownership

      Returns who disposes the produced value.
      Returns:
      managed ownership by default
      Default:
      OWNED