DestructingGuard
Date: 2012-06-29

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.chromium.sdk.util
Class DestructingGuard

    java.lang.Object
      org.chromium.sdk.util.DestructingGuard

    public class DestructingGuard

extends java.lang.Object

Helper class that destructs unfinished objects. It is needed when Java GC is not enough. It requires to be explicitly discharged if all went OK and destruction should be cancelled. Using this class may be more convenient that try/finally in Java.

Constructor Summary
`DestructingGuard()`

Method Summary
`void` | `addValue(Destructable destructable)` Adds another value that should be destructed.
`void` | `discharge()` Confirms that constructing has finished OKAY and no destruction is needed from now.
`void` | `doFinally()` This method is supposed to be called from finally clause.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DestructingGuard

    public DestructingGuard()

Method Detail

### discharge

    public void discharge()

  Confirms that constructing has finished OKAY and no destruction is needed from now.

### doFinally

    public void doFinally()

  This method is supposed to be called from finally clause. It performs destructing unless `discharge()` has been called.

### addValue

    public void addValue(Destructable destructable)

  Adds another value that should be destructed. Added values are destructed in reversed order.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD