Package org.codehaus.groovy.control

# Class Janitor

java.lang.Object
org.codehaus.groovy.control.Janitor

All Implemented Interfaces:
  `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.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Janitor()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `cleanup()`
  Invokes cleanup on all registered participants and clears the registry.
  `void`
  `register(HasCleanup object)`
  Registers a cleanup participant to be closed later.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Janitor

    public Janitor()

- ## Method Details

  - ### register

    public void register(HasCleanup object)
    Registers a cleanup participant to be closed later.
    Parameters:
      `object` - the cleanup participant to register

  - ### cleanup

    public void cleanup()
    Invokes cleanup on all registered participants and clears the registry.
    Specified by:
      `cleanup` in interface `HasCleanup`