class ResourceRewriter extends PlanningHook

Rewrites bindings implemented with _ <: AutoCloseable into resource bindings that automatically close the implementation closeable.

class XImpl extends AutoCloseable
make[X].from[XImpl]

becomes:

make[X].fromResource {
 ClassConstructor[XImpl].map(distage.Lifecycle.fromAutoCloseable(_))
}

Will produce warnings for all rewritten bindings, so better explicitly use .fromResource!

Linear Supertypes
PlanningHook, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ResourceRewriter
  2. PlanningHook
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ResourceRewriter(logger: IzLogger, rules: RewriteRules)

Value Members

  1. def hookDefinition(definition: ModuleBase): ModuleBase
    Definition Classes
    ResourceRewriterPlanningHook