public static ServiceAdapter < Closeable > forCloseable ( ) { return new SimpleServiceAdapter < Closeable > ( false , true ) { @ Override protected void start ( Closeable instance ) { } @ Override protected void stop ( Closeable instance ) throws Exception { instance . close ( ) ; } } ; }
Returns factory which transforms Closeable object to ConcurrentService . On starting it doing nothing on stopping it close Closeable .