PATH |
- Inherits from:
- Object
- Implements:
- NSDisposable
- Serializable
- Package:
- com.webobjects.foundation
An NSDisposableRegistry object is a registry of NSDisposable objects that should be disposed when the registry is disposed. You can add objects to a registry with addObject and addObjectsFromRegistry, remove objects with removeObject, and dispose of a registries objects with dispose.
There are two ways in which you might interact with a disposable registry: adding objects to another object's registry and creating a class whose instances manage their own disposable registries. As an example of the former, consider the EOController class (defined in the eoapplication package and used in Direct to Java Client applications). EOController has a disposable registry, which you can access with the EOController method disposableRegistry. In EOController's dispose method, it disposes its disposable registry, which in turn disposes all its objects. You can get a controller's registry and add objects to it; they will be disposed along with the EOController. The second way in which you might interact with a disposable registry, then, is to create a class similar to EOController that uses a disposable registry to group objects that should be disposed of along with instances of your class.
public NSDisposableRegistry()
Creates an empty disposable registry.
public void addObject(NSDisposable anObject)
public void addObjectsFromRegistry(NSDisposableRegistry aDisposableRegistry)
public void dispose()
See Also: dispose ( NSDisposable)
public void removeObject(NSDisposable anObject)
public String toString()
© 2001 Apple Computer, Inc. (Last Published April 17, 2001)