net.sf.staccatocommons.io.internal.lifecycle
Class CloseableLifecycle<TargetType extends Closeable,ReturnType>
java.lang.Object
net.sf.staccatocommons.io.internal.lifecycle.Lifecycle<TargetType,ReturnType>
net.sf.staccatocommons.io.internal.lifecycle.CloseableLifecycle<TargetType,ReturnType>
- Type Parameters:
TargetType - ReturnType -
- All Implemented Interfaces:
- Callable<ReturnType>, net.sf.staccatocommons.defs.Thunk<ReturnType>
- Direct Known Subclasses:
- CharSerializationLifecycle, SerializationLifecycle
public abstract class CloseableLifecycle<TargetType extends Closeable,ReturnType>
- extends Lifecycle<TargetType,ReturnType>
Abstract Lifecycle that closes target on disposing it.
- Author:
- flbulgarelli
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CloseableLifecycle
public CloseableLifecycle()
dispose
public final void dispose(TargetType target)
throws Exception
- Description copied from class:
Lifecycle
- Disposes the resource.
Default implementation does nothing, subclasses may want to override this
method to add disposal logic
- Overrides:
dispose in class Lifecycle<TargetType extends Closeable,ReturnType>
- Throws:
Exception - if any error occurs
Copyright © 2010-2012 Staccatocommons. All Rights Reserved.