|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.osmosis.core.lifecycle.ReleasableContainer
public class ReleasableContainer
A container for releasable objects that must be freed. This implementation simplifies the creation of many releasable objects that must succeed or fail as a group. As each is created they are added to this container, and after they're all created successfully they can be cleared from this container.
Constructor Summary | |
---|---|
ReleasableContainer()
Creates a new instance. |
Method Summary | ||
---|---|---|
|
add(T object)
Adds a new object to be managed. |
|
void |
clear()
Removes all objects. |
|
void |
release()
Performs resource cleanup tasks such as closing files, or database connections. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReleasableContainer()
Method Detail |
---|
public <T extends Releasable> T add(T object)
T
- The type of object being stored.object
- The object to be stored.
public void clear()
public void release()
release
in interface Releasable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |