|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.util.Cleanups
public class Cleanups
Utilities to clean up resources when the application is stopping.
Currently, when a ZK application is stopping, ZK will invoke cleanup()
.
Thus you can register an implementation of Cleanups.Cleanup
to release the resources.
Notice that this utility is introduced mainly to resolve the memory lead issue if an application is hot re-deployed. A typical example is to stop any pooled threads.
First, register the cleanup with add(org.zkoss.util.Cleanups.Cleanup)
.
Second, invoke cleanup()
when necessary, such as when the application
is stopping
Nested Class Summary | |
---|---|
static interface |
Cleanups.Cleanup
The interface to implement for each cleanup. |
Constructor Summary | |
---|---|
Cleanups()
|
Method Summary | |
---|---|
static boolean |
add(Cleanups.Cleanup cleanup)
Registers a cleanup. |
static void |
cleanup()
Invokes all cleanups registered with add(org.zkoss.util.Cleanups.Cleanup) . |
static boolean |
remove(Cleanups.Cleanup cleanup)
Un-registers a cleanup. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Cleanups()
Method Detail |
---|
public static boolean add(Cleanups.Cleanup cleanup)
public static boolean remove(Cleanups.Cleanup cleanup)
public static void cleanup()
add(org.zkoss.util.Cleanups.Cleanup)
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |