[SPARK-1477]: Add the lifecycle interface 

@rxin  Here has inherited `Closeable` class