Package: org.codehaus.groovy.control

## [Java] Class Janitor

- org.codehaus.groovy.control.Janitor

- All Implemented Interfaces and Traits:
    HasCleanup

      public class Janitor
      extends Object
      implements HasCleanup

  An agent that can be used to defer cleanup operations to a later time. Users much implement the HasCleanup interface.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `cleanup()` Invokes cleanup on all registered participants and clears the registry.
    `` | `public void` | `register(HasCleanup object)` Registers a cleanup participant to be closed later.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public void cleanup()

      Invokes cleanup on all registered participants and clears the registry.

    - #### public void register(HasCleanup object)

      Registers a cleanup participant to be closed later.

      Parameters:
        `object` - the cleanup participant to register