|
WebObjects 5.2.3 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.webobjects.foundation.NSDisposableRegistry
A NSDisposableRegistry object is a registry of NSDisposable objects that
should be disposed when the registry is disposed. Objects can be added to a
registry with addObject
and addObjectsFromRegistry
,
or removed with removeObject
There are two ways you may 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 to interact with a disposable registry 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 class.
addObject(com.webobjects.foundation.NSDisposable)
,
addObjectsFromRegistry(com.webobjects.foundation.NSDisposableRegistry)
,
removeObject(com.webobjects.foundation.NSDisposable)
,
dispose()
,
NSDisposable
Constructor Summary | |
NSDisposableRegistry()
Creates an empty disposable registry. |
Method Summary | |
void |
addObject(NSDisposable disposable)
Adds disposable to the receiver so that disposable
will be disposed when this registry is disposed. |
void |
addObjectsFromRegistry(NSDisposableRegistry registry)
Adds the objects in registry to this registry, so that
registry 's objects will be disposed when this one
is disposed. |
void |
dispose()
Conformance to NSDisposable. |
void |
removeObject(NSDisposable object)
Removes object from the receiver. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public NSDisposableRegistry()
Method Detail |
public void addObject(NSDisposable disposable)
disposable
to the receiver so that disposable
will be disposed when this registry is disposed.
disposable
- input objects to be disposedpublic void addObjectsFromRegistry(NSDisposableRegistry registry)
registry
to this registry, so that
registry
's objects will be disposed when this one
is disposed.
registry
- a collection of objects to be disposedpublic void dispose()
dispose
in interface NSDisposable
NSDisposable.dispose()
public void removeObject(NSDisposable object)
object
from the receiver.
object
- input object that ill be removed from the receiverpublic String toString()
|
Last updated Thu Oct 21 15:04:16 PDT 2004. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |