net.sf.staccatocommons.io.internal.lifecycle
Class CloseableLifecycle<TargetType extends Closeable,ReturnType>

java.lang.Object
  extended by net.sf.staccatocommons.io.internal.lifecycle.Lifecycle<TargetType,ReturnType>
      extended by 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

Constructor Summary
CloseableLifecycle()
           
 
Method Summary
 void dispose(TargetType target)
          Disposes the resource.
 
Methods inherited from class net.sf.staccatocommons.io.internal.lifecycle.Lifecycle
call, doVoidWork, doWork, initialize, throwing, throwing, value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CloseableLifecycle

public CloseableLifecycle()
Method Detail

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.